Fix GCE and scaleway VM detection (#47193)

* Fix Google cloud engine & Scaleway VM detection
pull/4420/head
Lex Rivera 2018-11-30 13:38:43 +03:00 committed by John R Barker
parent 0dbac3f3b8
commit aa484c0835
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- "facts - detect VMs from google cloud engine and scaleway"

View File

@ -152,6 +152,16 @@ class LinuxVirtual(Virtual):
virtual_facts['virtualization_role'] = 'guest' virtual_facts['virtualization_role'] = 'guest'
return virtual_facts return virtual_facts
if sys_vendor == 'Google':
virtual_facts['virtualization_type'] = 'kvm'
virtual_facts['virtualization_role'] = 'guest'
return virtual_facts
if sys_vendor == 'Scaleway':
virtual_facts['virtualization_type'] = 'kvm'
virtual_facts['virtualization_role'] = 'guest'
return virtual_facts
if os.path.exists('/proc/self/status'): if os.path.exists('/proc/self/status'):
for line in get_file_lines('/proc/self/status'): for line in get_file_lines('/proc/self/status'):
if re.match(r'^VxID:\s+\d+', line): if re.match(r'^VxID:\s+\d+', line):