Bug 1044016 - booting an instance with swap or ephemeral secondary disks doesn't work
Summary: booting an instance with swap or ephemeral secondary disks doesn't work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openstack-nova
Version: 19
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Xavier Queralt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-17 15:44 UTC by Xavier Queralt
Modified: 2014-01-07 09:36 UTC (History)
25 users (show)

Fixed In Version: openstack-nova-2013.1.4-4.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of: 1043664
Environment:
Last Closed: 2014-01-07 09:36:55 UTC
Type: Bug


Attachments (Terms of Use)

Description Xavier Queralt 2013-12-17 15:44:32 UTC
Description of problem:
While verifying bug 893374 I've noticed that none of the ephemeral and swap disks work any more.
 
Booting an instance with an swap and/or ephemeral disk(s) will fail moving the instance to ERROR. This is the default if the flavor specifies an swap or ephemeral disk.

This bug was introduced in https://review.openstack.org/54767 which introduces a new argument in the fetch_image/fetch_to_raw methods to enforce the maximum size an image can have. Erroneously, this argument is also passed to the _create_ephemeral and _create_swap methods which don't recognize it and crash dramatically while trying to create the images.

Version-Release number of selected component (if applicable):
openstack-nova-2013.2-9.el6ost.noarch

How reproducible:
Always.

Steps to Reproduce:
1. nova flavor-create m1.custom auto 64 0 1 --ephemeral 1 --swap 1024
2. nova boot --image cirros --flavor m1.custom nuvol
3. instance goes to ERROR state when spawning
4. In compute.log we can encounter the tracebacks specified below. 

Actual results:
Instances don't boot and are moved to the ERROR state.

Expected results:
Instance boots with the swap and/or ephemeral disks.

Additional info:

 Traceback (most recent call last):
   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1037, in _build_instance
     set_access_ip=set_access_ip)
   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1420, in _spawn
     LOG.exception(_('Instance failed to spawn'), instance=instance)
   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1417, in _spawn
     block_device_info)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2063, in spawn
     admin_pass=admin_password)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2370, in _create_image
     ephemeral_size=ephemeral_gb)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/imagebackend.py", line 174, in cache
     *args, **kwargs)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/imagebackend.py", line 307, in
     prepare_template(target=base, max_size=size, *args, **kwargs)
   File "/usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py", line 246, in inner
     return f(*args, **kwargs)
   File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__                                                                                                                                
     self.gen.throw(type, value, traceback)
   File "/usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py", line 205, in lock
     yield lock
   File "/usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py", line 246, 
     return f(*args, **kwargs)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/imagebackend.py", line 162, in call_if_not_exists
     fetch_func(target=target, *args, **kwargs)
 TypeError: _create_ephemeral() got an unexpected keyword argument 'max_size'

 Traceback (most recent call last):                                                                                                                                                               
   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1417, in _spawn
     block_device_info)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2063, in spawn
     admin_pass=admin_password)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2402, in _create_image
     swap_mb=swap_mb)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/imagebackend.py", line 174, in cache
     *args, **kwargs)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/imagebackend.py", line 307, in create_image
     prepare_template(target=base, max_size=size, *args, **kwargs)
   File "/usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py", line 246, in inner
     return f(*args, **kwargs)
   File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
     self.gen.throw(type, value, traceback)
   File "/usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py", line 205, in lock 
     yield lock
   File "/usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py", line 246, in inner
     return f(*args, **kwargs)
   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/imagebackend.py", line 162, in call_if_not_exists
     fetch_func(target=target, *args, **kwargs)
 TypeError: _create_swap() got an unexpected keyword argument 'max_size'

Comment 1 Fedora Update System 2013-12-17 15:45:32 UTC
openstack-nova-2013.1.4-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/openstack-nova-2013.1.4-4.fc19

Comment 2 Joseph W. Breu 2013-12-17 16:00:14 UTC
This issue also affects the EPEL-havana repository for EL6

Comment 3 Fedora Update System 2013-12-19 07:15:20 UTC
Package openstack-nova-2013.1.4-4.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openstack-nova-2013.1.4-4.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-23555/openstack-nova-2013.1.4-4.fc19
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2014-01-07 09:36:55 UTC
openstack-nova-2013.1.4-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.