[openstack-dev] [Nova] Is there a way for the VM to identify that it is getting booted in OpenStack

Daniel P. Berrange berrange at redhat.com
Wed Nov 27 17:53:00 UTC 2013


On Wed, Nov 27, 2013 at 01:48:29AM +0000, Vijay Venkatachalam wrote:
> Hi,
>                 Is there a way for the VM to identify that it is getting booted in OpenStack?

The mails you've forwarded below pretty much answer this
question already.

>                 As said in the below mail, once the VM knows it is booting in OpenStack it will alter the boot sequence.

>                 AWS provides signatures in the BIOS strings.

As below, so does the KVM/QEMU driver in Nova. The XenAPI driver was planing
to follow this for HVM guests at least, though it doesn't help paravirt Xen
guests which lack BIOS.

> From: Vijay Venkatachalam [mailto:Vijay.Venkatachalam at citrix.com]
> Sent: Tuesday, November 26, 2013 8:58 PM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [Nova] Are BIOS strings configured in Hyper-V & ESX similar to KVM instantiated VMs?
> 
> It is basically used to tailor the boot sequence if the VM gets booted in OpenStack. For ex. it could do the following
> 
> 
> 1.       Get IP through DHCP if booted in OpenStack
> 
> 2.       Read config drive or contact metadata service and init the system if booted in OpenStack

Instead of trying to figure out if booted under OpenStack, just look
for a config driver, or try to contact the metadata service directly
and handle the failure when they're not there. You need to have this
kind of failure handling anyway for reliability

Likewise if your guest should just try todo DHCP regardless if it
does not have any other way to configure its IP addr statically.

> From: Bob Ball [mailto:bob.ball at citrix.com]
> Sent: Tuesday, November 26, 2013 7:25 PM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [Nova] Are BIOS strings configured in Hyper-V & ESX similar to KVM instantiated VMs?
> 
> It's not certain that this will be implemented for the XenAPI driver.
> 
> Our view is that the BIOS strings shouldn't be relied upon - the hypervisor can clearly set them to anything so it's not really a reliable way to configure the application.  Also note that in some scenarios, such as PV guests in Xen clouds, you will not have any BIOS to query.  Finally we're not clear on the use case here - What's the use case for needing to know whether you VM is running under OpenStack or not?
> 
> Bob
> 
> From: Vijay Venkatachalam [mailto:Vijay.Venkatachalam at citrix.com]
> Sent: 26 November 2013 01:44
> To: OpenStack Development Mailing List (openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>)
> Subject: [openstack-dev] [Nova] Are BIOS strings configured in Hyper-V & ESX similar to KVM instantiated VMs?
> 
> Hi,
> 
> In a KVM instantiated VM the following signature is present in the BIOS of the VM
> The 'Manufacturer ' field in 'System Information' group is set to "OpenStack Foundation"
> 
> 
> 
> This helps the VM to identify that it is getting used in an OpenStack environment.
> 
> 
> 
> As far as I know XenServer is planning to set the BIOS Strings in IceHouse release.
> 
> 
> 
> Is this functionality available in other Hypervisors, especially Hyper-V & ESX?
> 


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



More information about the OpenStack-dev mailing list