[one-ecosystem] Read VM ID from inside a running VM

Papenbrock, Thorsten t.papenbrock at sap.com
Tue Feb 28 03:27:53 PST 2012


Hello mailing list,

I built a small application that uses the OCCI and EC2 interface to automatically start and delete Virtual Machines in my private OpenNebula cloud. Each VM runs a service that reports how busy a certain VM actually is. Using this service, my application creates and deletes VMs depending on the overall load of the cluster.

Now, my problem is that I always want to delete the VM with the lowest load, but the application does not know the VM to which a particular service belongs. Therefore, I need to know the VM ID, which has been assigned automatically by OpenNebula, from inside a running VM. Then, each service could also report the VM ID to my application so that it can delete the right VM.

Is there a way to query this VM ID from inside the VM? Or can I configure OpenNebula to automatically store the VM ID in, for example, a text file inside a VM when it creates the VM? It would also help if the application could query an IP-to-VM ID mapping from OpenNebula, if such a mapping exists for VMs that are created with bridged DHCP network access.

Many thanks for your help in advance,
Thorsten Papenbrock
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/ecosystem-opennebula.org/attachments/20120228/d467f7bd/attachment.htm>


More information about the Ecosystem mailing list