Unable to boot an libvirt instance using a flavour with swap enabled

Bug #1131306 reported by Daniel Berrange
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Daniel Berrange

Bug Description

# nova flavor-create --swap 2 --ephemeral 3 demo1 6 500 10 3
# nova boot --flavor demo1 --image f16-x86_64-openstack-sda --key_name mykey demo11
# nova list
+--------------------------------------+--------+--------+----------+
| ID | Name | Status | Networks |
+--------------------------------------+--------+--------+----------+
| c2635620-73b5-48f9-9882-d7be214b10ea | demo11 | ERROR | |
+--------------------------------------+--------+--------+----------+

2013-02-21 17:22:30.021 ERROR nova.compute.manager [req-05e42a31-fe2e-4d0d-9853-90b4f9ea93de admin demo] [instance: c2635620-73b5-48f9-9882-d7be214b10ea] Instance failed to spawn
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] Traceback (most recent call last):
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] File "/home/berrange/src/cloud/nova/nova/compute/manager.py", line 1040, in _spawn
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] block_device_info)
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] File "/home/berrange/src/cloud/nova/nova/virt/libvirt/driver.py", line 1480, in spawn
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] admin_pass=admin_password)
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] File "/home/berrange/src/cloud/nova/nova/virt/libvirt/driver.py", line 1790, in _create_image
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] swap['dev'], block_device_info)):
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea] KeyError: 'dev'
2013-02-21 17:22:30.021 TRACE nova.compute.manager [instance: c2635620-73b5-48f9-9882-d7be214b10ea]

Revision history for this message
Daniel Berrange (berrange) wrote :

This is a regression caused by the following

commit 7be531fe9462f2b07d4a1abf6687f649d1dfbb89
Author: Daniel P. Berrange <email address hidden>
Date: Tue Jan 15 20:43:48 2013 +0000

    Refactor code for setting up libvirt disk mappings

Changed in nova:
assignee: nobody → Daniel Berrange (berrange)
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/22586

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

Reviewed: https://review.openstack.org/22586
Committed: http://github.com/openstack/nova/commit/78126baa70f9f05ae9fd9f7423da4ea0ba45c49c
Submitter: Jenkins
Branch: master

commit 78126baa70f9f05ae9fd9f7423da4ea0ba45c49c
Author: Daniel P. Berrange <email address hidden>
Date: Thu Feb 21 19:33:23 2013 +0000

    Fix launching libvirt instances with swap

    The code in

      commit 7be531fe9462f2b07d4a1abf6687f649d1dfbb89
      Author: Daniel P. Berrange <email address hidden>
      Date: Tue Jan 15 20:43:48 2013 +0000

        Refactor code for setting up libvirt disk mappings

    accidentally broken launching of instances where
    the flavor had non-zero swap specified. This was
    not caught due to complete lack of test coverage
    for the '_create_image' method. This adds two
    test cases for that method, exercising this bug.
    It also fixes a bug in netutils which was not
    handling a NULL network mapping, which is a valid
    scenario for several callers.

    Fixes bug #1131306
    Change-Id: I214561ba3ec6440d11a5afb0665e6b6f990bd148
    Signed-off-by: Daniel P. Berrange <email address hidden>

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-rc1
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.