}
         }
     }
 }
 $doms = $lv->get_domains();
 $domkeys = array_keys($doms);
 echo "<table>\n\t\t\t   <tr>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>CPU#</th>\n\t\t\t\t<th>Memory</th>\n\t\t\t\t<th>Disk(s)</th>\n\t\t\t\t<th>NICs</th>\n\t\t\t\t<th>Arch</th>\n\t\t\t\t<th>State</th>\n\t\t\t\t<th>ID / VNC port</th>";
 if ($tmp['active'] > 0 && $lv->supports('screenshot')) {
     echo "\n\t\t\t\t<th>Domain screenshot</th>\n\t\t\t\t";
 }
 echo "\n\t\t\t\t<th>Action</th>\n\t\t\t  </tr>";
 $active = $tmp['active'];
 for ($i = 0; $i < sizeof($doms); $i++) {
     $name = $doms[$i];
     $res = $lv->get_domain_by_name($name);
     $uuid = libvirt_domain_get_uuid_string($res);
     $dom = $lv->domain_get_info($name);
     $mem = number_format($dom['memory'] / 1024, 2, '.', ' ') . ' MB';
     $cpu = $dom['nrVirtCpu'];
     $state = $lv->domain_state_translate($dom['state']);
     $id = $lv->domain_get_id($res);
     $arch = $lv->domain_get_arch($res);
     $vnc = $lv->domain_get_vnc_port($res);
     $nics = $lv->get_network_cards($res);
     if (($diskcnt = $lv->get_disk_count($res)) > 0) {
         $disks = $diskcnt . ' / ' . $lv->get_disk_capacity($res);
         $diskdesc = 'Current physical size: ' . $lv->get_disk_capacity($res, true);
     } else {
         $disks = '-';
         $diskdesc = '';
     }
Beispiel #2
0
		function domain_get_uuid($domain) {
			$dom = $this->get_domain_object($domain);
			if (!$dom)
				return false;

			$tmp = libvirt_domain_get_uuid_string($dom);
			return ($tmp) ? $tmp : $this->_set_last_error();
		}