16 require_once(
'../lib/common-vm.php');
48 'fo-debian-squeeze32.fc.hp.com',
49 'fo-debian-squeeze64.fc.hp.com',
50 'fo-debian-wheezy32.fc.hp.com',
51 'fo-debian-wheezy64.fc.hp.com',
52 'fo-centos-6-32.fc.hp.com',
53 'fo-centos-6-64.fc.hp.com',
54 'fo-fedora-19-32.fc.hp.com',
55 'fo-fedora-19-64.fc.hp.com',
56 'fo-fedora-18-32.fc.hp.com',
57 'fo-fedora-18-64.fc.hp.com',
58 'fo-ubuntu-1204-32.fc.hp.com',
59 'fo-ubuntu-1204-64.fc.hp.com',
60 'fo-ubuntu-1210-32.fc.hp.com',
61 'fo-ubuntu-1210-64.fc.hp.com',
62 'fo-ubuntu-1304-32.fc.hp.com',
63 'fo-ubuntu-1304-64.fc.hp.com',
64 'fo-ubuntu-1310-32.fc.hp.com',
65 'fo-ubuntu-1310-64.fc.hp.com',
66 'fo-fedora-20-32.fc.hp.com',
67 'fo-fedora-20-64.fc.hp.com',
68 'fo-ubuntu-1404-32.fc.hp.com',
69 'fo-ubuntu-1404-64.fc.hp.com',
80 foreach($vmServers as $host)
83 $cmd =
"vmware-cmd -H $host -U root -P iforgot -l";
84 $last = exec($cmd, $listOut, $rtn);
85 foreach($listOut as $vmMachine)
91 $parts = explode(
'/', $vmMachine);
92 if(in_array(
trim($parts[4]), $pkgVms))
95 $vmList[] = $vmMachine;
97 $hosts[$host] = $vmList;
109 $machinesReady = array();
110 foreach($hosts as $host => $vms)
114 echo
"Note: no vm's for host $host\n";
119 if(!vmOps($host, $vm,
'getstate'))
121 echo
"Warning: $vm would not start, not in this test run.\n";
124 if(!vmOps($host, $vm,
'hassnapshot'))
126 echo
"Warning: $vm does not have a snapshot!\n";
129 $machinesReady[$host][] = $vm;
137 $dataFile =
'vm.ini';
138 $VM = fopen($dataFile,
'w') or die("
FATAL! Cannot open $dataFile\n");
139 $message = "; This file was generated by vmcheck.php on:" .
140 date("D M j G:i:
s T Y") . "\n\n";
141 fwrite($VM, $message);
142 foreach ($machinesReady as $host => $vms)
144 if(!fwrite($VM,
'[' . $host .
"]\n"))
146 echo
"FATAL! could not write to $dataFile\n";
149 foreach ($vms as $vm)
151 $vmParts = explode(
'/', $vm);
152 if(!fwrite($VM, $vmParts[4] .
'=' .
"$vm\n"))
154 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.