Thanks to visit codestin.com
Credit goes to github.com

Skip to content

xenserver: destroy halted vm on expunge #10833

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

Open
wants to merge 3 commits into
base: 4.19
Choose a base branch
from

Conversation

shwstppr
Copy link
Contributor

@shwstppr shwstppr commented May 8, 2025

Description

Addresses #9175 (comment)

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?

Tested on XCP-ng 8.2

Deploy a VM

(localcloud) 🐱 > list virtualmachines id=3325d71e-d808-451e-abbe-b923226ebc33 filter=id,name,state,instancename,
{
  "count": 1,
  "virtualmachine": [
    {
      "id": "3325d71e-d808-451e-abbe-b923226ebc33",
      "instancename": "i-2-5-VM",
      "name": "VM-3325d71e-d808-451e-abbe-b923226ebc33",
      "state": "Running"
    }
  ]
}

Check on XCP-ng host that VM is showing as running

[14:54 pr10833-t13246-xcpng82-xs1 ~]# xe vm-list name-label=i-2-5-VM
uuid ( RO)           : 318c6cd0-fae7-c095-706e-ec840b2a0787
     name-label ( RW): i-2-5-VM
    power-state ( RO): running


Destroy VM with expunge from ACS

(localcloud) 🐱 > destroy virtualmachine expunge=true id=3325d71e-d808-451e-abbe-b923226ebc33 
{
  "null": {
    "affinitygroup": [],
    "nic": [],
    "securitygroup": [],
    "tags": []
  }
}

On XCP-ng check VM is not present in HALTED state,

[14:57 pr10833-t13246-xcpng82-xs1 ~]# xe vm-list |grep 'power-state ( RO): halted' |wc -l
0

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

@shwstppr
Copy link
Contributor Author

shwstppr commented May 8, 2025

@Pearl1594 kindly check. Close this PR and pick changes if needed

@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

codecov bot commented May 8, 2025

Codecov Report

Attention: Patch coverage is 4.65116% with 41 lines in your changes missing coverage. Please review.

Project coverage is 15.17%. Comparing base (f0838cd) to head (93686c7).
Report is 4 commits behind head on 4.19.

Files with missing lines Patch % Lines
...wrapper/xenbase/CitrixCleanupVMCommandWrapper.java 5.40% 35 Missing ⚠️
.../main/java/com/cloud/hypervisor/XenServerGuru.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10833      +/-   ##
============================================
- Coverage     15.17%   15.17%   -0.01%     
- Complexity    11339    11341       +2     
============================================
  Files          5414     5415       +1     
  Lines        475185   475321     +136     
  Branches      57991    58003      +12     
============================================
+ Hits          72105    72123      +18     
- Misses       395018   395132     +114     
- Partials       8062     8066       +4     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.89% <4.65%> (-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.

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member

@blueorangutan test ol8 xcpng82

@blueorangutan
Copy link

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

…or/xenserver/resource/wrapper/xenbase/CitrixCleanupVMCommandWrapper.java
@shwstppr
Copy link
Contributor Author

shwstppr commented May 9, 2025

@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.

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member

it looks like some vms are not cleaned

[07:28 pr10833-t13241-xcpng82-xs1 ~]# xe vm-list |grep 'power-state ( RO): halted' |wc -l
289

Signed-off-by: Abhishek Kumar <[email protected]>
@weizhouapache
Copy link
Member

@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.

@shwstppr shwstppr marked this pull request as ready for review May 9, 2025 15:00
@shwstppr
Copy link
Contributor Author

shwstppr commented May 9, 2025

@weizhouapache should be okay now. I used wrong condition by mistake. Added test result in the description.

@blueorangutan
Copy link

[SF] Trillian test result (tid-13241)
Environment: xcpng82 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 74225 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10833-t13241-xcpng82.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

@weizhouapache
Copy link
Member

@weizhouapache should be okay now. I used wrong condition by mistake. Added test result in the description.

great, thanks @shwstppr for the fixing
I will kick a trillian test when packages are ready, and verify during the test

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member

@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 13320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants