openstack server add fixed ip --fixed-ip does not set correct ip address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-openstackclient |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Description
===========
When trying to create attach a fixed ip (be it a provider IP) to an instance directly, I see different behaviour when using `nova interface-attach` and `openstack server add fixed ip`. The former assigns the ip successfully whereas the latter assigns a different ip in the same network
Steps to reproduce
==================
1. Create VM
2. Attach interface with `nova --debug interface-attach --net-id <netid> --fixed-ip <ip> <serverid>`
3. Remove interface with `openstack server remove network <serverid> <netid>`
4. Attach interface with openstack --debug server add fixed ip <serverid> --fixed-ip-address <ip> <netid>`
Expected result
===============
Both 2) and 4) should lead to the requested IP be attached
Actual result
=============
Only 2) assigns requested ip. 4) assigns a different ip in the same network.
Environment
===========
1. Exact version of OpenStack you are running? Yoga (nova 25.0.1)
2. Which hypervisor did you use? Libvirt 8.0.0 + KVM 4.2.1
What's the version of that?
2. Which storage type did you use? Ceph
3. Which networking type did you use? Neutron with OVN
Logs & Configs
==============
Please see attached file for debug logs
Thanks for the bug report and the reproduction steps. I was able to reproduce the problem, the fixed ip command assigns random IP even if we ask an IP explicitly:
$ openstack server add fixed ip a2a32647- 7b42-44a0- 96f1-0f6a929a87 c7 --fixed-ip-address 10.0.4.95 35634223- 1e9d-4c90- a47c-723e6e8773 ca ------- +------ ------- ------- ------- ------- ------- ------- ------- ------- ------- -----+ ------- +------ ------- ------- ------- ------- ------- ------- ------- ------- ------- -----+ 0da2-4635- 8523-79e1fa989c 25 | 7b42-44a0- 96f1-0f6a929a87 c7 | 1e9d-4c90- a47c-723e6e8773 ca | '10.0.4. 63', subnet_ id='c4b60a49- 37d0-4b48- 83a8-4fbcf18c2b 47' | ------- +------ ------- ------- ------- ------- ------- ------- ------- ------- ------- -----+
+------
| Field | Value |
+------
| Port ID | 3dfe6ea1-
| Server ID | a2a32647-
| Network ID | 35634223-
| MAC Address | fa:16:3e:56:87:24 |
| Port State | ACTIVE |
| Fixed IPs | ip_address=
| Tag | None |
+------
(we asked for IP 10.0.4.95 and got 10.0.4.63)