Skip to content

Add support to update secondary and primary storage URLs#13193

Draft
Pearl1594 wants to merge 2 commits into
mainfrom
support-update-pri-sec-stg-url
Draft

Add support to update secondary and primary storage URLs#13193
Pearl1594 wants to merge 2 commits into
mainfrom
support-update-pri-sec-stg-url

Conversation

@Pearl1594
Copy link
Copy Markdown
Contributor

@Pearl1594 Pearl1594 commented May 19, 2026

Description

This PR fixes: #11742

Adds support to update the URL of primary and secondary stores. However, the support is limited to API and not extended to the UI as this is an operation that if performed without caution can lead to issues - data loss.

Secondary store:
The store needs to be in read-only mode before attempting to change the url.
Secondary storage VM needs to be recreated to remount the new store

Primary store:
The primary store needs to be in Maintenance mode to proceed with updating the URL
The update of URL was previously purely cosmetic / informational ie updated in the database - details table. This continues to be true for storage pools other than nfs and gluster
For NFS and Gluster, if the URL is changed, it propagates it to the connected hosts and attempts to remove the old store and add the new one
In case , no hosts are found, it only changes the URL in the DB and this would require a MS restart to propagate to the host.

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?

@Pearl1594
Copy link
Copy Markdown
Contributor Author

Pearl1594 commented May 19, 2026

@DaanHoogland do you think we need to expose updating this via UI or leave this as a API only field? I feel it could be a bit of a dangerous operation should it be used incorrectly.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 18.29268% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.09%. Comparing base (522283b) to head (eaffcd7).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ain/java/com/cloud/storage/StorageManagerImpl.java 0.00% 55 Missing ⚠️
.../hypervisor/kvm/storage/LibvirtStorageAdaptor.java 65.21% 3 Missing and 5 partials ⚠️
...api/command/admin/storage/UpdateImageStoreCmd.java 0.00% 3 Missing ⚠️
...src/main/java/com/cloud/server/StatsCollector.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13193      +/-   ##
============================================
+ Coverage     18.08%   18.09%   +0.01%     
- Complexity    16718    16742      +24     
============================================
  Files          6037     6037              
  Lines        542580   542818     +238     
  Branches      66427    66500      +73     
============================================
+ Hits          98136    98241     +105     
- Misses       433417   433547     +130     
- Partials      11027    11030       +3     
Flag Coverage Δ
uitests 3.51% <ø> (ø)
unittests 19.26% <18.29%> (+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
Copy link
Copy Markdown
Contributor

@DaanHoogland do you think we need to expose updating this via UI or leave this as a API only field? I feel it could be a bit of a dangerous operation should it be used incorrectly.

I agree, let limit to API

Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
19.0% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

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.

Add the ability to change storage server IP addresses with the API and in the UI

3 participants