[one-users] Find the Host of a given VM via RPC Interface

Manuel Peuster manuel at peuster.de
Mon Feb 20 03:38:18 PST 2012



On Monday, 20. February 2012 at 12:15, Daniel Molina wrote:

> Hi Manuel,
> 
> On 20 February 2012 10:36, Manuel Peuster <manuel at peuster.de (mailto:manuel at peuster.de)> wrote:
> > Hello,
> > 
> > I am trying to get the host on which a given VM is running at this moment,
> > this should be used for status output purpose in my cloud controlling tool.
> > 
> > I am using the ONE XML-RPC interface.
> > 
> > Am I right , that the only place where this information is given is returned
> > in the <HISTORY_RECORDS> part of the vm.info (http://vm.info) action? There is an entry
> > called <HID> with the host id?
> > 
> 
> 
> You are right, that is the best way to retrieve such kind of info. If
> you retrieve the whole pool (vmpool.info (http://vmpool.info)) the last HISTORY will be
> included in the HISTORY_RECORDS section and you can get the HID and
> HOSTNAME of the current HOST in which the VM is running. You have to
> take into account that if the VM state is STOPPED the HISTORY will
> show the HOST information of the VM when it was running.
> 

Ah ok, perfect.
  
> 
> If you want to get a full HISTORY of the VM you can retrieve it using
> the vm.info (http://vm.info) request. All the HISTORY records will be included in the
> XML. A new HISTORY is generated with a new SEQ number each time a VM
> moves to another HOST, .
> 
> You can see an example of this in the onevm_helper.rb file. The d
> variable is a Hash built from the VM section fo the VM_POOL xml
> https://github.com/OpenNebula/one/blob/master/src/cli/one_helper/onevm_helper.rb#L85
> 
> Hope this helps.
> 

Yes, thank you!
 
> 
> > Are there better ways to get this information?
> > 
> > Thank you.
> > 
> > Regards,
> > 
> > Manuel
> > 
> > _______________________________________________
> > Users mailing list
> > Users at lists.opennebula.org (mailto:Users at lists.opennebula.org)
> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
> > 
> 
> 
> -- 
> Daniel Molina
> Project Engineer
> OpenNebula - The Open Source Solution for Data Center Virtualization
> www.OpenNebula.org (http://www.OpenNebula.org) | dmolina at opennebula.org (mailto:dmolina at opennebula.org) | @OpenNebula
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120220/1369eb66/attachment-0003.htm>


More information about the Users mailing list