How can I assign a port to VM without ip in openstack?

183 Views Asked by At

I get following error when I create a port with --no-fixied-ip option and assign to a VM.

Port c0636994-e926-464f-b47d-00d83098d39c requires a FixedIP in order to be used. (HTTP 400) (Request-ID: req-76e44907-1dad-407a-b922-49230054986a)

Is it allowed operation in openstack?

Regards,

1

There are 1 best solutions below

4
eblock On BEST ANSWER

Which openstack release are you using? In Victoria this works as expected for me:

root@control01:~# openstack port create --no-fixed-ip --network 48cf59e4-cee6-424d-8003-94bcc0913926 test-port

root@control01:~# openstack port show 481adfb6-8f9a-452a-8056-a8a0d2cb6db1 -c fixed_ips -f value
[]

root@control01:~# nova interface-attach --port-id 481adfb6-8f9a-452a-8056-a8a0d2cb6db1 c17125f3-9bbd-49a9-9922-4b56a4767625
+------------+--------------------------------------+
| Property   | Value                                |
+------------+--------------------------------------+
| ip_address |                                      |
| mac_addr   | fa:16:3e:b8:72:44                    |
| net_id     | 48cf59e4-cee6-424d-8003-94bcc0913926 |
| port_id    | 481adfb6-8f9a-452a-8056-a8a0d2cb6db1 |
| port_state | DOWN                                 |
| tag        | -                                    |
+------------+--------------------------------------+