Skip to content

Create volume on a specified storage pool#12966

Merged
DaanHoogland merged 4 commits intoapache:4.22from
shapeblue:create-vol-on-stroage
Apr 10, 2026
Merged

Create volume on a specified storage pool#12966
DaanHoogland merged 4 commits intoapache:4.22from
shapeblue:create-vol-on-stroage

Conversation

@abh1sar
Copy link
Copy Markdown
Contributor

@abh1sar abh1sar commented Apr 6, 2026

Description

This PR adds support for creating volume on the specified storage pool in the Ready state.
This can be done without attaching the volume to any instance. This can be helpful with vmware2kvm scenarios.

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):

Screenshot 2026-04-10 at 6 59 41 AM Screenshot 2026-04-10 at 6 58 51 AM

How Has This Been Tested?

Created volume using the storageid parameter on an NFS storage pool.
Verified that volume was in Ready state with a qcow2 file created with the specified virtual size.

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

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 0% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.60%. Comparing base (b1bc538) to head (7afb82f).
⚠️ Report is 11 commits behind head on 4.22.

Files with missing lines Patch % Lines
...n/java/com/cloud/storage/VolumeApiServiceImpl.java 0.00% 24 Missing ⚠️
...stack/api/command/user/volume/CreateVolumeCmd.java 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12966      +/-   ##
============================================
- Coverage     17.60%   17.60%   -0.01%     
+ Complexity    15678    15677       -1     
============================================
  Files          5918     5918              
  Lines        531758   531807      +49     
  Branches      65024    65036      +12     
============================================
- Hits          93637    93636       -1     
- Misses       427555   427605      +50     
  Partials      10566    10566              
Flag Coverage Δ
uitests 3.70% <ø> (-0.01%) ⬇️
unittests 18.67% <0.00%> (-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.

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

@abh1sar abh1sar changed the base branch from main to 4.22 April 6, 2026 12:56
@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Apr 7, 2026

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@abh1sar 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
Copy Markdown

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

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.

Pull request overview

This PR enhances CloudStack’s createVolume API to support creating a data volume directly on a specified primary storage pool (so it can reach Ready state without attaching to a VM), aimed at workflows like vmware2kvm migrations.

Changes:

  • Adds a new storageid parameter to createVolume.
  • Implements a new code path in VolumeApiServiceImpl.createVolume to create the volume on the requested primary storage pool via volService.createVolumeAsync.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java Adds a storageid branch that triggers backend volume creation on a specified primary store.
api/src/main/java/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java Introduces the storageid API parameter and a getter intended to enforce snapshot/storage mutual exclusivity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Apr 7, 2026

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@abh1sar 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
Copy Markdown

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

@abh1sar abh1sar requested a review from sureshanaparti April 8, 2026 09:39
@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Apr 8, 2026

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

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

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_01_redundant_vpc_site2site_vpn Failure 398.05 test_vpc_vpn.py
test_01_vpc_site2site_vpn Failure 261.80 test_vpc_vpn.py

Copy link
Copy Markdown
Member

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

@abh1sar

Can you add storageid in the UI also when create volume is called. It will be useful to the admin users

Image

@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Apr 10, 2026

@blueorangutan package

@abh1sar
Copy link
Copy Markdown
Contributor Author

abh1sar commented Apr 10, 2026

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@abh1sar a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12966 (QA-JID-905)

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti 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
Copy Markdown

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

Copy link
Copy Markdown
Member

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

Tested the creation of volume on particular storage pool by a rootadmin user on local,nfs, and PowerFlex storage type.

Volumes got created respectivitel storage

Was able to attach the created volume to an instance

Image

@kiranchavala
Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-15853)

@DaanHoogland
Copy link
Copy Markdown
Contributor

@GaOrtiga , are you fine with the changes now?

@DaanHoogland DaanHoogland merged commit df7ff97 into apache:4.22 Apr 10, 2026
24 of 26 checks passed
@DaanHoogland DaanHoogland deleted the create-vol-on-stroage branch April 10, 2026 12:27
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.1 Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants