[one-users] Java OCA - Get host for VM
Carlos Martín Sánchez
cmartin at opennebula.org
Wed Oct 31 07:35:58 PDT 2012
Hi,
The info() method gets the complete VM information for the VM, not just the
Template.
To get the last hostname, use the following xpath expression:
String hostname = vm.xpath("HISTORY_RECORDS/HISTORY[last()]/HOSTNAME");
Regards
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open-source Solution for Data Center Virtualization
www.OpenNebula.org | cmartin at opennebula.org |
@OpenNebula<http://twitter.com/opennebula><cmartin at opennebula.org>
On Wed, Oct 31, 2012 at 1:41 PM, Marcin Jarzab <mj at agh.edu.pl> wrote:
> Hello,
>
> What is the Java OCA API to get the host on which VM is running?
> In the Vm.info() method there are only data about VM template.
>
>
> mj at agh.edu.pl
> http://www.ics.agh.edu.pl/**people/mj<http://www.ics.agh.edu.pl/people/mj>
>
> Department of Computer Science
> AGH University of Science and Technology
> Kawiory 21, Building D17, 30-055 Krakow, POLAND
> phone: +48 (12) 328 33 72
> ==============================**==============================**
> ==============
>
> ______________________________**_________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/**listinfo.cgi/users-opennebula.**org<http://lists.opennebula.org/listinfo.cgi/users-opennebula.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121031/c771ff9a/attachment-0002.htm>
More information about the Users
mailing list