Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vms/vm-under-test: Move first boot to a separate service
The first-boot script running by the virt-builder command is run on a service created by virt-builder. This service is guaranteed to run in the final stages of the boot process [0]. This may create a race with the checkup, that is waiting on the agentConnected condition [1] being added in order to run the checkup's executor package. The race is happening since the guest-agent service also runs during the final stages of the boot process. In order to eliminate this race, removing the first-boot script in favor of the new service, and moving the first boot script content into a new service. This service is - manually created on the customize-vm script. - explicitly scheduled to run before the guest-agent service runs. - set to run once, using ConditionPathExists unit option [2]. Before the script reboots it creates an empty file, so that the service will not run again. Since the service runs and then reboots the log is not present on journalctl, so it is manually saved to a log file on the guest. [0] https://www.libguestfs.org/virt-builder.1.html [1] https://github.com/kiagnose/kubevirt-realtime-checkup/blob/97b5fbe47fc5df6513671db6a40e8e31b0815580/pkg/internal/checkup/checkup.go#L144 [2] https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#ConditionPathExists= Signed-off-by: Ram Lavi <[email protected]>
- Loading branch information