block_device mapping identifies ephemeral disks incorrectly

Bug #1347028 reported by Vish Ishaya
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Thang Pham

Bug Description

Ephemeral drives are destinaton == local, but the new bdm code bases it on source instead. This leads to improper errors:

$ nova boot --flavor m1.tiny --block-device source=blank,dest=volume,bus=virtio,size=1,bootindex=0 test
ERROR (BadRequest): Ephemeral disks requested are larger than the instance type allows. (HTTP 400) (Request-ID: req-53247c8e-d14e-43e2-b01e-85b49f520e61)

The code is here:

https://github.com/openstack/nova/blob/106fb458c7ac3cc17bb42d1b83ec3f4fa8284e71/nova/block_device.py#L411

This should be checking destination_type == 'local' instead of source type.

tags: added: icehouse-backport-potential low-hanging-fruit
Revision history for this message
Vish Ishaya (vishvananda) wrote :

Assigned to nikolain case there is some reason that it has been coded this way.

Changed in nova:
assignee: nobody → Nikola Đipanov (ndipanov)
Revision history for this message
Nikola Đipanov (ndipanov) wrote :

yeah, this is a bug. The only reason the code is written in that way is because the author was trying to be clever :).

Also (based on your example), currently source=blank, destination=volume will not work. We should either make it create an empty volume and attach it, or disallow it in the API.

I'm going to report a different bug for this so we can track it as well.

Changed in nova:
assignee: Nikola Đipanov (ndipanov) → Thang Pham (thang-pham)
status: New → In Progress
Jay Pipes (jaypipes)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
Thang Pham (thang-pham) wrote :

Not sure why the patch is not showing up here, but this patch should fix it: https://review.openstack.org/#/c/109834/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/109834
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9d64a827b9c2c5f332b3e57f6cb818d3f4735d23
Submitter: Jenkins
Branch: master

commit 9d64a827b9c2c5f332b3e57f6cb818d3f4735d23
Author: Thang Pham <email address hidden>
Date: Wed Jul 23 17:15:52 2014 -0400

    Allow empty volumes to be created

    The following patch allows an empty volume to be created and
    attached to an instance at boot time. Today, you can define a
    bootable volume that is sourced from an image, volume, or
    snapshot. However, you cannot define a volume that is sourced
    from 'blank', even though it is one of the source options
    available. For example, the following command will not work:
    nova boot --flavor m1.tiny
    --block-device source=blank,dest=volume,size=1,bootindex=0 test.
    This is because the method used to identify ephemeral volumes
    (new_format_is_ephemeral) believes any block device with
    source_type=blank is an ephemeral, and there is no logic to
    handle volumes where source_type=blank. The following patch
    fixes these bugs by properly identifying ephemeral block
    devices and creating blank/empty volumes when source_type=blank
    and destination_type=volume.

    Change-Id: I5aa9684bfad1749fadff3018b13a225ed8f16fe8
    Closes-Bug: #1347028
    Closes-Bug: #1347499

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.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.