// moo.example.com
// 48cf6378-6fd5-4610-0611-63dd4b31cfd6
// 1048576
// 1048576
// 8
//
// hvm
//
//
//
//
// (...)
// Parse XML, add xml header in front as this is required by the parser but not supplied by libvirt
$xml = simplexml_load_string(' ' . $vm_info_xml);
print_debug_vars($xml);
// Call VM discovery
discover_virtual_machine($valid, $device, [ 'id' => $xml->uuid,
'name' => $vm_DisplayName,
'cpucount' => $xml->vcpu,
'memory' => $xml->currentMemory * 1024,
'status' => $vm_State,
'type' => explode('+', $method)[0],
'source' => 'libvirt',
'protocol' => 'libvirt' ]);
// Save the discovered Virtual Machine.
$libvirt_vmlist[] = $vm_DisplayName;
}
}
}
// If we found VMs, don't cycle the other protocols anymore.
if (!safe_empty($libvirt_vmlist)) {
break;
}
}
unset($libvirt_vmlist);
// Clean up removed VMs (our type - libvirt - only, so we don't clean up other modules' VMs)
check_valid_virtual_machines($device, $valid, 'libvirt');
echo(PHP_EOL);
// EOF