[neutron] Static ip address of subnet dhcp server

Kamil Madac kamil.madac at gmail.com
Wed Sep 20 12:09:03 UTC 2023


OK, I found a solution, so I will post it here if anyone has the same issue.

after creation of new subnet, we need to set new ip address and unset old
one on ovnmeta port:

openstack port set --fixed-ip subnet=<subnet_id>,ip-address=172.16.2.3
<ovnmeta_port_id>
openstack port unset --fixed-ip subnet=<subnet_id>,ip-address=172.16.2.1
<ovnmeta_port_id>

Then when VM is created on compute node, metadata agent sets new IP
in ovnmeta namespace.
If namespace already exists, restart of ovn metadata agent updates the IP
in ovnmeta namespace.



On Wed, Sep 20, 2023 at 11:35 AM Kamil Madac <kamil.madac at gmail.com> wrote:

> Hi Rodolfo,
>
> Thanks for the response, and sorry for the confusion which can be caused
> by my lack of knowledge about how ovn is implemented in openstack. I have
> seen following blueprint (not for OVN obviosly):
>
> https://wiki.openstack.org/wiki/Neutron/enable-to-set-dhcp-port-attributes
>
> and somehow thought that dhcp has an ip address assigned also in OVN.
>
> When I checked it once more I found out that device_id of the port has
> prefix ovnmeta-, which means that it is not dhcp but metadata agent or
> proxy:
>
> $ openstack port show -f table -c id -c fixed_ips -c device_id
> 4f70acdf-59e9-4252-9f0c-c71eb68baa9a
>
> +-----------+---------------------------------------------------------------------------+
> | Field     | Value
>               |
>
> +-----------+---------------------------------------------------------------------------+
> | device_id | ovnmeta-61d55c5b-adeb-440e-a029-796e783fdc02
>              |
> | fixed_ips | ip_address='172.16.0.1',
> subnet_id='4632d9e5-6918-415e-b752-9f828e57404c' |
> | id        | 4f70acdf-59e9-4252-9f0c-c71eb68baa9a
>              |
>
> +-----------+---------------------------------------------------------------------------+
>
> Is it possible to set another ip address of this port during creation of
> the subnet, or afterwards?
>
> Thanks
>
> On Wed, Sep 20, 2023 at 10:22 AM Rodolfo Alonso Hernandez <
> ralonsoh at redhat.com> wrote:
>
>> Hello Kamil:
>>
>> I'm not sure what you are asking for, sorry. In ML2/OVN, the DHCP server
>> is local (in the same compute node where the VM is spawned) and has no IP
>> address. The local OVS instance will capture the DHCP requests and reply to
>> them.
>>
>> If you are asking for a VM port with a static IP address, this is
>> something you can currently do creating a port and setting the fixed IP
>> address [1].
>>
>> Can you share the blueprint you are referring to? How do you plan to
>> migrate VMs to a different cloud?
>>
>> Regards.
>>
>> [1]https://paste.opendev.org/show/bl87sEpUnZttIMxN9fyc/
>>
>> On Wed, Sep 20, 2023 at 9:52 AM Kamil Madac <kamil.madac at gmail.com>
>> wrote:
>>
>>> Hello OpenStack community,
>>>
>>> I'd like to ask whether it's possible to set a static fixed IP address
>>> for a DHCP server within a subnet, especially when using the OVN driver.
>>> While I've come across a blueprint that addresses this topic, I haven't
>>> been able to find any pertinent details in the documentation.
>>>
>>> Our primary use case is to maintain IP addresses during the migration of
>>> VMs between two OpenStack clouds.
>>>
>>> Any guidance or suggestions would be greatly appreciated.
>>>
>>> Thank you!
>>>
>>> --
>>> Kamil Madac
>>>
>>
>
> --
> Kamil Madac <https://kmadac.github.io/>
>


-- 
Kamil Madac <https://kmadac.github.io/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.openstack.org/pipermail/openstack-discuss/attachments/20230920/759c1bc7/attachment.htm>


More information about the openstack-discuss mailing list