boot_from_volume with down of cinder-api return 400 badRequest

Bug #1239952 reported by haruka tanizawa
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
haruka tanizawa

Bug Description

[Nova]2b17aa7f5af2adb418592b7169b50b231989bf37

Now, when I boot VM from volume with down of cinder-api, openstack returns 400.
It seems incompatibility in this case.
When HTTPClient exception ocuured, it should return 500Internal server error.
In fact, Nova turned into normal responses from HTTPClient exception.

$cinder list --all-tenants
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 2facb85a-5ea1-4a9c-b615-e1dc75f30bb1 | available | None | 1 | None | false | |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

1. die cinder-api service
2. boot_from_volume
$curl -v -H "X-Auth-Token: $TOKEN" -H "Content-type: application/json" -X POST http://192.168.122.180:8774/v2/7020c32ea9384e0291f64f4c1288b397/os-volumes_boot -d '{
    "server": {
        "block_device_mapping": [
            {
                "delete_on_termination": 0,
                "device_name": "vda",
                "volume_id": "2facb85a-5ea1-4a9c-b615-e1dc75f30bb1",
                "volume_size": 1
            }
        ],
        "flavorRef": "1",
        "imageRef": "ce5505ca-4d22-4a57-bc63-261a1d6dd664",
        "name": "test-vm",
        "networks": [
            {
                "port": "cb10dd1d-87e5-421c-9382-32fe933317ea"
            }
        ]
    }
}'
* About to connect() to 192.168.122.180 port 8774 (#0)
* Trying 192.168.122.180... connected
> POST /v2/7020c32ea9384e0291f64f4c1288b397/os-volumes_boot HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: 192.168.122.180:8774
> Accept: */*
> X-Auth-Token: --skip--
> Content-type: application/json
> Content-Length: 314
>
* upload completely sent off: 314out of 314 bytes
< HTTP/1.1 400 Bad Request
< Content-Length: 135
< Content-Type: application/json; charset=UTF-8
< X-Compute-Request-Id: req-0a8323af-bd7c-4701-ad5a-afa0774fb213
< Date: Tue, 15 Oct 2013 06:32:31 GMT
<
* Connection #0 to host 192.168.122.180 left intact
* Closing connection #0
{
    "badRequest": {
        "code": 400,
        "message": "Block Device Mapping is Invalid: failed to get volume 2facb85a-5ea1-4a9c-b615-e1dc75f30bb1."
    }
}

(For reference, this report is same as openstack-dev mail post.
== [openstack-dev] behaviour about boot-from-volume (possible bug))

Tags: api
melanie witt (melwitt)
tags: added: api
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
jichenjc (jichenjc)
Changed in nova:
assignee: nobody → jichencom (jichenjc)
Revision history for this message
haruka tanizawa (h-tanizawa) wrote :

Sorry. Tempolary sync of gerrit and launchpad didn't go well.
And my first patch was https://review.openstack.org/#/c/58472/ .
But I have trouble in my develop environment from point of rpc version compatible.
I am grateful for the cooperation of you.
And if you are willing to push your patch, would you take Christopher Yeoh's comment
of my patch?

Revision history for this message
haruka tanizawa (h-tanizawa) wrote :

And if you are willing to push your patch, would you take Christopher Yeoh's comment
of my patch?
--> And if you are willing to push your patch, would you take Christopher Yeoh's comment
into consideration of my patch?

Revision history for this message
jichenjc (jichenjc) wrote :

Hi, I unassigned myself, please help to assign to you and I can review the patches
sorry for inconvenience~

Changed in nova:
assignee: jichencom (jichenjc) → nobody
Changed in nova:
assignee: nobody → haruka tanizawa (h-tanizawa)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
haruka tanizawa (h-tanizawa) wrote :
summary: - boot_from_volume with death of cinder-api return 400 badRequest
+ boot_from_volume with down of cinder-api return 400 badRequest
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/86213
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6594746108afa2db39ca2973b3dd0c37611f955e
Submitter: Jenkins
Branch: master

commit 6594746108afa2db39ca2973b3dd0c37611f955e
Author: s iwata <email address hidden>
Date: Fri May 23 17:11:20 2014 +0900

    Raise HTTPInternalServerError when boot_from_volume with cinder down

    This patch changes exception type.
    Boot_from_volume api raises BlockDeviceMappingIsInvalid exception
    when cinder-api is down.
    Also it returns response code 400.
    It is not exact. Because request is valid.
    Exception was changed to raise HTTPInternalServerError and
    return a 500 error.

    Closes-Bug: #1239952

    Change-Id: Iec8839d46e6186fe544b28b0aafc8aa6faad53b7

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