Cannot assign instance to a given network from Python novaclient API
Hi, I have 2 networks and when I create an instance, it attaches itself automatically to both the networks by default. I want to mainly disable this and attach the instance to a network of my choice specified by the net-id I am writing Python novaclient API calls for this:
import os import time import novaclient.v1_1.client as nvclient from credentials import get_nova_creds creds=get_nova_creds() nova=nvclient.Client(**creds) image=nova.images.find(name="Ubuntu 12.10 cloudimg amd64") flavor=nova.flavors.find(name="m1.tiny") #network=nova.networks.find(label="net_left")
instance=nova.servers.create(name="samplehost", image=image, flavor=flavor,nic= '9883ec93-4589-4fa2-825d-7a9a8215fd07') //9883ec93-4589-4fa2-825d-7a9a8215fd07 is the ID of a network named 'net_left' status=instance.status
print "Status: %s" % status
My problem is in the nova.servers.create command where I am not able to specify the correct arguments for the net-id.
Could someone help me on by specifying the correct way to give the 'net-id' argument
Thanks