-
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
Add guest agent ping wait #63
Conversation
Currently the VM guests are configured on a service added on the customize-vm script created in the image building process. There is no real need for the script to run on that context, and it is easier to manage if it runs as part of the cloud-init context. This commits: - copies the script to a checkup function. - adds the boot script to the vmi-under-test VM - mounts the script with the correct permissions. Signed-off-by: Ram Lavi <[email protected]>
Currently the VM guests are configured on a service added on the customize-vm script created in the image building process. There is no real need for the script to run on that context, and it is easier to manage if it runs as part of the cloud-init context. This commits: - Runs the boot script on the cloud-init context. - Removes it from the images customize-vm scripts. Signed-off-by: Ram Lavi <[email protected]>
passes CI on CNV 4.16 cluster:
logs:
|
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.
Overall looks good
@@ -288,6 +288,7 @@ func generateBootScript() string { | |||
sb.WriteString(" tuned_conf=\"/etc/tuned/realtime-virtual-guest-variables.conf\"\n") | |||
sb.WriteString(" echo \"isolated_cores=" + isolatedCores + "\" > \"$tuned_conf\"\n") | |||
sb.WriteString(" echo \"isolate_managed_irq=Y\" >> \"$tuned_conf\"\n") | |||
sb.WriteString(" systemctl restart tuned.service\n") |
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.
What is the difference between the real-time and DPDK checkup with regard to this change?
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.
service agter setting the
Typo?
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.
What is the difference between the real-time and DPDK checkup with regard to this change?
This change should probably be done on DPDK as well. We didn't see the problem there but it may be only due to timing consideration..
Typo?
Fixed typo.
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.
If this command is async, we should wait for it to finish.
FailureThreshold: 30, | ||
InitialDelaySeconds: 90, | ||
PeriodSeconds: 10, | ||
TimeoutSeconds: 10, |
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.
Are these values the same as in the DPDK checkup?
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.
yep.
Saw no reason to change them
sometimes tuned service is not up by the time tuned-adm is run. In order to make sure it's running with the correct conf file, restarting the service after setting the conf and before running tuned-adm Signed-off-by: Ram Lavi <[email protected]>
This commit enables the guest-agent-exec option on the guest, in order to use the probe polling option, that will be introduced in future commits. Signed-off-by: Ram Lavi <[email protected]>
When the boot script is done, after tuned-adm is set and reboot - the BootScriptReadinessMarkerFileFullPath file marker is set. In order to be polled [0] by guest-agent ping in later commits, adding the proper selinux context to this file. [0] https://kubevirt.io/user-guide/virtual_machines/liveness_and_readiness_probes/#defining-guest-agent-ping-probes Signed-off-by: Ram Lavi <[email protected]>
urrently the checkup setup only waits for the VMI to finish "booting", i.e. the guest agent service to be ready. However this is not enough in order to ensure that the VMI has been configured, a procedure currently done on the cloud-init service. When the configuration is complete, the script configuring the guest in the cloud-init service adds a marker file. Changing the wait condition to "ready" is stronger than waiting for "guest-agent", since the guest-agent ping needs guest agent in order to set the VMI to ready. This commit: - introduces a new waiting mechanism, using guest-agent-ping probe [0] to poll-wait the guest until the file is present, and only then sets the VMI ready condition to true. - adds a wait for the VMI ready condition to be true. - removed the now unnecessary wait for guest-agent-ready condition. [0] https://kubevirt.io/user-guide/virtual_machines/liveness_and_readiness_probes/#defining-guest-agent-ping-probes Signed-off-by: Ram Lavi <[email protected]>
8bf7ae1
to
e84137f
Compare
Change: Typo in commit message |
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 @RamLavi
@@ -288,6 +288,7 @@ func generateBootScript() string { | |||
sb.WriteString(" tuned_conf=\"/etc/tuned/realtime-virtual-guest-variables.conf\"\n") | |||
sb.WriteString(" echo \"isolated_cores=" + isolatedCores + "\" > \"$tuned_conf\"\n") | |||
sb.WriteString(" echo \"isolate_managed_irq=Y\" >> \"$tuned_conf\"\n") | |||
sb.WriteString(" systemctl restart tuned.service\n") |
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.
If this command is async, we should wait for it to finish.
@orelmisan I believe that
|
This PR introduces a new algorithm to make sure that the checkups start only after the VMI properly configured for realtime.
Instead of waiting for the VMI guest-agent condition to be true, introducing a guest-agent-ping probe that will poll for the marker file signaling that the VMI is ready.
The boot script is moved to cloud-init context for easier maintenance.