Nova compute throws an exception if ephemeral is passed wiithout size.

Bug #1218861 reported by Nikola Đipanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Nikola Đipanov

Bug Description

Alex Xu reports on a related code review https://review.openstack.org/#/c/41647/

"""
Xavier, When create vm as below, i got some error from nova-compute side:

'{"server": {"name": "vm3", "image_ref": "b8cd5faa-a65f-4e47-bfc8-68061574b428", "flavor_ref": "1", "max_count": 1, "min_count": 1, "os-block-device-mapping:block_device_mapping": [{"device_name": "/dev/vdc", "source_type": "blank", "destination_type": "local", "boot_index": 0}], "networks": [{"uuid": "b6ba34f1-5504-4aca-825b-04511c104802"}]}}'

2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] Traceback (most recent call last): 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] File "/opt/stack/nova/nova/compute/manager.py", line 1018, in _build_instance 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] set_access_ip=set_access_ip) 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] File "/opt/stack/nova/nova/compute/manager.py", line 1392, in _spawn 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] LOG.exception(_('Instance failed to spawn'), instance=instance) 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] File "/opt/stack/nova/nova/compute/manager.py", line 1388, in _spawn 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] block_device_info) 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 1689, in spawn 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] admin_pass=admin_password) 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2002, in _create_image 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] size = eph['size'] * 1024 * 1024 * 1024 2013-08-30 11:01:32.500 TRACE nova.compute.manager [instance: bc919048-049b-445a-a676-e037d7b1fe31] TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

That because I miss 'volume_size' in the request.
"""

I was also able to reproduce on devstack with latest master.

Tags: compute
Changed in nova:
milestone: none → havana-3
assignee: nobody → Nikola Đipanov (ndipanov)
importance: Undecided → Medium
melanie witt (melwitt)
tags: added: compute
Changed in nova:
status: New → Confirmed
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/44669

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/44669
Committed: http://github.com/openstack/nova/commit/a957beb94720ca3f171149155f9dcabd20e6141b
Submitter: Jenkins
Branch: master

commit a957beb94720ca3f171149155f9dcabd20e6141b
Author: Nikola Dipanov <email address hidden>
Date: Mon Sep 2 11:49:08 2013 +0200

    Interpret BDM None size field as 0 on compute side

    This patch makes sure that even if we receive an ephemeral or swap BDM
    without size information - it is defaulted to 0 by the compute service
    prior to booting the VM, as the size is expected to be present and an
    integer number by the driver code that uses it.

    Closes-bug: #1218861

    Change-Id: Ic6fc15d1cf876aa4fd99e17c582c1ab55e3a18c1

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: havana-3 → 2013.2
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.