HTTP 200 returned instead of HTTP 404 on passing invalid volume ID to boot server

Bug #1061576 reported by Rohit Karajgi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Unassigned

Bug Description

Pass an invalid volume ID to nova boot from bootable volume API.

$ nova boot --flavor 1 --image a2bfa0c3-fb77-4da3-9a45-c0ed0debb1d5 --block_device_mapping vda=fbd8ae99-2aaf-4c88-83bb-9341d4f2gc5s:volume:1 boot_from_vol
+-------------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | H4EiQhswhe8v |
| config_drive | |
| created | 2012-10-04T12:20:58Z |
| flavor | m1.tiny |
| hostId | |
| id | 1ed3e2b8-0591-4c20-af54-073a4e086f2b |
| image | cirros-0.3.0-x86_64-uec |
| key_name | None |
| metadata | {} |
| name | boot_from_vol |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| tenant_id | b1519b1ea6b8439fb7d88b1ec79ceec2 |
| updated | 2012-10-04T12:20:59Z |
| user_id | bd1b5e2ca71f4ae2b2be7c0950629792 |
+-------------------------------------+--------------------------------------+

The instance goes into ERROR state after some time.
$ nova list
+--------------------------------------+---------------+--------+----------+
| ID | Name | Status | Networks |
+--------------------------------------+---------------+--------+----------+
| 1ed3e2b8-0591-4c20-af54-073a4e086f2b | boot_from_vol | ERROR | |
+--------------------------------------+---------------+--------+----------+

Tags: ntt
Revision history for this message
Dan Prince (dan-prince) wrote :

In order to throw a 404 we'd need to update the Nova API code to check for the existence of a supplied volume. This would potentially make the API slower and require either a DB or Cinder check which is probably something we'd want to avoid in the Nova API itself.

While we do check for valid images UUIDs (because the spec requires it I think) I'd actually like to suggest that this is poor behavior since it involves making an extra call to Glance. Perhaps long term we should actually look at changing the Nova v3 spec to validate the image ID later as well when the image is actually downloaded.

Changed in nova:
status: New → Won't Fix
Revision history for this message
Rohit Karajgi (rohitk) wrote :

In my opinion, I think this check should be made in the API code making the behavior similar to the current implementation for booting from an image (atleast for v2). Either ways, validation should be made in the API.

The impact and overhead of not validating would be unwanted network creation and related DB calls involved.
Validation of the volume ID should be mandatory while booting from volume.

Revision history for this message
Dan Prince (dan-prince) wrote :

In general I think it is good to validate things up front in the API. When there is an extra cost associated with that validation I think we need to make an exception however and perform that validation asynchronously. This will help ensure that over the long term our API performance remains fast.

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.