示例#1
0
/**
 * @param $vm_id
 *
 * @return bool
 */
function ace_virt_vm_exists($vm_id)
{
    $lab_id = ace_vm_get_lab_id($vm_id);
    $host_id = ace_lab_get_host_id($lab_id);
    $vm_virt_id = ace_db_vm_get_virt_id($vm_id);
    $host_vm_list = ace_host_get_virt_vm_list($host_id);
    if (is_array($host_vm_list)) {
        if (in_array($vm_virt_id, $host_vm_list)) {
            $return = TRUE;
        } else {
            $return = FALSE;
        }
    } else {
        $return = FALSE;
    }
    return $return;
}
示例#2
0
                 $tenant_volume_count++;
             }
         }
     }
     $host_network_list = ace_host_get_virt_network_list($host['id']);
     //$host_network_count = count($host_network_list);
     $host_network_count = 0;
     $tenant_network_count = 0;
     foreach ($host_network_list as $host_network) {
         if (substr($host_network, 0, 2) == '0-') {
             $host_network_count++;
         } else {
             $tenant_network_count++;
         }
     }
     $host_vm_list = ace_host_get_virt_vm_list($host['id']);
     $host_lab_count = 0;
     $host_vm_count = 0;
     $tenant_vm_count = 0;
     foreach ($host_vm_list as $host_vm) {
         if (substr($host_vm, 0, 2) == '0-' || substr($host_vm, -3, 3) == '-00') {
             $host_vm_count++;
             if (substr($host_vm, -3, 3) == '-00') {
                 $host_lab_count++;
             }
         } else {
             $tenant_vm_count++;
         }
     }
 } else {
     $host_class = 'inactive';