block_device_mapping_v2 boot_index not respected by libvirt driver

Bug #1229327 reported by Dennis Kliban
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Nikola Đipanov

Bug Description

block_device_mapping_v2 https://dpaste.de/OzmMV/

The expected boot order in the above snippet is hd (glance image), cdrom, floppy. However, when the instance starts it attempts to boot from hd and then floppy. The problem lies here: https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2882

The boot device is always set to 'hd'. The driver should support a list of boot devices based on the boot_index supplied in block_device_mapping_v2

Tags: libvirt
Changed in nova:
assignee: nobody → Nikola Đipanov (ndipanov)
Revision history for this message
Nikola Đipanov (ndipanov) wrote :

pasting the block_device_mapping_v2 here so it doesn't get lost:

    block_device_mapping_v2 = [
    {"source_type": "volume",
    "destination_type": "volume",
    "uuid": "04e0887c-e4e1-4156-95ca-bf0aa80c47b6",
    "boot_index": "1",
    "device_type": "cdrom",
    "volume_size": "3",
    "disk_bus": "ide",
    },
    {"source_type": "volume",
    "destination_type": "volume",
    "uuid": "be2b7c60-4f80-4471-a77d-23ad75127138",
    "boot_index": "2",
    "device_type": "floppy",
    "volume_size": "1",
    "device_name": "/dev/fd0",
    },
    ]

Matt Riedemann (mriedem)
tags: added: libvirt
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/49366

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/49367

Changed in nova:
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/49368

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/49557

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/49558

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/49366
Committed: http://github.com/openstack/nova/commit/c9d05471b84c528c99504e67847e7068c5330353
Submitter: Jenkins
Branch: master

commit c9d05471b84c528c99504e67847e7068c5330353
Author: Nikola Dipanov <email address hidden>
Date: Wed Oct 2 11:41:57 2013 +0200

    Libvirt: add boot_index to block device info dicts

    Block devices have a boot_index parameter, which is used to determine the
    boot device.

    This patch makes it part of the device_info internal libvirt driver
    structure so that we can make use of it to do fine grained boot ordering
    in subsequent patches.

    Related-bug: 1229327

    Change-Id: I23f2f7637a6ed023785a0ffde050fbd43402c655

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/49557
Committed: http://github.com/openstack/nova/commit/c677aed647eea78fe5e1605c5b21ecd39ec1dd6b
Submitter: Jenkins
Branch: master

commit c677aed647eea78fe5e1605c5b21ecd39ec1dd6b
Author: Nikola Dipanov <email address hidden>
Date: Thu Oct 3 11:35:36 2013 +0200

    Libvirt: make boot dev a list in GuestConfig

    In order to make boot order more flexible based on the block device
    mapping passed, we need to customize the domain xml presented to
    libvirt, by specifying more than one boot element. For more info see
    http://libvirt.org/formatdomain.html#elementsOSBIOS. Currently the boot
    element is hard coded to "hd" by the libvirt driver.

    This patch makes it possible to specify more than one boot element that
    will give us more flexibility.

    Related-bug: 1229327
    Change-Id: I38abe9edaa8f93469d58ad81a466f68c2c0d24d6

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/49558
Committed: http://github.com/openstack/nova/commit/0ea89080abf17110033953ce272f30f278d0fefc
Submitter: Jenkins
Branch: master

commit 0ea89080abf17110033953ce272f30f278d0fefc
Author: Nikola Dipanov <email address hidden>
Date: Thu Oct 3 16:41:55 2013 +0200

    Libvirt: allow more than one boot device

    This patch makes use of the boot_index information of block devices to
    allow libvirt to boot from devices other than disks, and have more than
    one boot device.

    It does so by calculating the boot devices based on block devices type
    and boot index, and then assigning the correct list to the GuestConfig's
    os_boot_dev (that was made into a list in
    I38abe9edaa8f93469d58ad81a466f68c2c0d24d6).

    Closes-bug: 1229327
    Change-Id: Ic33894cb818ee7c44579e6d00f273b40f669aa9b

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

Other bug subscribers

Remote bug watches

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