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

Papenbrock, Thorsten t.papenbrock at sap.com
Thu Mar 1 01:17:07 PST 2012


Hi Rodrique and mailing list,

Many thanks for your hint. The contextualisation is exactly what I was looking for!

My next question might not be appropriate for this mailing list, but does anyone know if there is a similar mechanism also available in Bonfire (http://doc.bonfire-project.eu/) ? I heard that some of you have some experiences with this project as well.

Best Regards,
Thorsten Papenbrock

From: rodrigue.chakode at gmail.com [mailto:rodrigue.chakode at gmail.com] On Behalf Of Rodrigue Chakode
Sent: 28 February 2012 11:38
To: Papenbrock, Thorsten
Cc: ecosystem at lists.opennebula.org
Subject: Re: [one-ecosystem] Read VM ID from inside a running VM

Hi
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.

This goal can be easily achieved through contextualisation data (http://opennebula.org/documentation:archives:rel2.2:cong), notably by using the variables $VMID

Regards,


--------------------- Original message was: ---------------------

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/20120301/ddf7d0db/attachment.htm>


More information about the Ecosystem mailing list