Failed to get the bootable flag when using XML

Bug #1207155 reported by Xiaoxi Chen on 2013-08-01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Medium
Xiaoxi Chen

Bug Description

While I am trying to create a volume with --image-id option. The flag "bootable: false" should be changed to boolean true. But this is not happening in the xml interface response body.

XML Interface

I am creating a volume with image_ref

curl -i http://10.4.106.40:8776/v1/7d5a4646738a485287615a36222f6241/volumes -X POST -H "X-Auth-Project-Id: demo" -H "User-Agent: python-cinderclient" -H "Content-Type: application/xml" -H "Accept: application/xml" -H "X-Auth-Token: <Omitted>" -d '<volume bootable="false" xmlns="http://docs.openstack.org/compute/api/v1.1" display_name="Volume341822119" imageRef="eb7661b8-be43-4617-a8a2-9bca0d1f1137" size="1"><metadata ><meta key="Type">Test</meta></metadata></volume>'
HTTP/1.1 200 OK
X-Compute-Request-Id: req-b3cd252c-efd9-4d20-b2ad-3a6fa414f87e
Content-Type: application/xml
Content-Length: 458
Date: Tue, 30 Jul 2013 12:30:13 GMT

<?xml version='1.0' encoding='UTF-8'?>
<volume xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/volume/api/v1" status="creating" display_name="Volume341822119" availability_zone="nova" created_at="2013-07-30 12:30:13.337045" display_description="None" volume_type="None" snapshot_id="None" source_volid="None" id="3641b40e-973c-44ff-b182-c93c52e2430e" size="1"><attachments/><metadata><meta key="Type">Test</meta></metadata></volume>

I am doing a GET Operation on the above created volume (XML Interface)

curl -i http://10.4.106.40:8776/v1/7d5a4646738a485287615a36222f6241/volumes/3641b40e-973c-44ff-b182-c93c52e2430e -X GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-cinderclient" -H "Accept: application/xml" -H "X-Auth-Token: <Omitted>"

HTTP/1.1 200 OK
X-Compute-Request-Id: req-2748a808-58d4-484b-85a9-f37f2c1f8f04
Content-Type: application/xml
Content-Length: 1061
Date: Tue, 30 Jul 2013 13:04:23 GMT

<?xml version='1.0' encoding='UTF-8'?>
<volume xmlns:os-vol-image-meta="http://docs.openstack.org/volume/ext/volume_image_metadata/api/v1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/volume/api/v1" status="available" display_name="Volume341822119" availability_zone="nova" created_at="2013-07-30 12:30:13" display_description="None" volume_type="None" snapshot_id="None" source_volid="None" id="3641b40e-973c-44ff-b182-c93c52e2430e" size="1"><attachments/><metadata><meta key="Type">Test</meta></metadata><volume_image_metadata><meta key="kernel_id">e20cd257-63ae-475d-848b-dc9120a508df</meta><meta key="container_format">ami</meta><meta key="min_ram">0</meta><meta key="ramdisk_id">b1425ee8-092f-43d5-b616-ebe3f497f758</meta><meta key="disk_format">ami</meta><meta key="image_name">cirros-0.3.1-x86_64-uec</meta><meta key="image_id">eb7661b8-be43-4617-a8a2-9bca0d1f1137</meta><meta key="checksum">f8a2eeee2dc65b3d9b6e63678955bd83</meta><meta key="min_disk">0</meta><meta key="size">25165824</meta></volume_image_metadata></volume>

We can observe that "bootable" flag is not available in the response body on GET of XML

Where as in the case of JSON GET Operation this is happening

Below I have done a GET operation on Same Volume ID

curl -i http://10.4.106.40:8776/v1/7d5a4646738a485287615a36222f6241/volumes/3641b40e-973c-44ff-b182-c93c52e2430e -X GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: <>"

HTTP/1.1 200 OK
X-Compute-Request-Id: req-06e765f5-8e19-4f13-86f7-941c32e46059
Content-Type: application/json
Content-Length: 739
Date: Tue, 30 Jul 2013 13:01:28 GMT

