The proposal to merge 
lp:~chad.smith/vmbuilder/jenkins_kvm_azure_netplan_hotplug into 
lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm has been updated.

Description changed to:

WIP: I think I targeted the wrong branch, will resubmit tomorrow
diff should be http://paste.ubuntu.com/p/Kx8YrXv7cp/

Azure images deliver a script /usr/local/sbin/ephemeral_eth.sh which is called 
from udev add rules on nic hotplug events for nics named eth[1-9]*. This script 
was created when netplan wasn't a 'thing' and, as such, only cared about 
/etc/network/interfaces.

In Artful and later, cloud-init writes a fallback interface config in 
/etc/netplan/50-cloud-init.yaml configuration dhcp on eth0 as a 
primary/mandatory NIC (optional: false). So boot will wait on that device to 
come up.

This changeset adds a test whether netplan command exists in ephemeral_eth.sh:
  - If netplan is present, a separate /etc/netplan/90-hotplug-<nicname>.yaml 
will be generated for each network device eth[1-9]n* that is attached after 
cloud-init's initial network configuration.
  - After the netplan yaml is created, call 'netplan apply' to bring up that 
device with dchp. The netplan config will specify that these nics are 
"optional: true" so that subsequent boots will not wait on them to come up in 
case they are subsequently detached.

Attaching nics in Azure is done through their UI or API. The 
attaching/detaching operation in Azure requires an instance to be stopped 
before attach/detach and started after the operation.

  Potental gap:
     There is no attempt to clean up old netplan yaml files, or to designate a 
new primary/mandatory nic because this original hotplug script didn't deal with 
udev rules for hotplug removal of nics (via Azure network interface detachment).
     This could present a minor issue if eth1 is attached (and optional by 
design) and eth0 gets detached. In that case, systemd may still wait for eth0 
to come up because of the mandatory eth0 definition in 
/etc/netplan/50-cloud-init.yaml.

For more details, see:
https://code.launchpad.net/~chad.smith/vmbuilder/jenkins_kvm_azure_netplan_hotplug/+merge/347212
-- 
Your team VMBuilder is requested to review the proposed merge of 
lp:~chad.smith/vmbuilder/jenkins_kvm_azure_netplan_hotplug into 
lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm.

_______________________________________________
Mailing list: https://launchpad.net/~vmbuilder
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~vmbuilder
More help   : https://help.launchpad.net/ListHelp

Reply via email to