Skip to content

Create volume on a specified storage pool#12966

Open
abh1sar wants to merge 2 commits intoapache:4.22from
shapeblue:create-vol-on-stroage
Open

Create volume on a specified storage pool#12966
abh1sar wants to merge 2 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):

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 (59b6c32) to head (3dbfbf7).
⚠️ Report is 3 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    15676    15671       -5     
============================================
  Files          5918     5918              
  Lines        531667   531710      +43     
  Branches      65001    65011      +10     
============================================
- Hits          93617    93594      -23     
- Misses       427491   427557      +66     
  Partials      10559    10559              
Flag Coverage Δ
uitests 3.70% <ø> (ø)
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

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

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants