-
Notifications
You must be signed in to change notification settings - Fork 2
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
Move first boot to new service #215
Move first boot to new service #215
Conversation
Moving the snippet disabling the services to a function. Signed-off-by: Ram Lavi <[email protected]>
Moving the snippet setting hugepages to a function. Signed-off-by: Ram Lavi <[email protected]>
d274be6
to
3357895
Compare
passes e2e on CNV 4.15 cluster:
logs show the correct linux cmdline for both VMs:
|
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.
Thank you
vms/traffic-gen/scripts/customize-vm
Outdated
TREX_URL=https://trex-tgn.cisco.com/trex/release | ||
TREX_VERSION=v3.03 | ||
TREX_ARCHIVE_NAME=${TREX_VERSION}.tar.gz | ||
TREX_DIR=/opt/trex |
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.
These variables are considered global, since they are not prefixed with local
.
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.
fixed
Moving trex setup to a function Signed-off-by: Ram Lavi <[email protected]>
Moving setting nsafe_no_io_mmu_mode to a function. Signed-off-by: Ram Lavi <[email protected]>
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. - running the content of the former first-boot script. - running the tuned-adm command formerly set on the customize-vm script. The reason is that this command needs to run on a running guest. Moreover, since this command needs to only run on the first boot of the image, the script is checking the existence of a marker file, then only creating the file after the first run of the snippet. [0] https://www.libguestfs.org/virt-builder.1.html [1] https://github.com/kiagnose/kubevirt-dpdk-checkup/blob/b9b6a472fe92583a0db46361289239e0e8d06284/pkg/internal/checkup/checkup.go#L237 [2] https://www.freedesktop.org/software/systemd/man/latest systemd.unit.html#ConditionPathExists= Signed-off-by: Ram Lavi <[email protected]>
Signed-off-by: Ram Lavi <[email protected]>
Moving the snippet disabling the services to a function. Signed-off-by: Ram Lavi <[email protected]>
Moving the snippet setting hugepages to a function. Signed-off-by: Ram Lavi <[email protected]>
Moving setting nsafe_no_io_mmu_mode to a function. Signed-off-by: Ram Lavi <[email protected]>
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. - running the content of the former first-boot script. - running the tuned-adm command formerly set on the customize-vm script. The reason is that this command needs to run on a running guest. Moreover, since this command needs to only run on the first boot of the image, the script is checking the existence of a marker file, then only creating the file after the first run of the snippet. [0] https://www.libguestfs.org/virt-builder.1.html [1] https://github.com/kiagnose/kubevirt-dpdk-checkup/blob/b9b6a472fe92583a0db46361289239e0e8d06284/pkg/internal/checkup/checkup.go#L237 [2] https://www.freedesktop.org/software/systemd/man/latest systemd.unit.html#ConditionPathExists= Signed-off-by: Ram Lavi <[email protected]>
It makes sense to log the guest's kernel args of both VMIs for debugging purposes. Signed-off-by: Ram Lavi <[email protected]>
3357895
to
a7fbd81
Compare
Change: Review fixes |
passed e2e with CNV 4.15 cluster:
kernel Args are correctly updated in the log:
|
When creating the vm-under-test and traffic-gen container-disk images, 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 behavior 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.
This PR is solving this race by moving the content of the first-boot script of both VMs to a new service that is guaranteed to run before the guest-agent service.
Fixes #210
[0] https://www.libguestfs.org/virt-builder.1.html
[1]
kubevirt-dpdk-checkup/pkg/internal/checkup/checkup.go
Line 237 in b9b6a47