Azure / azure-init

A minimal provisioning agent designed for Azure Linux VMs.
MIT License
7 stars 10 forks source link

[RFE] improve image creation script to support multiple base image choices #90

Open anhvoms opened 1 week ago

anhvoms commented 1 week ago

Current situation

image_creation test script was built based on limited testing with Ubuntu as the base image with some image-specific assumptions (e.g., netplan networking). This might cause issues when used with other base images.

Impact

Testing might have undefined/unexpected behaviors when used with other distros as base images.

Ideal future situation

Test script should work against different distros as base images. It also should document which base images have been tested to work well.

Implementation options

Two important issues to handle: 1) Networking: we should identify which networking software is used with the existing image (ifup-down, netplan/systemd-networkd, systemd-networkd, NetworkManager, wicked, etc...) and ensure that the basic network configuration to perform dhcp on the primary interface is written since azure-init relies on primary nic's wireserver/imds routing to report provisioning complete. 2) Package management system: apt/yum/dnf to install required software and/or to remove existing packages (walinuxagent/cloud-init)

dongsupark commented 1 week ago

Another issue: the image creation script seems to suffer so often from races, e.g. az storage container create or az storage account show-connection-string returns even when the actual job was not quite done. As a result, subsequent commands randomly fail, so it becomes hard to debug. Ideally we could create a retry logic in that script, so the script could try to rerun certain commands up to x times.

Anyway for now I will try to keep the open PR https://github.com/Azure/azure-init/pull/88 as minimal as possible.