OS-DCF:diskConfig="MANUAL" using XML yields Bad Request

Bug #1189817 reported by Navneet Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Navneet Kumar

Bug Description

When creating server via Nova API and specifying OS-DCF:diskConfig="MANUAL" using XML formatted data, the API returns Bad Request.

Steps to Recreate: Create a server with OS-DCF:diskConfig="MANUAL" in an XML Request. This fails with the following error: HTTP/1.1 400 Bad Request

Workaround: Use JSON

Tags: api
melanie witt (melwitt)
tags: added: api
Revision history for this message
Navneet Kumar (navneetk) wrote :

This bug is due to missing namespace declaration in the xml request body.If we make the request with

<server xmlns="http://docs.openstack.org/compute/api/v1.1" imageRef="1c1796f0-bb4a-4cfc-b0f6-743bd0598b5e" flavorRef="42" os-dcf:diskConfig="MANUAL" name="demo_instance5"/>

it fails with following error: HTTP/1.1 400 Bad Request

But if we make the request with

<server xmlns="http://docs.openstack.org/compute/api/v1.1" xmlns:os-dcf="http://docs.rackspacecloud.com/servers/api/ext/diskConfig/v1.0" imageRef="1c1796f0-bb4a-4cfc-b0f6-743bd0598b5e" flavorRef="42" os-dcf:diskConfig="MANUAL" name="demo_instance5"/>

it gives proper response without any error.

I have attached a screenshot for the same.

Revision history for this message
John Garbutt (johngarbutt) wrote :

Is this a bug? Sounds when you give nova a malformed request, it fails, just like you would expect?

What did you use to make the bad request?

Revision history for this message
Andrew Laski (alaski) wrote :

I'm also curious what was used to make this request. Does it use the API samples to generate the XML for a request, or something else? Is it just coded to not include the namespace because the sample didn't use it?

If the root of the problem really does come down to the api samples not including a namespace when they should then I feel that the proper fix is to enforce that with the test_api_sample doc generation. Basically instead of fixing this one case manually fix the root cause so that all doc samples are correct.

Revision history for this message
Christopher Yeoh (cyeoh-0) wrote :

Agreed, this is a problem with the documentation not specifying that the namespace is required, rather than a problem with the implementation.

Changed in nova:
assignee: nobody → Navneet Kumar (neet-iitk)
status: New → In Progress
Revision history for this message
Navneet Kumar (navneetk) wrote :

yes, This is just a problem with generated sample which doesn't clearly specify that namespace is required to use the 'os-dcf:diskConfig' flag.

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

Reviewed: https://review.openstack.org/53589
Committed: http://github.com/openstack/nova/commit/19aee125864204678042d83bc3b4177ccbe0aae9
Submitter: Jenkins
Branch: master

commit 19aee125864204678042d83bc3b4177ccbe0aae9
Author: Chris Yeoh <email address hidden>
Date: Thu Oct 24 21:25:11 2013 +1030

    Adds XML namespace example for disk config extension

    Adds XML namespace and specifying of the disk config value
    to the disk config extensions api sample test data for server
    creation. This is being done so the api samples used by the
    documentation contain the example of this usage.

    DocImpact

    Change-Id: Icd7aa3743f71dd1cb8575605e5f1ce5da6bd37bf
    Closes-Bug: 1189817

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