Skip to content

CSTACKEX-306: support for create CS colume from CS snapshot on the lo… - #107

Open
rajiv-jain-netapp wants to merge 1 commit into
mainfrom
feature/CSTACKEX-306
Open

rajiv-jain-netapp wants to merge 1 commit into
mainfrom
feature/CSTACKEX-306

Conversation

@rajiv-jain-netapp

@rajiv-jain-netapp rajiv-jain-netapp commented Sep 18, 2026

Copy link
Copy Markdown
  1. CS volume can be created from CS-volume snapshot only, it will not be supported with VM level snapshot
  2. type of CS volume would be data for both Root and Data CS volume-snapshot.
  3. Cloudstack will not create bootable root type of volume with this usecase support. User is recommended to to use create template from the root volume and take it forward to create new bootable root volumes.
  4. create CS volume would be residing on the same primary storage pool. cloudstack does not provide any option to user to choose the destination storage-pool.

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?

@github-actions

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 24.77%
Branch coverage 18.90%

Grade Scale

Grade Line Coverage Meaning
🟢 A ≥ 80% Excellent - this code sleeps well at night 😴
🟡 B 60-79% Good - almost there, don't stop now 😉
🟠 C 40-59% Acceptable - your code is wearing a seatbelt, but no airbags 😬
🔴 D 20-39% Marginal - boldly shipping where no test has gone before 🖖
⛔ F < 20% Failing - tests? what tests? 🔥

Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run

@rajiv-jain-netapp rajiv-jain-netapp self-assigned this Sep 18, 2026
CloudStackVolume clonedCloudStackVolume = cloneOfTemplateId != null
? cloneCloudStackVolumeFromTemplate(storagePool, volInfo, details, cloneOfTemplateId)
: createCloudStackVolume(storagePool, volInfo, details);
/*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better have a README.md in driver also if such detailed comments are needed?

* @return created CloudStackVolume with protocol-specific identity (LUN uuid or file path)
*/
abstract public CloudStackVolume cloneCloudStackVolumeFromSnapshot(StoragePoolVO storagePool,
Map<String, String> details,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, do mention that its poolDetails, else it could be interpreted as volumeDetails

* for the duration of {@code createAsync} only (same pattern as {@link #getTemplateIdForCloning}).</p>
*/
private Long getSnapshotIdForCloning(long volumeId) {
VolumeDetailVO detail = volumeDetailsDao.findDetail(volumeId, OntapStorageConstants.CLONE_OF_SNAPSHOT);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does cloudstack save this detail OntapStorageConstants.CLONE_OF_SNAPSHOT in volume details?

sourcePath, destinationPath, snapshotName, flexVolName);
try {
FileCloneRequest request = new FileCloneRequest(flexVolUuid, flexVolName, sourcePath, destinationPath, snapshotName);
JobResponse jobResponse = nasFeignClient.cloneFile(getAuthHeader(), request);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Till the new adapter for nfs is brought in, we wanted to continue using kvm commands only right?

// onto this CloudStack volume (and ONTAP QoS if applicable) after successful clone.
} else {
Long cloneOfTemplateId = getTemplateIdForCloning(volInfo.getId());
clonedCloudStackVolume = cloneOfTemplateId != null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead would it be possible to have checks based on dataObject.getType()?
Like dataObject.getType() == DataObjectType.TEMPLATE or dataObject.getType() == DataObjectType.VOLUME, etc.,

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants