Skip to content

Commit

Permalink
sources/azure: consolidate ephemeral DHCP configuration (canonical#1229)
Browse files Browse the repository at this point in the history
Introduce:

-  _setup_ephemeral_networking() to bring up networking.
  If no iface is specified, it will use net.find_fallback_nic()
  which is consistent with the previous usage of fallback_interface.
  This method now tracks the encoded address of the wireserver
  with a new property `_wireserver_endpoint`.  Introduce a
  timeout parameter to allow for retrying for a specified amount
  of time.

- _teardown_ephemeral_networking() to bring down networking.

- _is_ephemeral_networking_up() to check status.

Ephemeral networking is now:

- Brought up prior to checking IMDS.

- Torn down following metadata crawl.

- For Savable PPS, torn down prior to waiting for NIC detach.
  The link must be torn down in advance or we will see errors
  from cleaning up network after the interface is unplugged.

- For Running PPS, torn down after waiting for media switch.
  The link must be up for media switch to be detected.

- For all PPS, after network switch is complete, networking is
  brought back up to poll for reprovision data and report ready.
  It will be torn down after metadata crawl is complete like
  non-PPS paths.

Additionally:

- Remove EphemeralDHCPv4WithReporting variant in favor of directly
using EphemeralDHCPv4.  The reporting was only for __enter__ usage
which is no longer a used path.  Continue to use dhcp_log_cb
callback.

Signed-off-by: Chris Patterson <[email protected]>
  • Loading branch information
cjp256 authored Feb 4, 2022
1 parent 75a5c8f commit 826783d
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 315 deletions.
Loading

0 comments on commit 826783d

Please sign in to comment.