cirros-dev / cirros

116 stars 33 forks source link

[dhcpcd] Drop fallback to ipv4ll and increase wait time to 180s #116

Closed karelyatin closed 1 month ago

karelyatin commented 2 months ago

With the switch to dhcpcd in [1] we are hitting random issues in our jobs where dhcp server takes some time to be ready while cirros just use ipv4ll address and don't retry. With udhcpc it was not the case, also it used to retry 3 times every 60 seconds before giving up.

Currently it immediately forks to background as it detects interface do not have carrier acquired, and continues other operations like metadata fetch to configure ssh keys but since dhcp ip and routes not configured for metadata, metadata fetch also fails.

Added -w option with timeout of 180s similar to udhcpc, this will make it to wait for ip for 180s before forking to background and continuing with other operations like metadata fetch.

[1] https://github.com/cirros-dev/cirros/commit/ded54d Related-Bug: https://bugs.launchpad.net/neutron/+bug/2045549

karelyatin commented 2 months ago

@smoser @osfrickler can you check please

karelyatin commented 2 months ago

ping @smoser @osfrickler

smoser commented 1 month ago

OK. thanks to @osfrickler for pushing a bit in #cirros on libera.

Speaking with him, I think this makes the following behavior changes can you please verify that I understand correctly?

  1. Previously if there was only 1 interface it would wait but multiple interfaces would not wait. with -w if there are multiple interfaces it will now wait until one gets an address.
  2. drop fallback use of ipv4ll
  3. increase timeout in effect from 30 to 120

Then after we've settled the changes that are made, please update the commit message to clearly indicate those changes. In the summary (first line) we want to at least mention each of the changes so the generated release notes will pick them up.

Then I think I'm happy with this.

karelyatin commented 1 month ago

@smoser << 1. Previously if there was only 1 interface it would wait but multiple interfaces would not wait. with -w if there are multiple interfaces it will now wait until one gets an address. Actually it wait only if interface have carrier acquired else it immediately goes to background whether it's 1 interface or multiple. For example in console log i see:- Starting network: dhcpcd-9.4.1 starting DUID 00:04:69:f5:1c:52:94:c0:46:44:96:d1:15:b7:2d:08:a3:9b forked to background, child pid 250 no interfaces have a carrier << 2. drop fallback use of ipv4ll Yes with this patch will not fallback to ipv4ll << 4. increase timeout in effect from 30 to 120 Yes it will now wait for ip for 120s before forking to background

Will update the commit message to reflect these

karelyatin commented 1 month ago

@smoser << 1. Previously if there was only 1 interface it would wait but multiple interfaces would not wait. with -w if there are multiple interfaces it will now wait until one gets an address. Actually it wait only if interface have carrier acquired else it immediately goes to background whether it's 1 interface or multiple. For example in console log i see:- Starting network: dhcpcd-9.4.1 starting DUID 00:04:69:f5:1c:52:94:c0:46:44:96:d1:15:b7:2d:08:a3:9b forked to background, child pid 250 no interfaces have a carrier << 2. drop fallback use of ipv4ll Yes with this patch will not fallback to ipv4ll << 4. increase timeout in effect from 30 to 120 Yes it will now wait for ip for 120s before forking to background

Will update the commit message to reflect these

updated, and also updated timeout to 180s to make it similar to previous behavior as seen with udhcpc.