Skip to content

Conversation

@weizhouapache
Copy link
Member

@weizhouapache weizhouapache commented Jun 5, 2025

Description

This PR fixes a regression of #9900

prior to this PR

2025-06-05 12:28:53,992 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-06-05 12:29:25,959 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Patch result of systemVM s-368-VM: /root
2025-06-05 12:29:25,961 WARN  [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Failed to get the latest script version
2025-06-05 12:29:25,962 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Seq 2-7450361158554357406:  { Ans: , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 14 05:22:13 PM UTC 2025","scriptsVersion":"5ebc6ded1a3880732363c1cdbbd54cfb

with this PR

2025-06-05 12:42:46,219 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Request:Seq 2-7450361158554357463:  { Cmd , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.PatchSystemVmCommand":{"forced":"true","accessDetails":{"router.ip":"169.254.151.188","router.name":"s-368-VM"},"wait":"0","bypassHostMaintenance":"false"}}] }
2025-06-05 12:42:46,220 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-06-05 12:43:18,083 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-2:[]) (logid:) Patch result of systemVM s-368-VM: /root
2025-06-05 12:43:18,083 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Seq 2-7450361158554357463:  { Ans: , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 14 05:22:13 PM UTC 2025","scriptsVersion":"5ebc6ded1a3880732363c1cdbbd54cfb","result":"true","details":"Successfully patched systemVM s-368-VM ","wait":"0","bypassHostMaintenance":"false"}}] }

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

…uter

This is a regression of apache#9900

prior to this PR
```
2025-06-05 12:28:53,992 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-06-05 12:29:25,959 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Patch result of systemVM s-368-VM: /root
2025-06-05 12:29:25,961 WARN  [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Failed to get the latest script version
2025-06-05 12:29:25,962 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Seq 2-7450361158554357406:  { Ans: , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 14 05:22:13 PM UTC 2025","scriptsVersion":"5ebc6ded1a3880732363c1cdbbd54cfb
```

with this PR
```
2025-06-05 12:42:46,219 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Request:Seq 2-7450361158554357463:  { Cmd , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.PatchSystemVmCommand":{"forced":"true","accessDetails":{"router.ip":"169.254.151.188","router.name":"s-368-VM"},"wait":"0","bypassHostMaintenance":"false"}}] }
2025-06-05 12:42:46,220 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-06-05 12:43:18,083 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-2:[]) (logid:) Patch result of systemVM s-368-VM: /root
2025-06-05 12:43:18,083 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Seq 2-7450361158554357463:  { Ans: , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 14 05:22:13 PM UTC 2025","scriptsVersion":"5ebc6ded1a3880732363c1cdbbd54cfb","result":"true","details":"Successfully patched systemVM s-368-VM ","wait":"0","bypassHostMaintenance":"false"}}] }
```
@codecov
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.17%. Comparing base (7044564) to head (c029196).
⚠️ Report is 29 commits behind head on 4.20.

Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #10962   +/-   ##
=========================================
  Coverage     16.17%   16.17%           
- Complexity    13293    13295    +2     
=========================================
  Files          5656     5656           
  Lines        498098   498098           
  Branches      60423    60423           
=========================================
+ Hits          80568    80571    +3     
+ Misses       408562   408560    -2     
+ Partials       8968     8967    -1     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.02% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland DaanHoogland added this to the 4.19.4 milestone Jun 9, 2025
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14068

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13708)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 48111 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10962-t13708-kvm-ol8.zip
Smoke tests completed. 133 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@sureshanaparti sureshanaparti requested a review from Copilot July 8, 2025 08:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a regression where patching system VMs or routers failed to retrieve the latest script version by refining the keystore import logic in the patch script.

  • Restricts global cacerts import to only consoleproxy and secstorage types
  • Suppresses keytool stderr output to reduce log noise

@weizhouapache weizhouapache marked this pull request as ready for review July 11, 2025 00:08
Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@weizhouapache weizhouapache modified the milestones: 4.19.4, 4.20.2 Sep 2, 2025
@weizhouapache weizhouapache changed the base branch from 4.19 to 4.20 September 10, 2025 09:10
@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14931

@weizhouapache
Copy link
Member Author

@kiranchavala
can you please test this PR when you have time ? thanks

@weizhouapache
Copy link
Member Author

moving to 4.20.3 due to inactivity

@weizhouapache weizhouapache modified the milestones: 4.20.2, 4.20.3 Sep 15, 2025
@weizhouapache weizhouapache added this to the 4.20.2 milestone Sep 18, 2025
@shwstppr
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested patch operation with and without script changes,

Before,

[root@ref-trl-5997-k-Mr9-abhishek-kumar-kvm1 ~]# tail -f /var/log/cloudstack/agent/agent.log | grep -i "patch"
2025-09-26 06:49:02,567 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Request:Seq 1-4092364686396374076:  { Cmd , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.PatchSystemVmCommand":{"forced":"true","accessDetails":{"router.ip":"169.254.50.99","router.name":"v-5-VM"},"wait":"0","bypassHostMaintenance":"false"}}] }
2025-09-26 06:49:02,568 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-09-26 06:49:31,951 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-2:[]) (logid:) Patch result of systemVM v-5-VM: /root
2025-09-26 06:49:31,953 WARN  [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-2:[]) (logid:) Failed to get the latest script version
2025-09-26 06:49:31,953 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Seq 1-4092364686396374076:  { Ans: , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 28 06:10:04 AM UTC 2025","scriptsVersion":"b4448303d00dcfb38ffb30b071fd3891
","result":"true","details":"Successfully patched systemVM v-5-VM ","wait":"0","bypassHostMaintenance":"false"}}] }

After making changes to the script on my existing env KVM host (patched CPVM, SSVM VR),
No errors/warnings seen

[root@ref-trl-5997-k-Mr9-abhishek-kumar-kvm1 ~]# tail -f /var/log/cloudstack/agent/agent.log | grep -i "patch"
2025-09-26 06:53:26,216 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Request:Seq 1-4092364686396374106:  { Cmd , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.PatchSystemVmCommand":{"forced":"true","accessDetails":{"router.ip":"169.254.50.99","router.name":"v-5-VM"},"wait":"0","bypassHostMaintenance":"false"}}] }
2025-09-26 06:53:26,216 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-09-26 06:53:56,683 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Patch result of systemVM v-5-VM: /root
2025-09-26 06:53:56,683 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Seq 1-4092364686396374106:  { Ans: , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 28 06:10:04 AM UTC 2025","scriptsVersion":"b4448303d00dcfb38ffb30b071fd3891","result":"true","details":"Successfully patched systemVM v-5-VM ","wait":"0","bypassHostMaintenance":"false"}}] }
2025-09-26 06:55:07,444 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-5:[]) (logid:) Request:Seq 1-4092364686396374116:  { Cmd , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.PatchSystemVmCommand":{"forced":"true","accessDetails":{"router.ip":"169.254.233.55","router.name":"s-1-VM"},"wait":"0","bypassHostMaintenance":"false"}}] }
2025-09-26 06:55:07,444 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-5:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-09-26 06:56:06,441 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-5:[]) (logid:) Patch result of systemVM s-1-VM: /root
2025-09-26 06:56:06,442 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-5:[]) (logid:) Seq 1-4092364686396374116:  { Ans: , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 28 06:10:04 AM UTC 2025","scriptsVersion":"b4448303d00dcfb38ffb30b071fd3891","result":"true","details":"Successfully patched systemVM s-1-VM ","wait":"0","bypassHostMaintenance":"false"}}] }
2025-09-26 06:56:50,668 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Request:Seq 1-4092364686396374121:  { Cmd , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.PatchSystemVmCommand":{"forced":"true","accessDetails":{"router.ip":"169.254.255.19","router.name":"r-4-VM"},"wait":"0","bypassHostMaintenance":"false"}}] }
2025-09-26 06:56:50,668 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-09-26 06:57:17,328 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Patch result of systemVM r-4-VM: version:b4448303d00dcfb38ffb30b071fd3891 
2025-09-26 06:57:17,329 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Seq 1-4092364686396374121:  { Ans: , MgmtId: 32988435843878, via: 1, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 28 06:10:04 AM UTC 2025","scriptsVersion":"b4448303d00dcfb38ffb30b071fd3891","result":"true","details":"Successfully patched systemVM r-4-VM ","wait":"0","bypassHostMaintenance":"false"}}] }

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15178

@weizhouapache
Copy link
Member Author

thanks @shwstppr !

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14444)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 54181 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10962-t14444-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@weizhouapache weizhouapache merged commit 5dfeb79 into apache:4.20 Sep 26, 2025
26 checks passed
@DaanHoogland DaanHoogland deleted the 4.19-systemvm-failed-to-get-script-version branch September 29, 2025 10:58
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 2025
…uter (apache#10962)

This is a regression of apache#9900

prior to this PR
```
2025-06-05 12:28:53,992 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-06-05 12:29:25,959 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Patch result of systemVM s-368-VM: /root
2025-06-05 12:29:25,961 WARN  [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-1:[]) (logid:) Failed to get the latest script version
2025-06-05 12:29:25,962 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-1:[]) (logid:) Seq 2-7450361158554357406:  { Ans: , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 14 05:22:13 PM UTC 2025","scriptsVersion":"5ebc6ded1a3880732363c1cdbbd54cfb
```

with this PR
```
2025-06-05 12:42:46,219 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Request:Seq 2-7450361158554357463:  { Cmd , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 100011, [{"com.cloud.agent.api.PatchSystemVmCommand":{"forced":"true","accessDetails":{"router.ip":"169.254.151.188","router.name":"s-368-VM"},"wait":"0","bypassHostMaintenance":"false"}}] }
2025-06-05 12:42:46,220 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Processing command: com.cloud.agent.api.PatchSystemVmCommand
2025-06-05 12:43:18,083 DEBUG [resource.wrapper.LibvirtPatchSystemVmCommandWrapper] (AgentRequest-Handler-2:[]) (logid:) Patch result of systemVM s-368-VM: /root
2025-06-05 12:43:18,083 DEBUG [cloud.agent.Agent] (AgentRequest-Handler-2:[]) (logid:) Seq 2-7450361158554357463:  { Ans: , MgmtId: 32986204472275, via: 2, Ver: v1, Flags: 10, [{"com.cloud.agent.api.PatchSystemVmAnswer":{"templateVersion":"Cloudstack Release 4.20.1 Wed May 14 05:22:13 PM UTC 2025","scriptsVersion":"5ebc6ded1a3880732363c1cdbbd54cfb","result":"true","details":"Successfully patched systemVM s-368-VM ","wait":"0","bypassHostMaintenance":"false"}}] }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants