Nova REST API documentation does not mention how to assign networks while launching an instance

Bug #1158691 reported by Balamurugan V G
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Medium
Diane Fleming

Bug Description

Release : Folsom 2012.2.2

I have a Folsom 2012.2.2 with Quantum and trying to create the instances using the REST API as below:

curl -X 'POST' http://1.1.1.1:8774/v2/4a8c3029619e4afbaa39f85fcd121003/servers -d '{ "server": { "flavorRef": "6", "imageRef":
> "dd13a38c-3e1f-49f1-afbe-c6f62cd46ffb", "name": "test" } }' -H 'Accept: application/json' -H "X-Auth-Token: b5f64418cdf4a99a79aada03621cfa9" -H 'Content-type: application/json'

 But this assigns the instance to all networks available for the tenant. I referred to the documentation at http://docs.openstack.org/api/openstack-compute/2/content/CreateServers.htmlbut but this does not talk about assigning specific networks.

But looking in to /usr/lib/python2.7/dist-packages/nova/api/openstack/compute/servers.py, I figured the parameters to be passed and the following call worked.

curl -X 'POST' http://1.1.1.1:8774/v2/4a8c3029619e4afbaa39f85fcd121003/servers -d '{"server": { "flavorRef": "6", "imageRef":
"dd13a38c-3e1f-49f1-afbe-c6f62cd46ffb", "name": "test4", "networks": [{"uuid": "02016649-f9a6-4623-b82f-f5a2c95d2b7a"}, {"uuid":
"4784ed46-7f09-4e57-b279-e65529442bd5"}] } }' -H 'Accept: application/json' -H "X-Auth-Token: 738bc36849f4b35bd4623e50b249ff3" -H 'Content-type: application/json'

This associated the desired networks in the order specified, exactly what I wanted.

Please update the document to include all supported parameters.

Chuck Short (zulcss)
affects: nova → openstack-manuals
Anne Gentle (annegentle)
no longer affects: openstack-manuals
Changed in openstack-api-site:
status: New → Triaged
importance: Undecided → Medium
Changed in openstack-api-site:
assignee: nobody → Diane Fleming (diane-fleming)
Changed in openstack-api-site:
status: Triaged → In Progress
milestone: none → icehouse
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/77229

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

Reviewed: https://review.openstack.org/77229
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=9e79b8c86585f85168b117530770f0b10c8f1b59
Submitter: Jenkins
Branch: master

commit 9e79b8c86585f85168b117530770f0b10c8f1b59
Author: Diane Fleming <email address hidden>
Date: Fri Feb 28 11:33:10 2014 -0600

    Add missing "networks" element to the POST /servers call

    Closes-Bug: #1158691

    Change-Id: If17585db9ea3d5556cff6a252f701a298b10b8c0
    author: diane fleming

Changed in openstack-api-site:
status: In Progress → Fix Committed
Changed in openstack-api-site:
status: Fix Committed → Fix Released
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.