← Back to team overview

openstack team mailing list archive

[Nova] Query regarding REST API for VM creation for any tenant



To attach a VM to specific network (owned by same tenant) user can specify
--nic option in the command line with the network-id to which VM needs to
be attached

--nic <net-id=net-uuid,v4-fixed-ip=ip-addr>
                        Create a NIC on the server. Specify option multiple
                        times to create multiple NICs. net-id: attach NIC to
                        network with this UUID (optional) v4-fixed-ip: IPv4
                        fixed address for NIC (optional). port-id: attach
                        to port with this UUID (optional)

nova boot --image ed8b2a37-5535-4a5f-a615-443513036d71
--flavor 1
--nic net-id= <id of first network>
--nic net-id= <id of second network>  test-vm1

But looks like same can not be done using the REST API call.I didn't not
find any key where i can provide the networks detail where VM need to be

"server" : {
"name" : "new-server-test",
"imageRef" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e
"flavorRef" : "52415800-8b69-11e0-9b19-734f1195ff37",
"metadata" : {
"My Server Name" : "Apache1"
"personality" : [
"path" : "/etc/banner.txt",
"contents" : ""

Does that mean we can't accomplish this using REST API? Or is there any
alternate way we can accomplish this using REST?


Follow ups