 ca72456409
			
		
	
	ca72456409
	
	
	
		
			
			VTX is required when using KVM as hypervisor on compute nodes. When the fact will be merged upstream, the lib/facter/vtx.rb file will be dropped to use the one from facter-core. Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
		
			
				
	
	
		
			28 lines
		
	
	
		
			490 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			490 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # Fact: vtx
 | |
| #
 | |
| # Purpose:
 | |
| #   Determine whether VT-X is enabled on the node.
 | |
| #
 | |
| # Resolution:
 | |
| #   Checks for vmx (intel) or svm (amd) is part of /proc/cpuinfo flags
 | |
| #
 | |
| # Caveats:
 | |
| #
 | |
| 
 | |
| # Author: Emilien Macchi <emilien.macchi@enovance.com>
 | |
| 
 | |
| Facter.add('vtx') do
 | |
|   confine :kernel => :linux
 | |
|   setcode do
 | |
|     result = false
 | |
|     begin
 | |
|       # test on Intel and AMD plateforms
 | |
|       if File.read('/proc/cpuinfo') =~ /(vmx|svm)/
 | |
|         result = true
 | |
|       end
 | |
|     rescue
 | |
|     end
 | |
|     result
 | |
|   end
 | |
| end
 |