--- onemc/include/onemc_funcs.php 2010-02-25 02:33:04.000000000 +0100 +++ /var/www/html/onemc/include/onemc_funcs.php 2010-02-25 02:30:51.000000000 +0100 @@ -237,11 +237,12 @@ if (valid('nbridge')) { if ($comma) { $template .= ",\n"; }; $comma = TRUE; $template .= "BRIDGE = \"".$_GET['nbridge']."\" "; } if (valid('ntarget')) { if ($comma) { $template .= ",\n"; }; $comma = TRUE; $template .= "TARGET = \"".$_GET['ntarget']."\" "; } if (valid('nscript')) { if ($comma) { $template .= ",\n"; }; $comma = TRUE; $template .= "SCRIPT = \"".$_GET['nscript']."\" "; } - if (valid('nmodel')) { if ($comma) { $template .= ",\n"; }; $comma = TRUE; $template .= "MODEL = \"".$_GET['nmodel']."\" "; } + //if (valid('nmodel')) { if ($comma) { $template .= ",\n"; }; $comma = TRUE; $template .= "MODEL = \"".$_GET['nmodel']."\" "; } $template .= "]\n"; + $template .= "GRAPHICS = [ type = \"vnc\",listen = \"0.0.0.0\"] "; $status = rpc2_request("one.vm.allocate", array($_SESSION['auth'], $template)); if (isset($status['failed'])) { - print "Err: ".$status['failed']."\n"; + print "Err: ".$status['failed']." $template\n"; } } @@ -344,9 +345,10 @@ $vmpool_info = $vmpool_info['VM_POOL']; else $vmpool_info = array(); - - print "IdUserNameVM StateLCM StateCpuMemoryHostTime\n"; + print "IdUserNameVM StateLCM StateCpuMemoryHostTimeVNC port\n"; foreach ($vmpool_info as $vm) { + $vnccommand = "sudo /usr/bin/virsh -c remote:///".$vm['HISTORY']['HOSTNAME'] ." vncdisplay one-" . $vm['ID']; + $vncport = `$vnccommand`; $_vm_state = $vm_state[$vm['STATE']]; $_lcm_state = $lcm_state[$vm['LCM_STATE']]; $time = $vm['ETIME'] - $vm['STIME']; @@ -357,7 +359,7 @@ $time = (int)$days."d ".(int)$hours.":".(int)$minutes.":".$seconds; print "".$vm['ID']."".$vm['USERNAME']."".$vm['NAME']."".$_vm_state."" .$_lcm_state."".$vm['CPU']."".$vm['MEMORY']."".$vm['HISTORY']['HOSTNAME']."" - ."".$time."details " + ."".$time."$vncportdetails " ."log"; print "