[one-ecosystem] [one-users] vnc port in onemc

Rogier Mars rogier at fortytwo.nl
Thu Feb 25 15:53:17 PST 2010


On Feb 26, 2010, at 12:45 AM, Rogier Mars wrote:

> Hi Sergio,
>
> When you run the onemc and the nodes on different servers libvirt  
> has to be setup with certifcates. I've configured this and will try  
> to write up a show howto.
> The change I made works with both the onemc and node on the same  
> physical host. I know this is not a production scenario, but it was  
> a quick test to see if it worked. I've now got it working on remote  
> hosts to.
>
> When the how to is finished I will post to the ecosystem list.
>
> Cheers,
>
> Rogier
>
> On Feb 25, 2010, at 3:25 PM, sergio garcia escriche wrote:
>
>> Hi Rogier ,
>>
>> I try to put your patch in onemc_funcs.php, but when i start the vm  
>> not show the vncport.
>> I put in /etc/sudoers permission to www-data(apache user) to acces  
>> tor virsh.
>>
>> Thank you very much
>>
>> Sergio
>>
>> 2010/2/25 Ignacio Martin Llorente <llorente at dacya.ucm.es>
>> Dear friends,
>>
>> Please move this discussion to the ecosystem mailing list, so we  
>> could keep this list for opennebula core discussions. We have  
>> created the ecosystem mailing list to discuss integration issues of  
>> ONE with other components in the ecosystem catalog (	).
>>
>> Thanks!
>>
>> Ignacio
>>
>> --
>> Ignacio M. Llorente, Full Professor (Catedratico): http://dsa-research.org/llorente
>> DSA Research Group:  web http://dsa-research.org and blog http://blog.dsa-research.org
>> OpenNebula Open Source Toolkit for Cloud Computing: http://www.OpenNebula.org
>> RESERVOIR European Project in Cloud Computing: http://www.reservoir-fp7.eu
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On 25/02/2010, at 11:55, Jeroen Nijhof wrote:
>>
>> >
>> > Hi Rogier,
>> >
>> > It was one of my things I had to do.
>> > I've to look into it, because onemc is now using the XMLRPC2 api  
>> to get
>> > all the information from ONE.
>> > Maybe I can get the current VNC port information from XMLRPC2 or  
>> I can
>> > ask or make a patch myself in a way XMLRPC2 does.
>> >
>> > Any ideas Ruben?
>> >
>> > Thanks for your work so far..
>> >
>> > Regards,
>> > Jeroen Nijhof
>> >
>> >
>> > Op 25/2/2010 schreef "Rogier Mars" <rogier at fortytwo.nl>:
>> >
>> >> Hi,
>> >>
>> >> I've made some quick changes to ONEMC to show the VNC port in the
>> >> interface. I've updated the template that onemc creates with a
>> >> GRAPHICS section, enabling vnc on the quest.
>> >>
>> >> As a workaround until ONE can use the VMID in the graphics  
>> section, I
>> >> use a virsh command to get the vncport. To get this working the
>> >> webserver user should be allowed to execute the virsh command via
>> >> sudo. Add the following to sudoers:
>> >> apache     ALL=(ALL)       NOPASSWD: /usr/bin/virsh *
>> >>
>> >> Also I encountered some problems with the model section in the KVM
>> >> template so I commented that out as well.
>> >>
>> >> Cheers,
>> >>
>> >> rogier
>> >>
>> >> ONE Management Console show VNC display
>> >>
>> >> --- 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 "<tr><td>Err: ".$status['failed']."</td><td></ 
>> td></
>> >> tr>\n";
>> >> +            print "<tr><td>Err: ".$status['failed']." $template</
>> >> td><td></td></tr>\n";
>> >>         }
>> >>     }
>> >>
>> >> @@ -344,9 +345,10 @@
>> >>             $vmpool_info = $vmpool_info['VM_POOL'];
>> >>         else
>> >>             $vmpool_info = array();
>> >> -
>> >> -        print "<tr><td>Id</td><td>User</td><td>Name</td><td>VM  
>> State</
>> >> td><td>LCM State</td><td>Cpu</td><td>Memory</td><td>Host</ 
>> td><td>Time</
>> >> td><td></td><td></td></tr>\n";
>> >> +        print "<tr><td>Id</td><td>User</td><td>Name</td><td>VM  
>> State</
>> >> td><td>LCM State</td><td>Cpu</td><td>Memory</td><td>Host</ 
>> td><td>Time</
>> >> td><td>VNC port</td><td></td><td></td></tr>\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 "<tr><td>".$vm['ID']."</td><td>".
>> >> $vm['USERNAME']."</td><td>".$vm['NAME']."</td><td>".$_vm_state."</
>> >> td><td>"
>> >>                 .$_lcm_state."</td><td>".$vm['CPU']."</td><td>".
>> >> $vm['MEMORY']."</td><td>".$vm['HISTORY']['HOSTNAME']."</td>"
>> >> -                ."<td>".$time."</td><td><a href=\"?details=".
>> >> $vm['ID']."\">details</a> "
>> >> +                ."<td>".$time."</td><td>$vncport</td><td><a  
>> href=\"?
>> >> details=".$vm['ID']."\">details</a> "
>> >>                 ."<a href=\"?log=".$vm['ID']."\">log</a></td>";
>> >>             print "<td><form method=\"GET\"><select name=\"action 
>> \">";
>> >>             if ($_vm_state == "pending") {
>> >>
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opennebula.org
>> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opennebula.org
>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/ecosystem-opennebula.org/attachments/20100226/19d9c7a1/attachment-0001.html>


More information about the Ecosystem mailing list