I was thinking that problem in this line - https://github.com/cloud-init/cloud-init/blob/fa47d527a03a00319936323f0a857fbecafceaf7/cloudinit/sources/DataSourceCloudStack.py#L222
That the problem with dhcp.networkd_get_option_from_leases('SERVER_ADDRESS') where we don't specify location of the leases and it defaults to one specified here https://github.com/cloud-init/cloud-init/blob/fa47d527a03a00319936323f0a857fbecafceaf7/cloudinit/net/dhcp.py#L24 and because of that this function cannot return VR IP correctly.
Then it falls to the second part of the function code https://github.com/cloud-init/cloud-init/blob/fa47d527a03a00319936323f0a857fbecafceaf7/cloudinit/sources/DataSourceCloudStack.py#L234-L246 and it fails to get DHCP server address as it is looking for match "dhcp-server-identifier" and not "SERVER_ADDRESS" and as the result it posts error message (part of the code I linked to above) to the logs: 2019-09-10 20:00:40,693 - DataSourceCloudStack.py[DEBUG]: No DHCP found, using default gateway
However after using your suggestion it works. So the name of the service is NetworkManager.service:
[root@centos-host ~]# systemctl status NetworkManager ● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2019-09-10 16:00:38 EDT; 19h ago Docs: man:NetworkManager(8) Main PID: 687 (NetworkManager) Tasks: 3 (limit: 5033) Memory: 9.2M CGroup: /system.slice/NetworkManager.service └─687 /usr/sbin/NetworkManager --no-daemon ..... [root@centos-host ~]#
And after trying your suggestion to start cloud-init after NetworkManager it worked fine.
[root@centos-host cca-user]# cat /etc/systemd/system/cloud-init.service.d/10-nm.conf [Unit] After=NetworkManager.service [root@centos-host cca-user]#
Thanks for finding solution!
I was thinking that problem in this line - https:/ /github. com/cloud- init/cloud- init/blob/ fa47d527a03a003 19936323f0a857f becafceaf7/ cloudinit/ sources/ DataSourceCloud Stack.py# L222
That the problem with dhcp.networkd_ get_option_ from_leases( 'SERVER_ ADDRESS' ) where we don't specify location of the leases and it defaults to one specified here https:/ /github. com/cloud- init/cloud- init/blob/ fa47d527a03a003 19936323f0a857f becafceaf7/ cloudinit/ net/dhcp. py#L24 and because of that this function cannot return VR IP correctly.
Then it falls to the second part of the function code https:/ /github. com/cloud- init/cloud- init/blob/ fa47d527a03a003 19936323f0a857f becafceaf7/ cloudinit/ sources/ DataSourceCloud Stack.py# L234-L246 and it fails to get DHCP server address as it is looking for match "dhcp-server- identifier" and not "SERVER_ADDRESS" and as the result it posts error message (part of the code I linked to above) to the logs: Stack.py[ DEBUG]: No DHCP found, using default gateway
2019-09-10 20:00:40,693 - DataSourceCloud
However after using your suggestion it works. So the name of the service is NetworkManager. service:
[root@centos-host ~]# systemctl status NetworkManager service - Network Manager systemd/ system/ NetworkManager. service; enabled; vendor preset: enabled) ger(8) slice/NetworkMa nager.service NetworkManager --no-daemon
● NetworkManager.
Loaded: loaded (/usr/lib/
Active: active (running) since Tue 2019-09-10 16:00:38 EDT; 19h ago
Docs: man:NetworkMana
Main PID: 687 (NetworkManager)
Tasks: 3 (limit: 5033)
Memory: 9.2M
CGroup: /system.
└─687 /usr/sbin/
.....
[root@centos-host ~]#
And after trying your suggestion to start cloud-init after NetworkManager it worked fine.
[root@centos-host cca-user]# cat /etc/systemd/ system/ cloud-init. service. d/10-nm. conf nager.service
[Unit]
After=NetworkMa
[root@centos-host cca-user]#
Thanks for finding solution!