27 require_once(
'../lib/common-vm.php');
59 'fo-debian-squeeze32.fc.hp.com',
60 'fo-debian-squeeze64.fc.hp.com',
61 'fo-debian-wheezy32.fc.hp.com',
62 'fo-debian-wheezy64.fc.hp.com',
63 'fo-centos-6-32.fc.hp.com',
64 'fo-centos-6-64.fc.hp.com',
65 'fo-fedora-19-32.fc.hp.com',
66 'fo-fedora-19-64.fc.hp.com',
67 'fo-fedora-18-32.fc.hp.com',
68 'fo-fedora-18-64.fc.hp.com',
69 'fo-ubuntu-1204-32.fc.hp.com',
70 'fo-ubuntu-1204-64.fc.hp.com',
71 'fo-ubuntu-1210-32.fc.hp.com',
72 'fo-ubuntu-1210-64.fc.hp.com',
73 'fo-ubuntu-1304-32.fc.hp.com',
74 'fo-ubuntu-1304-64.fc.hp.com',
75 'fo-ubuntu-1310-32.fc.hp.com',
76 'fo-ubuntu-1310-64.fc.hp.com',
77 'fo-fedora-20-32.fc.hp.com',
78 'fo-fedora-20-64.fc.hp.com',
79 'fo-ubuntu-1404-32.fc.hp.com',
80 'fo-ubuntu-1404-64.fc.hp.com',
91 foreach($vmServers as $host)
94 $cmd =
"vmware-cmd -H $host -U root -P iforgot -l";
95 $last = exec($cmd, $listOut, $rtn);
96 foreach($listOut as $vmMachine)
102 $parts = explode(
'/', $vmMachine);
103 if(in_array(
trim($parts[4]), $pkgVms))
106 $vmList[] = $vmMachine;
108 $hosts[$host] = $vmList;
120 $machinesReady = array();
121 foreach($hosts as $host => $vms)
125 echo
"Note: no vm's for host $host\n";
130 if(!vmOps($host, $vm,
'getstate'))
132 echo
"Warning: $vm would not start, not in this test run.\n";
135 if(!vmOps($host, $vm,
'hassnapshot'))
137 echo
"Warning: $vm does not have a snapshot!\n";
140 $machinesReady[$host][] = $vm;
148 $dataFile =
'vm.ini';
149 $VM = fopen($dataFile,
'w') or die("
FATAL! Cannot open $dataFile\n");
150 $message = "; This file was generated by vmcheck.php on:" .
151 date("D M j G:i:
s T Y") . "\n\n";
152 fwrite($VM, $message);
153 foreach ($machinesReady as $host => $vms)
155 if(!fwrite($VM,
'[' . $host .
"]\n"))
157 echo
"FATAL! could not write to $dataFile\n";
160 foreach ($vms as $vm)
162 $vmParts = explode(
'/', $vm);
163 if(!fwrite($VM, $vmParts[4] .
'=' .
"$vm\n"))
165 echo
"FATAL! could not write to $dataFile\n";
int s
The socket that the CLI will use to communicate.
char * trim(char *ptext)
Trimming whitespace.