1 |
<?php |
2 |
|
3 |
require('config.php'); |
4 |
include('xenapi.php'); |
5 |
|
6 |
/* Establish session with Xenserver */ |
7 |
$xenserver = new XenApi($url, $login, $password); |
8 |
|
9 |
$srlist = $xenserver->SR__get_all_records(); |
10 |
|
11 |
foreach($srlist as $sr) { |
12 |
$srname = $sr["name_label"]; |
13 |
$srtype = $sr["type"]; |
14 |
if ($srtype != "iso" ) |
15 |
continue; |
16 |
//var_dump($sr); |
17 |
|
18 |
echo "<optgroup label='$srname'>\n"; |
19 |
foreach($sr["VDIs"] as $vdiuuid) { |
20 |
$vdi = $xenserver->VDI__get_record($vdiuuid); |
21 |
$uuid = $vdi["uuid"]; |
22 |
$iso = $vdi["name_label"]; |
23 |
echo "<option value='{$vdiuuid}'>$iso</option>\n"; |
24 |
} |
25 |
echo "</optgroup>\n"; |
26 |
} |