Bug 1044562 - 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: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 3.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z4
: 3.0
Assignee: Vladan Popovic
QA Contact: Gabriel Szasz
URL:
Whiteboard:
Depends On: 1043664
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-18 14:56 UTC by Xavier Queralt
Modified: 2019-09-09 16:53 UTC (History)
10 users (show)

Fixed In Version: openstack-nova-2013.1.4-3.el6ost
Doc Type: Bug Fix
Doc Text:
Clone Of: 1043664
Environment:
Last Closed: 2014-01-30 20:00:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0112 0 normal SHIPPED_LIVE Moderate: openstack-nova security and bug fix update 2014-01-31 00:58:47 UTC

Description Xavier Queralt 2013-12-18 14:56:17 UTC
+++ This bug was initially created as a clone of Bug #1043664 +++

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 5 errata-xmlrpc 2014-01-30 20:00:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-0112.html


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