boot from volume - invalid flow in libvirt driver

Bug #1131913 reported by Boris Deschenes
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Nikola Đipanov

Bug Description

(Testing grizzly trunk from ubuntu)

I had different bugs when booting from volume:

libvirt could not pre-create chardev file
libvirt could not find disk.config (when using a config drive)
libvirt could not create the console.log file

(these cases result in complete failure to spawn the VM, libvirt aborts)

this is was in various scenarios (config drive, no config drive, etc..) but always when booting from volume (not providing any image), all three problems got solved when I decided to ALWAYS call self._create_image at the beginning of the spawn() function of the libvirt driver:

/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py:

    def spawn(self, context, instance, image_meta, injected_files,
              admin_password, network_info=None, block_device_info=None):

        # couple of lines removed...

        if image_meta:
            self._create_image(context, instance, xml,
                               disk_info['mapping'],
                               network_info=network_info,
                               block_device_info=block_device_info,
                               files=injected_files,
                               admin_pass=admin_password)

if remove the check for image_meta, _create_image will always be called, this seems to enable the boot from volume functionality since the /var/lib/nova/instances/instance-xxxxxxxx will be correctly populated enabling libvirt to spawn the instance.

I think since we're now able to boot from volume without specifying any kind of image, we cannot simply check for image_meta and decide wether or not to call create_image, we still need to create the instance directory and prepare files before calling libvirt to instanciate.

I can say that all my different BFV scenarios work when I call _create_image no matter what.

Could someone with a better understanding of the libvirt driver have a look and maybe rethink this check for image_meta?

thank you guys

Changed in nova:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Rafi Khardalian (rkhardalian)
Revision history for this message
Rafi Khardalian (rkhardalian) wrote :

Thanks for the detailed report. I'll take a deeper look at this, as it's likely there are other similar cases throughout the driver.

Changed in nova:
status: Triaged → New
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23818

Changed in nova:
assignee: Rafi Khardalian (rkhardalian) → Nikola Đipanov (ndipanov)
Changed in nova:
milestone: none → grizzly-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/23818
Committed: http://github.com/openstack/nova/commit/3133096f2bf2c8de04c70c3f3209d727a4c8cfb3
Submitter: Jenkins
Branch: master

commit 3133096f2bf2c8de04c70c3f3209d727a4c8cfb3
Author: Nikola Dipanov <email address hidden>
Date: Thu Mar 7 15:54:07 2013 +0100

    Libvirt driver create images even without meta

    This patch allows the libvirt driver to call _create_image and
    create instance directory and other needed images even when there is no
    image metadata specified.

    As an added bonus, this patch refactors the code of _create_image
    method a bit to make it more clear to the reader when some of the images
    will and will not be created, especially with regard to booting from
    volume.

    Fixes bug: 1124441
    Fixes bug: 1131913
    Fixes bug: 1123274

    blueprint: improve-boot-from-volume

    Change-Id: I5a028dc0585876d35be4fb86df3a423d89e054ee

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.