Skip to content
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

release: mark ipv6 lease as optional for eth0 #1602

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Jun 3, 2021

Issue number:
Fixes #1351

Description of changes:

uthor: Erikson Tung <etung@amazon.com>
Date:   Thu Jun 3 12:47:44 2021 -0700

    release: mark ipv6 lease as optional for eth0

    This marks the DHCPv6 as optional in the network interface configuration
    file for eth0.

    When wicked reads the network interface configuration, it knows not to
    wait for an ipv6 address lease. Wicked no longer waits the full 30
    seconds for an ipv6 address lease when there is no ipv6 support.


Testing done:
Launched 10 instances in an subnet without ipv6 address assignment, all of them get initialized much quicker than before. Wicked no longer waits the full 30 seconds for an ipv6 address assignment.

bash-5.0# systemd-analyze blame
7.300s activate-multi-user.service                                                
7.036s kubelet.service                                                            
2.148s systemd-tmpfiles-setup.service                                             
1.838s wicked.service              
...

bash-5.0# wicked ifstatus eth0
...
eth0            up
      link:     #2, state up, mtu 9001
      type:     ethernet, hwaddr 02:64:19:14:01:f3
      config:   wicked:xml:/etc/wicked/ifconfig/eth0.xml
      leases:   ipv4 dhcp granted
      leases:   ipv6 dhcp requesting
      addr:     ipv4 192.168.25.30/19 [dhcp]
      route:    ipv4 default via 192.168.0.1 proto dhcp
wicked: Exit with status: 0

Then I enabled IPv6 address assignment for a subnet and launched an instance into it, wicked comes up fine, the host gets both an ipv4 address and ipv6 address without problem:

bash-5.0# systemd-analyze blame
8.869s activate-multi-user.service                                                
8.639s kubelet.service                                                            
7.965s systemd-tmpfiles-setup.service                                             
3.523s wicked.service                 
bash-5.0# wicked ifstatus eth0
eth0            up
      link:     #2, state up, mtu 9001
      type:     ethernet, hwaddr 02:f8:6d:24:d5:d1
      config:   wicked:xml:/etc/wicked/ifconfig/eth0.xml
      leases:   ipv4 dhcp granted
      leases:   ipv6 dhcp granted
      addr:     ipv4 192.168.18.82/19 [dhcp]
      addr:     ipv6 2600:1f14:326:5500:8a3a:6b96:f3ae:a87e/64 [dhcp]
      route:    ipv4 default via 192.168.0.1 proto dhcp
      route:    ipv6 default via fe80::cc:7cff:feec:c0f1 metric 1024 proto ra
wicked: Exit with status: 0

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Copy link
Member

@jpculp jpculp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if 1 second is slightly too aggressive and if something 2-5 might be a safer choice.

@etungsten
Copy link
Contributor Author

I wonder if 1 second is slightly too aggressive and if something 2-5 might be a safer choice.

If the wicked client doesn't wait, the dhcp clients would still attempt to lease addresses in the background. Timing out doesn't actually cause wicked.service to fail or anything.

Setting it higher would just result in more time spent waiting for dhcpv6 lease when wicked decides to wait. I guess the concern would be that services that depend on wicked.service might start up when the host still doesn't have an IP assigned. It's not clear to me what impact that would have.

It's also not clear to me how much time is appropriate to wait for an IP under suboptimal network conditions. It's unfortunate that we can't separately specify the timeout for dhcpv4 and dhcpv6. I'll go ahead and set the timeout to 5 seconds then. (5000 milliseconds sound like more than enough time for dhcpv4 to get an address).

@etungsten etungsten force-pushed the wickedddddddd branch 2 times, most recently from f839153 to 6d5f298 Compare June 3, 2021 21:54
@etungsten
Copy link
Contributor Author

Push above changes the timeout value from 1 seconds to 5 seconds. Updated PR description to reflect changes.

@etungsten etungsten changed the title wicked: limit timeout to 1 second when waiting for network interfaces wicked: limit timeout to 5 seconds when waiting for network interfaces Jun 3, 2021
Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix

This marks the DHCPv6 as optional in the network interface configuration
file for eth0.

When wicked reads the network interface configuration, it knows not to
wait for an ipv6 address lease. Wicked no longer waits the full 30
seconds for an ipv6 address lease when there is no ipv6 support.
@etungsten etungsten changed the title wicked: limit timeout to 5 seconds when waiting for network interfaces release: mark ipv6 lease as optional for eth0 Jun 7, 2021
@etungsten
Copy link
Contributor Author

Push above changes the approach. @bcressey found a better way of making wicked skip waiting on an ipv6 address lease.
Instead of changing the wicked wait_for_interfaces timeout, we now mark dhcpv6 as optional in the eth0 interface config.

Updated PR description to reflect changes.
Tested things and things work as expected, testing section in the PR description has more details.

@etungsten etungsten merged commit 06e1634 into bottlerocket-os:develop Jun 7, 2021
@etungsten etungsten deleted the wickedddddddd branch June 7, 2021 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Booting EKS image in a VPC w/o IPv6 support takes additional ~30s
6 participants