Closed torarnv closed 7 months ago
A quick survey of Linux Packer templates on the Web seems to indicate that the common approach is to let the VM reboot after installation so that the SSH provisioning can continue, so this change should not be too surprising, but may require a major version bump just in case.
We should probably pin https://github.com/cirruslabs/linux-image-templates/blob/main/cloud-init.pkr.hcl#L5 for now to 1.10.0
so that whatever we do it doesn't break Cirrus CI
Side note, this doesn't seem to apply to Ubuntu 22.04.04:
tart-cli.tart: FAILED: /dev/vda: does not exist
Seems this PR includes all your other PRs. Could you please rebase so the change is scope to Linux creation.
Seems this PR includes all your other PRs. Could you please rebase so the change is scope to Linux creation.
Should be good now. GitHub can be annoying sometimes when working with several PRs in parallel 😔
The code for Linux installation was maintained separately in stepCreateVM, even though it shared most of the logic with the macOS installation flow of stepRun.
We now use the same flow for Linux and macOS installation:
boot_command
does automated installation of the OSTo achieve this flow for Linux, the autoinstall cloud config in the Ubuntu example had to be changed to from "poweroff" to "reboot", so that the VM was rebooted into a level where SSH is available. This is the default value for the autoinstall shutdown key, and the only reason we needed to override it previously was because we did the installation (via boot_command) as part of stepCreateVM.
The SSH timeout in the example also had to be increased, as we now wait for the installation to be completed, just like we for macOS.
Fixes #127