Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1044562

Summary: booting an instance with swap or ephemeral secondary disks doesn't work
Product: Red Hat OpenStack Reporter: Xavier Queralt <xqueralt>
Component: openstack-novaAssignee: Vladan Popovic <vpopovic>
Status: CLOSED ERRATA QA Contact: Gabriel Szasz <gszasz>
Severity: high Docs Contact:
Priority: high    
Version: 3.0CC: dallan, jagee, mlopes, ndipanov, pbrady, sclewis, sgordon, ukalifon, xqueralt, yeylon
Target Milestone: z4Keywords: Triaged, ZStream
Target Release: 3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-2013.1.4-3.el6ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1043664 Environment:
Last Closed: 2014-01-30 20:00:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1043664    
Bug Blocks:    

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