-
Notifications
You must be signed in to change notification settings - Fork 1.4k
CKS: Fix node stuck in Starting due to missing qemu-guest-agent #13715
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -59,16 +59,38 @@ send_file() { | |||
| virsh qemu-agent-command $name "{\"execute\":\"guest-file-close\", \"arguments\":{\"handle\":$fd}}" > /dev/null | ||||
| } | ||||
|
|
||||
| # Wait for the guest agent to come online | ||||
| # Wait for the guest agent to come online (max 120s to avoid indefinite hang) | ||||
| # FIX: Added timeout + clear error message (GitHub Issue #13471) | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think we don’t need fix comments when code is fixed. |
||||
| GUEST_AGENT_WAIT_TICK=0 | ||||
| GUEST_AGENT_MAX_TICKS=1200 # 120s = 1200 x 0.1s | ||||
| while ! virsh qemu-agent-command $name '{"execute":"guest-ping"}' >/dev/null 2>&1 | ||||
| do | ||||
| sleep 0.1 | ||||
| GUEST_AGENT_WAIT_TICK=$((GUEST_AGENT_WAIT_TICK + 1)) | ||||
| if [ $((GUEST_AGENT_WAIT_TICK % 100)) -eq 0 ]; then | ||||
| echo "Waiting for qemu-guest-agent to respond... (${GUEST_AGENT_WAIT_TICK}/1200 ticks, ~$((GUEST_AGENT_WAIT_TICK / 10))s elapsed)" | ||||
| fi | ||||
| if [ $GUEST_AGENT_WAIT_TICK -ge $GUEST_AGENT_MAX_TICKS ]; then | ||||
| echo "ERROR: qemu-guest-agent not responding after 120 seconds." | ||||
|
Comment on lines
+70
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one makes sense to me @goal86sg . Would you apply? |
||||
| echo "The VM template is missing 'qemu-guest-agent' or the service is not running." | ||||
| echo "Required packages: cloud-init, qemu-guest-agent, cloud-guest-utils, conntrack, containerd.io" | ||||
| echo "See: https://docs.cloudstack.apache.org/en/latest/kubernetes/kubernetes-cluster-requirements.html" | ||||
| exit 1 | ||||
| fi | ||||
| done | ||||
| echo "qemu-guest-agent is responsive." | ||||
|
|
||||
| # Test guest agent sanity | ||||
| while [ "$(virsh qemu-agent-command $name '{"execute":"guest-sync","arguments":{"id":1234567890}}' 2>/dev/null)" != '{"return":1234567890}' ] | ||||
| do | ||||
| # Test guest agent sanity (bounded to 30s) | ||||
| # FIX: Added timeout (GitHub Issue #13471) | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. worth removing this comment as well.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| GUEST_SYNC_TICK=0 | ||||
| GUEST_SYNC_MAX_TICKS=300 # 30s | ||||
| while [ "$(virsh qemu-agent-command $name '{"execute":"guest-sync","arguments":{"id":1234567890}}' 2>/dev/null)" != '{"return":1234567890}' ]; do | ||||
| sleep 0.1 | ||||
| GUEST_SYNC_TICK=$((GUEST_SYNC_TICK + 1)) | ||||
| if [ $GUEST_SYNC_TICK -ge $GUEST_SYNC_MAX_TICKS ]; then | ||||
| echo "ERROR: qemu-guest-agent sanity check (guest-sync) failed after 30 seconds." | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one as well? |
||||
| exit 1 | ||||
| fi | ||||
| done | ||||
|
|
||||
| # Write cmdline payload | ||||
|
|
||||
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 don’t think we need this comment here
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.