Repository navigation
Open
Description
Hi,
we run recently in an issue in our new network setup where we are using EVPN, VXLAN and some other technologies, means our hosts getting just an IP with /32 assigned.
I saw there is maybe an fix already for that: https://review.opendev.org/c/x/cloudbase-init/+/886824
It would be awesome if that could be merged. Would it be possible to create a nightly build for us where this change is included? I would love to test it and report back if that works.
Thank you very much!
Regards
Alex
2025-03-07 07:37:48.569 4776 INFO cloudbaseinit.plugins.common.networkconfig [-] Setting static IP configuration on network adapter "eth0". IP: xxx.xxx.151.6, prefix length: 32, gateway: 172.16.4.1, dns: ['8.8.8.8', '1.1.1.1']
2025-03-07 07:37:48.584 4776 DEBUG cloudbaseinit.osutils.windows [-] Removing existing route "169.254.169.254/32" from adapter "eth0" _set_static_network_config C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:996
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init [-] plugin 'NetworkConfigPlugin' failed with error '<x_wmi: DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.
(87, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', (0, None, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', None, None, 87), None)>': wmi.x_wmi: <x_wmi: DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init [-] <x_wmi: DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.
(87, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', (0, None, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', None, None, 87), None)>: wmi.x_wmi: <x_wmi: DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.
(87, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', (0, None, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', None, None, 87), None)>
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init Traceback (most recent call last):
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\wmi\__init__.py", line 112, in func_wrapper
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init return func(*args, **kwargs)
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\wmi\__init__.py", line 699, in invoke_method
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init r = op.get_next_instance()
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init PyMI.error: {'error_code': 87, 'mi_result': 4, 'message': 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n'}
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init During handling of the above exception, another exception occurred:
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init Traceback (most recent call last):
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\init.py", line 66, in _exec_plugin
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init (status, reboot_required) = plugin.execute(service,
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py", line 307, in execute
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init return self._process_network_details_v2(network_details)
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py", line 299, in _process_network_details_v2
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init reboot_required = NetworkConfigPlugin._process_networks(
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py", line 285, in _process_networks
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init reboot = osutils.set_static_network_config(
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py", line 1014, in set_static_network_config
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init self._set_static_network_config(
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py", line 1002, in _set_static_network_config
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init conn.MSFT_NetIPAddress.create(
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\wmi\__init__.py", line 62, in wrapper
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init return f(*args, **kwargs)
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\wmi\__init__.py", line 112, in func_wrapper
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init return func(*args, **kwargs)
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\wmi\__init__.py", line 149, in __call__
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init return self._conn.invoke_method(
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\wmi\__init__.py", line 125, in func_wrapper
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init raise x_wmi(err_msg, com_ex)
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init wmi.x_wmi: <x_wmi: DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.
2025-03-07 07:37:48.600 4776 ERROR cloudbaseinit.init (87, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', (0, None, 'DefaultGateway 172.16.4.1 is not on the same network segment (subnet) that is defined by the IP address xxx.xxx.151.6 and PrefixLength 32.\r\n', None, None, 87), None)>
Metadata
Metadata
Assignees
Labels
No labels
Activity
BirknerAlex commentedon Apr 1, 2025
I have tested the patch https://review.opendev.org/c/x/cloudbase-init/+/886824 against the latest stable and can confirm the change does work on Windows Server 2022.
maxpain commentedon Mar 31, 2026
We hit the same issue on our IaaS platform running Windows Server 2025 guests on Cloud Hypervisor with vDPA networking.
Our setup is L3-only: each VM gets a /32 address with an on-link gateway (169.254.0.1) on the host side, routes via BGP/SRv6. The network-config v2 we pass via NoCloud CIDATA looks like:
Cloudbase-init finds CIDATA, parses the config correctly, but fails at
MSFT_NetIPAddress.create()with:The patch from https://review.opendev.org/c/x/cloudbase-init/+/886824 is the right approach — create the on-link route to the gateway first, then the default route, and assign the IP without DefaultGateway. This is exactly what Linux cloud-init does under the hood (
ip route add 169.254.0.1 dev nic0 scope link && ip route add default via 169.254.0.1).Would be great to get this merged — L3-only /
/32-per-VM networking is becoming standard in modern cloud platforms.Fix network config when gateway is outside the address subnet
maxpain commentedon Mar 31, 2026
PR with the fix: #187
Fix network config when gateway is outside the address subnet
Fix network config when gateway is outside the address subnet
Fix network config when gateway is outside the address subnet