{"volume": {"status": "available", "volume_image_metadata": {"kernel_id": "e20cd257-63ae-475d-848b-dc9120a508df", "container_format": "ami", "min_ram": "0", "ramdisk_id": "b1425ee8-092f-43d5-b616-ebe3f497f758", "disk_format": "ami", "image_name": "cirros-0.3.1-x86_64-uec", "image_id": "eb7661b8-be43-4617-a8a2-9bca0d1f1137", "checksum": "f8a2eeee2dc65b3d9b6e63678955bd83", "min_disk": "0", "size": "25165824"}, "display_name": "Volume341822119", "attachments": [], "availability_zone": "nova", "bootable": true, "created_at": "2013-07-30T12:30:13.000000", "display_description": null, "volume_type": "None", "snapshot_id": null, "source_volid": null, "metadata": {"Type": "Test"}, "id": "3641b40e-973c-44ff-b182-c93c52e2430e", "size": 1}}

Here bootable flag is available in the response body on GET (JSON)

Xiaoxi Chen (xiaoxi-chen) wrote :

This is because we didn't set the bootable flag on VolumeTemplate.

Changed in cinder:
assignee: nobody → xiaoxi_chen (xiaoxi-chen)
status: New → In Progress
Mike Perez (thingee) on 2013-08-04
Changed in cinder:
importance: Undecided → Medium

Reviewed: https://review.openstack.org/39626
Committed: http://github.com/openstack/cinder/commit/84d855d121adf7fbfc6a5b1bb4924068360d321e
Submitter: Jenkins
Branch: master

commit 84d855d121adf7fbfc6a5b1bb4924068360d321e
Author: xiaoxi_chen <email address hidden>
Date: Thu Aug 1 12:15:42 2013 +0800

    Set bootable flag for volume serializer

    In previous code we didn't set the bootable flag in volume
    serializer, and even didn't check it in test. This is the
    root cause for bug #1207155

    This patch fixed this issue by set the bootable flag in serializer.

    Fixed bug #1207155

    Change-Id: I0219785aa7f30036747c230800447e99c383042c

Changed in cinder:
status: In Progress → Fix Committed
Harika Vakadi (harika-vakadi) wrote :

I have tested the new code. Below is the new XML Interface GET Response with bootable volume flag

curl -i http://10.4.216.23:8776/v1/c37cbfdd2522456aafbfa3be5404063e/volumes/df76a55a-b79a-41ab-9572-bed79bbf38ff -X GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-cinderclient" -H "Accept: application/xml" -H "X-Auth-Token: <Token-Omitted>"
HTTP/1.1 200 OK
X-Compute-Request-Id: req-c6ec07d0-0312-4f98-a49e-9244943492a4
Content-Type: application/xml
Content-Length: 1077
Date: Thu, 08 Aug 2013 11:25:32 GMT

<?xml version='1.0' encoding='UTF-8'?>
<volume xmlns:os-vol-image-meta="http://docs.openstack.org/volume/ext/volume_image_metadata/api/v1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/volume/api/v1" status="available" display_name="Volume341822119" availability_zone="nova" bootable="True" created_at="2013-08-08 11:20:31" display_description="None" volume_type="None" snapshot_id="None" source_volid="None" id="df76a55a-b79a-41ab-9572-bed79bbf38ff" size="1"><attachments/><metadata><meta key="Type">Test</meta></metadata><volume_image_metadata><meta key="kernel_id">e7048184-03cb-478d-8b62-f30b2486eaf5</meta><meta key="container_format">ami</meta><meta key="min_ram">0</meta><meta key="ramdisk_id">a4cee3d9-cdb9-4276-b0d1-f459ecd7a6a4</meta><meta key="disk_format">ami</meta><meta key="image_name">cirros-0.3.1-x86_64-uec</meta><meta key="image_id">65fc29e3-7a27-4dcd-b3e3-3cf39880cc73</meta><meta key="checksum">f8a2eeee2dc65b3d9b6e63678955bd83</meta><meta key="min_disk">0</meta><meta key="size">25165824</meta></volume_image_metadata></volume>

Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) wrote :

Keep the bug FixCommitted until it lands in a release.

Changed in cinder:
status: Fix Released → Fix Committed
Thierry Carrez (ttx) on 2013-09-05
Changed in cinder:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers