-
Notifications
You must be signed in to change notification settings - Fork 11
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
improve image_creation script #88
Conversation
783c45d
to
766a0a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this out with RG="jcline-azinit-test2" LOCATION="eastus2" BASE_IMAGE="Debian:debian-11:11-backports-gen2:latest" demo/image_creation.sh
and the VM failed configuration with
[ 33.134147] cloud-init[918]: /var/log/azure/image/setup.sh: line 14: /etc/netplan/eth0.yaml: No such file or directory
I assume /etc/netplan/ doesn't exist on that image.
Since you're not touching the customdata_template.yml
this is just an existing issue from what I can tell. The changes themselves look good good to me. You might want to point ShellCheck
at it, but all those were pre-existing so we can do that separately as well.
I cannot reproduce it myself, but anyway pushed a fix for that in
|
0c963f3
to
748429d
Compare
The image creation script was used with Ubuntu 20.04/22.04. It assumed that netplan was used for networking and a lot of code written was based on that assumption. See issue #90 |
748429d
to
f761ed5
Compare
Added an automated creation of image definition before creating image version. |
f761ed5
to
55322fd
Compare
* Make necessary variables configurable like resource group, storage account, location, vm_name, vm_size, etc. * Consolidate storage accounts creation into a single account, to avoid defining custom connection string env variables. Instead, generate connection string from the storage account directly to pass it to the subsequent commands. * Create storage account and container before getting SAS string. * Create SIG gallery before running az sig image-version create. * Convert variable names to capital letters. * Create image-definition before creating image-version in an automated way. * Explicitly set SecurityType=TrustedLaunch for vm create and sig image-definition create. * Address warnings and infos when running shellcheck, mainly by adding quotes around variables. * Add command line options -h for help and -v for verbose.
Create directory /etc/netplan before writing files into the directory. Remove a garbage file with `rm -f` to prevent the machine to be stuck before shutting down.
55322fd
to
a68e417
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you.
Improve
image_creation.sh
script.SecurityType=TrustedLaunch
for vm create and sig image-definition create.How to run with custom parameters.
Testing done
Done testing with a couple of possible variables.