if volume size is None for image bdms nova compute throws an exception

Bug #1224469 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

When attempting to boot an instance with a block device with source=image,dest=volume and there is no volume size specified - nova compute will error out:

[ndipanov@localhost devstack]$ nova boot --flavor 1 --block-device bootindex=0,source=image,dest=volume,id=42ccba7f-914b-4e3d-8387-b7b30d96a7a5,type=cdrom,bus=ide testimgvol

in nova compute logs:

ERROR nova.compute.manager [req-a7200578-8bf4-4791-a5bf-449c473d41b6 demo demo] [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] Error: Invalid input received: Invalid input received: Volume size None must be an integer and greater than 0
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] Traceback (most recent call last):
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] File "/opt/stack/nova/nova/compute/manager.py", line 1038, in _build_instance
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] context, instance, bdms)
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] File "/opt/stack/nova/nova/compute/manager.py", line 1403, in _prep_block_device
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] instance=instance)
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] File "/opt/stack/nova/nova/compute/manager.py", line 1386, in _prep_block_device
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] self._await_block_device_map_created))
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] File "/opt/stack/nova/nova/virt/block_device.py", line 283, in attach_block_devices
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] block_device_mapping)
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] File "/opt/stack/nova/nova/virt/block_device.py", line 236, in attach
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] '', '', image_id=self.image_id)
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] File "/opt/stack/nova/nova/volume/cinder.py", line 309, in create
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] raise exception.InvalidInput(reason=e.message)
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d] InvalidInput: Invalid input received: Invalid input received: Volume size None must be an integer and greater than 0
2013-09-12 09:20:15.362 TRACE nova.compute.manager [instance: 8edd2e9e-4b4d-44ac-92f1-bea38cd5320d]

We should disallow empty or default the volume size if not specified.

Tags: volumes
Changed in nova:
importance: Undecided → Medium
Changed in nova:
status: New → Confirmed
Changed in nova:
milestone: none → icehouse-rc1
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/81862

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/81862
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=bf1149d8bdf98219d5b95e762e8ec9e59bbaf487
Submitter: Jenkins
Branch: master

commit bf1149d8bdf98219d5b95e762e8ec9e59bbaf487
Author: Nikola Dipanov <email address hidden>
Date: Thu Mar 20 18:43:02 2014 +0100

    Don't allow empty or 0 volume size for images

    When specifying the block device that has source_type 'image' and
    destination_type 'volume', we should confirm that the volume size is
    specified, as Cinder won't be able to guess it, and will reject the
    request, thus erroring out the instance.

    Closes-bug:#1224469
    Change-Id: I87ece3be1a5e9d6b229717f8025ce542707007c4

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: icehouse-rc1 → 2014.1
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.