Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
nc.servers.create('test-server-1', img, my_flavor, nics = [{'port': port1['port']['id']}, {'port': port2['port']['id']}])

Looking at the code in python-novaclient/nova/v1_1/servers.py, I think you may have your arguments wrong. It looks like the API is looking for a port-id key, much like you would pass on the command line. The actual code is:

            if nic_info.get('port-id'):
                net_data['port'] = nic_info['port-id']

So, your call might look like:

nc.servers.create('test-server-1', img, my_flavor, 
                   nics = [{'port-id': port1['port']['id']},
                           {'port-id': port2['port']['id']}])

I've just tested that out locally and it seems to work.