Skip to content

Fix local storage deletion cases #10231

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

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

harikrishna-patnala
Copy link
Contributor

@harikrishna-patnala harikrishna-patnala commented Jan 22, 2025

Description

This PR addresses the issues raised in #9820

Case 0: Documentation admin should not remove the local.storage.uuid. Addressed here apache/cloudstack-documentation#473
Case 1: Delete local storage pool entry even if local storage addition fails.
Case 2: Delete local.storage.uuid and path entries in agent.properties when local storage is deleted from management server. If not deleted then on every agent restart it will be added again in the management server.

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)

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

Case 0: Doc PR apache/cloudstack-documentation#473

Case 1:

  1. Create local storage with invalid path.
  2. Local storage addition fails.
  3. Previously there is an active local storage entry even it failed to add, now there won't be any entry.

Case 2:

  1. Add multiple local storages as in steps mentioned here https://docs.cloudstack.apache.org/en/4.19.0.0/adminguide/storage.html#manually-adding-local-storage-pool
  2. Delete one local storage from management server
  3. Previously that local storage entry existed in agent.properties and on restart of the agent the same local storage gets added again. Now the entry is deleted in agent.properties and on restart of agent did not added the local storage again.

@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@harikrishna-patnala 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 Jan 22, 2025

Codecov Report

Attention: Patch coverage is 19.04762% with 34 lines in your changes missing coverage. Please review.

Project coverage is 15.13%. Comparing base (91f1ada) to head (dcea74e).
Report is 5 commits behind head on 4.19.

Files with missing lines Patch % Lines
...rapper/LibvirtDeleteStoragePoolCommandWrapper.java 25.00% 22 Missing and 2 partials ⚠️
...ain/java/com/cloud/storage/StorageManagerImpl.java 0.00% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10231      +/-   ##
============================================
- Coverage     15.13%   15.13%   -0.01%     
- Complexity    11279    11281       +2     
============================================
  Files          5408     5408              
  Lines        474007   474043      +36     
  Branches      57822    57829       +7     
============================================
+ Hits          71745    71750       +5     
- Misses       394241   394269      +28     
- Partials       8021     8024       +3     
Flag Coverage Δ
uitests 4.30% <ø> (ø)
unittests 15.85% <19.04%> (-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.

@blueorangutan
Copy link

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

Copy link
Contributor

@kiranchavala kiranchavala 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 the issues manually and its working fine

Case 1: Delete local storage pool entry even if local storage addition fails.

Case 2: Delete local.storage.uuid and path entries in agent.properties when local storage is deleted from management server. If not deleted then on every agent restart it will be added again in the management server.

@kiranchavala
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@harikrishna-patnala 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 12168

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

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@DaanHoogland DaanHoogland added this to the 4.19.2 milestone Jan 22, 2025
@blueorangutan
Copy link

@DaanHoogland 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-12162)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 49699 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10231-t12162-kvm-ol8.zip
Smoke tests completed. 131 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_secure_vm_migration Error 276.19 test_vm_life_cycle.py
test_02_VPC_default_routes Failure 202.83 test_vpc_router_nics.py

@pavanaravapalli
Copy link
Contributor

Code LGTM

@blueorangutan
Copy link

[SF] Trillian test result (tid-12166)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 51044 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10231-t12166-kvm-ol8.zip
Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py

@harikrishna-patnala harikrishna-patnala merged commit 2075918 into apache:4.19 Jan 23, 2025
25 of 26 checks passed
@harikrishna-patnala harikrishna-patnala deleted the FixLocalStorageDeletion branch January 23, 2025 07:16
rg9975 pushed a commit to rg9975/cloudstack that referenced this pull request Jan 31, 2025
* Delete local storage properties in agent.properties during delete pool

* Fix stale entry when add local storage failed

* Smaller methods

* Comment added
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
* Delete local storage properties in agent.properties during delete pool

* Fix stale entry when add local storage failed

* Smaller methods

* Comment added
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.

Default local storage /var/lib/libvirt/images is getting added everytime cloudstack-agent is restarted
5 participants