Skip to content

sources/azure: consolidate ephemeral DHCP configuration#1229

Merged
TheRealFalcon merged 1 commit into
canonical:mainfrom
cjp256:azure-initial-dhcp-consolidation
Feb 4, 2022
Merged

sources/azure: consolidate ephemeral DHCP configuration#1229
TheRealFalcon merged 1 commit into
canonical:mainfrom
cjp256:azure-initial-dhcp-consolidation

Conversation

@cjp256
Copy link
Copy Markdown
Contributor

@cjp256 cjp256 commented Feb 1, 2022

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.

  • _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 cpatterson@microsoft.com

@cjp256 cjp256 force-pushed the azure-initial-dhcp-consolidation branch from 71a7eea to 38958d1 Compare February 1, 2022 18:42
@cjp256 cjp256 marked this pull request as draft February 1, 2022 18:49
@cjp256 cjp256 force-pushed the azure-initial-dhcp-consolidation branch 8 times, most recently from 20b34b8 to fb93045 Compare February 3, 2022 16:15
Comment thread cloudinit/sources/DataSourceAzure.py Outdated
Comment thread cloudinit/sources/DataSourceAzure.py Outdated
@cjp256 cjp256 force-pushed the azure-initial-dhcp-consolidation branch from fb93045 to 2f8bed1 Compare February 3, 2022 18:53
@cjp256 cjp256 force-pushed the azure-initial-dhcp-consolidation branch from 2f8bed1 to 07c6541 Compare February 4, 2022 13:02
@cjp256 cjp256 force-pushed the azure-initial-dhcp-consolidation branch from 07c6541 to 5d4ea2f Compare February 4, 2022 16:25
@cjp256 cjp256 marked this pull request as ready for review February 4, 2022 16:30
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

LGTM. There are a couple pylint errors that need to be fixed though.

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 <cpatterson@microsoft.com>
@cjp256 cjp256 force-pushed the azure-initial-dhcp-consolidation branch from 5d4ea2f to 7695837 Compare February 4, 2022 20:00
@cjp256
Copy link
Copy Markdown
Contributor Author

cjp256 commented Feb 4, 2022

LGTM. There are a couple pylint errors that need to be fixed though.

Fixed, I accidentally pushed the wrong ref earlier 😵‍💫

@TheRealFalcon TheRealFalcon merged commit 826783d into canonical:main Feb 4, 2022
@cjp256 cjp256 deleted the azure-initial-dhcp-consolidation branch April 25, 2022 16:39
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.

3 participants