~minagalic/cloud-init:feax/ephemeral_connectivity

Last commit made on 2018-11-21
Get this branch:
git clone -b feax/ephemeral_connectivity https://git.launchpad.net/~minagalic/cloud-init
Only Mina Galić can upload to this branch. If you are Mina Galić please log in for upload directions.

Branch merges

Branch information

Name:
feax/ephemeral_connectivity
Repository:
lp:~minagalic/cloud-init

Recent commits

f846655... by Chad Smith

unit test cleanup; add unit test for has_url_connectivity

Also added a bit of checking on the url param passed to has_url_connectivity
function since we don't want callsites to stuff in the wrong type of content.

0291cf3... by =?utf-8?q?Igor_Gali=C4=87?= <email address hidden>

Remove private _connectivity_check()

we're using a public module function now

68046f6... by =?utf-8?q?Igor_Gali=C4=87?= <email address hidden>

Thanks to tests, discovered it's better to test connectivity ourselves

in __enter__(), *before* calling self.obtain_lease()
Otherwise we're performing too much discovery before trying to actually test
connectivity by instantiating EphemeralIPv4Network

The question left now, is whether we should still pass connectivity_url to
EphemeralIPv4Network. Chances are, nothing has changed in the last sub-second,
and if it hasn't, then we're taking another 5 second penalty here.

f3c4223... by =?utf-8?q?Igor_Gali=C4=87?= <email address hidden>

EphemeralDHCPv4: add connectivity_url parameter

..and pass it on to EphemeralIpv4Network

9a143b7... by =?utf-8?q?Igor_Gali=C4=87?= <email address hidden>

EphemeralIPv4Network: add connectivity check via URL

We add a new Optional parameter: connectivity_url
This is used in __enter__ to verify if a connection already exists.
If it does exist, no operations are performed.

8f812a1... by Chad Smith

azure: _poll_imds only retry on 404. Fail on Timeout

Upon URL timeout, _poll_imds is expected to re-dhcp to get updated
IP configuration. We don't want to indefinitely retry because the
instance likely has invalid IP configuration.

LP: #1803598

a3812a4... by =?utf-8?q?Igor_Gali=C4=87?= <email address hidden>

resizefs: Prefix discovered devpath with '/dev/' when path does not exist

In some environments, like FreeBSD, gpart can return the device basename
instead of the full path. If this discovered devpath does not exist and
is missing the '/dev/' prefix, add that prefix in an attempt to find the
device.

6062595... by Chad Smith

azure: retry imds polling on requests.Timeout

There is an infrequent race when the booting instance can hit the IMDS
service before it is fully available. This results in a
requests.ConnectTimeout being raised.
Azure's retry_callback logic now retries on either 404s or Timeouts.

LP:1800223

6f95120... by Jason Zions <email address hidden>

azure: Accept variation in error msg from mount for ntfs volumes

If Azure detects an ntfs filesystem type during mount attempt, it should
still report the resource device as reformattable. There are slight
differences in error message format on RedHat and SuSE. This patch
simplifies the expected error match to work on both distributions.

LP: #1799338

d910ecd... by Aswin Rajamannar

azure: fix regression introduced when persisting ephemeral dhcp lease

In commitish 9073951 azure datasource tried to leverage stale DHCP
information obtained from EphemeralDHCPv4 context manager to report
updated provisioning status to the fabric earlier in the boot process.

Unfortunately the stale ephemeral network configuration had already been
torn down in preparation to bring up IMDS network config so the report
attempt failed on timeout.

This branch introduces obtain_lease and clean_network public methods on
EphemeralDHCPv4 to allow for setup and teardown of ephemeral network
configuration without using a context manager. Azure datasource now uses
this to persist ephemeral network configuration across multiple contexts
during provisioning to avoid multiple DHCP roundtrips.