-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After cloud-init init --local is executed, ephemeral IP do not cleanup #4100
Comments
Launchpad user shixuantong(sxt1001) wrote on 2023-04-12T03:33:34.015260+00:00 The key logs are as follows: 2023-04-12 02:46:41,022 - dhcp.py[DEBUG]: Performing a dhcp discovery on enp3s0 |
Launchpad user Chad Smith(chad.smith) wrote on 2023-04-12T17:11:25.593349+00:00 Thank you for this bug and helping contribute to make cloud-init better. Could you please help us better understand the problem you are trying to solve that leads you to want to setup networking on a live system before cloud-init is running so we can understand what you are trying to solve? The reason I ask is that calling cloud-init boot stages directly is not a typical use or pattern we expect to generally support. I think I'll mark this bug 'Incomplete' for the time being as we await more context from you, but please feel free to set it back to 'New' when you have time to respond. Cloud-init should be baked into base images and has 4 separate services designated to run in early system boot to discover a cloud-init datasource, and render networking at the right time in boot without collisions with other network config being previously brought up. Also, calling any cloud-init stage from cmdline after first boot should remain inert due to semaphores and data caching which inform cloud-init there is nothing else to do. It should have already detected a viable datasource and network config and applied it to the system in early boot, so I don't expect we should be seeing dhclient runs from the second time Specific to this reproducer, it looks like it is arbitrarily bringing up network manually and then invoking cloud-init's local boot stage[1] from the commandline where cloud-init hasn't run before during first boot for some reason. We don't expect cloud-init --local to run for the first time this late in a boot of a machine, our systemd unit cloud-init-local.service orders this unit 'Before=network-pre.target' which expects no network devices up. Here's a quote is from Freedesktop.org's documentation[2] around network-pre.target So, I'm wondering the following:
Much thanks, REFERENCES: each boot stage active in systemd boot targets launched I'm inclined to mark this bug as invalid because typically c You are exposing an interesting use-case here that I think is not intended for cloud-init. cloud-init --local invokes cloud-init's local boot stage Typically cloud-init-local.service is one that is scheduled by systemd to happen before any network is present |
Cloud-init's |
This bug was originally filed in Launchpad as LP: #2015946
Launchpad details
Launchpad user shixuantong(sxt1001) wrote on 2023-04-12T03:30:34.214924+00:00
Reproduction Procedure:
1、Configuring the dhclient.conf file:
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search,
netbios-name-servers, netbios-scope, interface-mtu,
ntp-servers, classless-static-routes;
supersede domain-name-servers 8.8.8.8;
supersede domain-search "mydomain.example.com";
supersede classless-static-routes 0 192.168.0.1;
timeout 60;
retry 300;
script "/sbin/dhclient-script";
2、bonding nic to bond0
nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
nmcli con add type bond-slave ifname enp3s0 master bond0
nmcli con up bond-slave-enp3s0
3、running cloud-init init --local
4、ephemeral IP do not cleanup (enp3s0)
... ...
2: enp3s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000
link/ether 52:54:00:e9:cb:d9 brd ff:ff:ff:ff:ff:ff
inet 192.168.172.208/16 brd 192.168.255.255 scope global dynamic enp3s0
valid_lft 33689sec preferred_lft 33689sec
... ...
5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 52:54:00:e9:cb:d9 brd ff:ff:ff:ff:ff:ff
inet 192.168.172.208/16 brd 192.168.255.255 scope global dynamic noprefixroute bond0
valid_lft 33675sec preferred_lft 33675sec
inet6 fe80::6e8f:d5d9:fa69:b1ba/64 scope link noprefixroute
valid_lft forever preferred_lft forever
The text was updated successfully, but these errors were encountered: