diff --git a/includes/discovery/libvirt-vminfo.inc.php b/includes/discovery/libvirt-vminfo.inc.php index 070542b58c..67de5ecd87 100644 --- a/includes/discovery/libvirt-vminfo.inc.php +++ b/includes/discovery/libvirt-vminfo.inc.php @@ -74,7 +74,8 @@ if (Config::get('enable_libvirt') && $device['os'] == 'linux') { // libvirt does not supply this exec(Config::get('virsh') . ' -rc ' . $uri . ' domstate ' . $dom_id, $vm_state); $vmwVmState = ucfirst($vm_state[0]); - + unset($vm_state); + $vmwVmCpus = $xml->vcpu['current']; if (! isset($vmwVmCpus)) { $vmwVmCpus = $xml->vcpu; diff --git a/includes/html/print-vm.inc.php b/includes/html/print-vm.inc.php index 449afbb65e..7fe0da6c15 100644 --- a/includes/html/print-vm.inc.php +++ b/includes/html/print-vm.inc.php @@ -11,11 +11,11 @@ if (getidbyname($vm['vmwVmDisplayName'])) { echo ''; -if ($vm['vmwVmState'] == 'powered off') { +if ($vm['vmwVmState'] == 'powered off' || $vm['vmwVmState'] == 'Shut off') { echo 'OFF'; -} elseif ($vm['vmwVmState'] == 'powered on') { +} elseif ($vm['vmwVmState'] == 'powered on' || $vm['vmwVmState'] == 'Running') { echo 'ON'; -} elseif ($vm['vmwVmState'] == 'suspended') { +} elseif ($vm['vmwVmState'] == 'suspended' || $vm['vmwVmState'] == 'Paused') { echo 'SUSPEND'; }