|
|
@ -711,10 +711,11 @@ class LinuxVirtual(Virtual):
|
|
|
|
def get_virtual_facts(self):
|
|
|
|
def get_virtual_facts(self):
|
|
|
|
if os.path.exists("/proc/xen"):
|
|
|
|
if os.path.exists("/proc/xen"):
|
|
|
|
self.facts['virtualization_type'] = 'xen'
|
|
|
|
self.facts['virtualization_type'] = 'xen'
|
|
|
|
|
|
|
|
self.facts['virtualization_role'] = 'guest'
|
|
|
|
if os.path.exists('/proc/xen/capabilities'):
|
|
|
|
if os.path.exists('/proc/xen/capabilities'):
|
|
|
|
|
|
|
|
for line in open('/proc/xen/capabilities'):
|
|
|
|
|
|
|
|
if "control_d" in line:
|
|
|
|
self.facts['virtualization_role'] = 'host'
|
|
|
|
self.facts['virtualization_role'] = 'host'
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.facts['virtualization_role'] = 'guest'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif os.path.exists('/proc/vz'):
|
|
|
|
elif os.path.exists('/proc/vz'):
|
|
|
|
self.facts['virtualization_type'] = 'openvz'
|
|
|
|
self.facts['virtualization_type'] = 'openvz'
|
|
|
|