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

cloud-init: T5190: Added Cloud-init pre-configurator #1978

Merged
merged 1 commit into from May 9, 2023

Conversation

zdc
Copy link
Contributor

@zdc zdc commented May 4, 2023

Change Summary

Added Cloud-init pre-configurator

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

cloud-init

Proposed changes

Added a new service that starts before Cloud-init, waits for all network interfaces initialization, and if requested by config, checks which interfaces can get configuration via DHCP server and creates a corresponding Cloud-init network configuration.

This protects from two situations:

  • when Cloud-init tries to get meta-data via eth0 (default and fallback variant for any data source which depends on network), but the real network is connected to another interface
  • when Cloud-init starts simultaneously with udev and initializes the first interface to get meta-data before it is renamed to eth0 by udev

How to test

To test this, you need to deploy VyOS in an environment with Cloud-init, where meta-data should be fetched from the network and connect the VM to the network via any interface, except eth0. A good test environment is Equinix Metal, where usually eth2 is the main interface.

Without this change, the system will fail to get any meta-data and possibly will have an e0 interface except eth0.

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Added a new service that starts before Cloud-init, waits for all network
interfaces initialization, and if requested by config, checks which interfaces
can get configuration via DHCP server and creates a corresponding Cloud-init
network configuration.

This protects from two situations:

* when Cloud-init tries to get meta-data via eth0 (default and fallback variant
for any data source which depends on network), but the real network is connected
to another interface
* when Cloud-init starts simultaneously with udev and initializes the first
interface to get meta-data before it is renamed to eth0 by udev
@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, jestabro, sever-sever and c-po and removed request for a team May 4, 2023 20:14
@c-po c-po merged commit 70e4767 into vyos:current May 9, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants