type fixed Rewrote my last hidden comment fixing typo
All said, I think this patch handles most use cases, hotpluggedeth0 will match any newly attached eth0 that is present on the system during boot (and mark that device RequiredForOnline=yes if 50-cloud-init.yaml doesn't match because of a mac address mismatch.
We won't clean up cloud-init's yaml for a couple reasons:
1. Long term cloud-init is growing the ability to handle cold plug and hot plug events like this generically when presented with hardware/network deltas in metatdata so it will be able to regenerate the proper config (and remove 90-hotplug-azure.yaml in the process.
2. If this script removed or disabled the 50-cloud-init.yaml and the original eth0 were reattached in the future, we would want to resurrect that original 50-cloud-init.yaml. This adds complexity and additional udev rule complexity further coupling this script to cloud-init existing behavior. I'm not certain that adding complexity and risk to this one-off solution is something that we want to add here given that cloud-init is actively working on the hotplug feature that should replace this image template in its entirity.
type fixed Rewrote my last hidden comment fixing typo
All said, I think this patch handles most use cases, hotpluggedeth0 will match any newly attached eth0 that is present on the system during boot (and mark that device RequiredForOnli ne=yes if 50-cloud-init.yaml doesn't match because of a mac address mismatch.
We won't clean up cloud-init's yaml for a couple reasons: azure.yaml in the process.
1. Long term cloud-init is growing the ability to handle cold plug and hot plug events like this generically when presented with hardware/network deltas in metatdata so it will be able to regenerate the proper config (and remove 90-hotplug-
2. If this script removed or disabled the 50-cloud-init.yaml and the original eth0 were reattached in the future, we would want to resurrect that original 50-cloud-init.yaml. This adds complexity and additional udev rule complexity further coupling this script to cloud-init existing behavior. I'm not certain that adding complexity and risk to this one-off solution is something that we want to add here given that cloud-init is actively working on the hotplug feature that should replace this image template in its entirity.