Booting from volume fails when the device_name is not specified

Bug #1290302 reported by Xavier Queralt
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Nikola Đipanov

Bug Description

With current nova in master, when booting an instance using an existing volume without specifying the device_name fails with the following traceback in nova compute:

$ nova boot --boot-volume f1f2de9c-eedf-41cf-9089-a41ec0706b3e --flavor m1.custom --key-name default server --poll

2014-03-10 05:48:27.735 DEBUG oslo.messaging._drivers.amqp [-] UNIQUE_ID is 38af8a6ad88649449919434f9facd899. from (pid=21192) _add_unique_id /opt/stack/oslo.messaging/oslo/messaging/_drivers/amqp.py:338
2014-03-10 05:48:27.750 ERROR nova.compute.manager [req-f7b15296-7be8-4cc5-9e8c-1ea3658baa7e admin admin] [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] Error: '<class 'nova.objects.block_device.BlockDeviceMapping'>' object has no attribute 'mount_device'
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] Traceback (most recent call last):
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/compute/manager.py", line 1242, in _build_instance
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] bdms)
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/compute/manager.py", line 1573, in _default_block_device_names
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] root_bdm)
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/compute/manager.py", line 1530, in _default_root_device_name
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] root_bdm)
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 5084, in default_root_device_name
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] cdrom_bus)
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/virt/libvirt/blockinfo.py", line 422, in get_root_info
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] if not get_device_name(root_bdm) and root_device_name:
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/virt/libvirt/blockinfo.py", line 392, in get_device_name
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] return bdm.get('device_name') or bdm.get('mount_device')
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/objects/base.py", line 411, in get
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] self.__class__, key))
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] AttributeError: '<class 'nova.objects.block_device.BlockDeviceMapping'>' object has no attribute 'mount_device'
2014-03-10 05:48:27.750 TRACE nova.compute.manager [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660]
2014-03-10 05:48:27.753 DEBUG nova.compute.utils [req-f7b15296-7be8-4cc5-9e8c-1ea3658baa7e admin admin] [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] Build of instance 7ce5a209-49a3-417b-aa0d-0ccf066dc660 was re-scheduled: '<class 'nova.objects.block_device.BlockDeviceMapping'>' object has no attribute 'mount_device' from (pid=21192) notify_about_instance_usage /opt/stack/nova/nova/compute/utils.py:334
2014-03-10 05:48:27.753 TRACE nova.compute.utils [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] Traceback (most recent call last):
2014-03-10 05:48:27.753 TRACE nova.compute.utils [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/compute/manager.py", line 1134, in _run_instance
2014-03-10 05:48:27.753 TRACE nova.compute.utils [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] instance, image_meta, legacy_bdm_in_spec)
2014-03-10 05:48:27.753 TRACE nova.compute.utils [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] File "/opt/stack/nova/nova/compute/manager.py", line 1293, in _build_instance
2014-03-10 05:48:27.753 TRACE nova.compute.utils [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] reason=unicode(exc_info[1]))
2014-03-10 05:48:27.753 TRACE nova.compute.utils [instance: 7ce5a209-49a3-417b-aa0d-0ccf066dc660] RescheduledException: Build of instance 7ce5a209-49a3-417b-aa0d-0ccf066dc660 was re-scheduled: '<class 'nova.objects.block_device.BlockDeviceMapping'>' object has no attribute 'mount_device'
2014-03-10 05:48:27.753 TRACE nova.compute.

Tags: libvirt
Changed in nova:
importance: Undecided → High
milestone: none → icehouse-rc1
status: New → Confirmed
Changed in nova:
assignee: nobody → Leandro Ignacio Costantino (leandro-i-costantino)
Revision history for this message
Nikola Đipanov (ndipanov) wrote :

Posted a fix here - https://review.openstack.org/#/c/79319/1

Not sure why LP didn't pick it up.

Matt Riedemann (mriedem)
Changed in nova:
status: Confirmed → In Progress
assignee: Leandro Ignacio Costantino (leandro-i-costantino) → Nikola Đipanov (ndipanov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/79319
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=181bcf77c429ecdde1f28b1884f0aa9144eb0851
Submitter: Jenkins
Branch: master

commit 181bcf77c429ecdde1f28b1884f0aa9144eb0851
Author: Nikola Dipanov <email address hidden>
Date: Mon Mar 10 13:56:54 2014 +0100

    libvirt: fix blockinfo get_device_name helper

    Currently all the methods in libvirt's blockinfo module will either
    be called with block device objects (when attempting to default device
    names) or with a DriverBlockDevice subclass (all other operations in
    the virt driver that expect such format to be passed).

    This patch updates the get_device_name method to honor the above
    situation introduced by I055651b5fd415092787d9487a69467a9bbcf073e.

    Closes-bug: #1290302
    Change-Id: I7099ea4502da2108c4bcba530a8ace173d2dafc9

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: icehouse-rc1 → 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.