CloudStack Volume support with ONTAP storage#13053
Conversation
… added EOF fixes + correcting license header
Initial primary storage pool plugin skeleton
…POJOs" This reverts commit fe0f752.
…POJOs" This reverts commit 28faca1.
Feignconfiguration and volume feignClient along with desired POJOs with cstack 28
* CSTACKEX-29 Cluster, SVM and Aggr Feign Client * CSTACKEX-29 Change the endpoint method name in feign client * CSTACKEX-29 Make the alignment proper * CSTACKEX-29 Added License Info * CSTACKEX-29 Resolve Review Comments * CSTACKEX-29 Remove Component Annotation from datastoredriverclass * CSTACKEX-29 Resolve Style check issues * CSTACKEX-29 Resolve ALL Style issues * CSTACKEX-29 Resolve Precommits Issues * CSTACKEX-29 Added Method comments and change the ontap response class name --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-31 NAS and Job Feign Client and POJOs * CSTACKEX-31 Fixed Checks Issues * CSTACKEX-31 Resolve Review Comments * CSTACKEX-31 Resolve Review Comments * CSTACKEX-31 Resolve Review Comments * CSTACKEX-31 Added Aggr and size to volume model * CSTACKEX-31 Change the export policy endpoint path * CSTACKEX-31 Fixed check styles --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-30 SAN Feign Client * CSTACKEX-30 Fixed check style issues * CSTACKEX-30 Fixed review comments --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-7: ONTAP Primary storage pool --------- Co-authored-by: Locharla, Sandeep <Sandeep.Locharla@netapp.com>
CSTACKEX-34: Upgrade to framework classes design
* CSTACKEX-35 Create Async * CSTACKEX-35 Added Null and empty check * CSTACKEX-35 Resolved review comments * CSTACKEX-35 Removed Type Casting for logger --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
* CSTACKEX-1: Feign changes and fixes for getting storage pool creation to work * CSTACKEX-01: Create Primary Storage pool changes with working code * CSTACKEX-01: Addressed all review comments and updated some code * CSTACKEX-01: Made some changes to fix some errors seen during testing * CSTACKEX-01: Addressed additional comments --------- Co-authored-by: Locharla, Sandeep <Sandeep.Locharla@netapp.com>
|
@DaanHoogland @winterhazel , How can we re-trigger the build? |
@rajiv-jain-netapp you can ping @blueorangutan and use the package command, like this: @blueorangutan package |
|
@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17610 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-15969) |
|
[SF] Trillian test result (tid-15974)
|
|
@weizhouapache @winterhazel , at your discretion (ready for merge for my part) |
winterhazel
left a comment
There was a problem hiding this comment.
Currently reviewing. This will take some time, so I am submitting the reviews partially.
|
|
||
| private static final List<Storage.StoragePoolType> supportedStoragePoolTypes = List.of(Storage.StoragePoolType.Filesystem, Storage.StoragePoolType.NetworkFilesystem, Storage.StoragePoolType.SharedMountPoint); | ||
|
|
||
| private static final String ONTAP_PROVIDER_NAME = "NetApp ONTAP"; |
There was a problem hiding this comment.
This constant is declared in 3 places. Perhaps we could create a file in a single common dependency (maybe cloud-api) to declare the plugin names?
There was a problem hiding this comment.
@winterhazel I did not find any suitable place in cloud-api for keeping this constant, It would be helpful if you could point out some place to keep this constant.
There was a problem hiding this comment.
org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider should be the most appropriate place (this one is in cloud-engine-api, not cloud-api).
| } catch (Exception e) { | ||
| logger.error("Unexpected exception while creating disk-only VM snapshot for VM [{}]. Deleting leftover deltas.", vmName, e); | ||
| cleanupLeftoverDeltas(volumeObjectTos, mapVolumeToSnapshotSizeAndNewVolumePath, storagePoolMgr); | ||
| return new CreateDiskOnlyVmSnapshotAnswer(cmd, false, | ||
| String.format("Creation of disk-only VM snapshot for VM [%s] failed due to %s.", vmName, e.getMessage()), null); |
There was a problem hiding this comment.
Can this be unified with the catch block above?
There was a problem hiding this comment.
@winterhazel, I added this logic separately after encountering failures in negative scenarios where the UI did not surface any error details. With this change, users are now notified of the failure reason when the exception falls outside the scope of the existing catch block. This is expected to improve overall user experience. Please let me know if you still feel this should be removed.
There was a problem hiding this comment.
@rajiv-jain-netapp got it. Notifying operators of why there was a failure is the right thing to do. I was just thinking about converting the two catches of this try to a single catch, as they execute pretty much the same things. This would be done by replacing catch (LibvirtException | QemuImgException e) with catch (Exception e) and keeping return new CreateDiskOnlyVmSnapshotAnswer(... instead of return new Answer(....
| logger.info("Other LUNs still active after removing /" + iqn + "/" + lun + " — session kept alive."); | ||
| return true; |
There was a problem hiding this comment.
As the disconnect operation failed, I wonder if it makes more sense to throw an exception here instead
10cb764 to
c86d377
Compare
| logger.info("Deleting ONTAP volume by name: " + volume.getName() + " and uuid: " + volume.getUuid()); | ||
| String authHeader = OntapStorageUtils.generateAuthHeader(storage.getUsername(), storage.getPassword()); | ||
| try { | ||
| // TODO: Implement lun and file deletion, if any, before deleting the volume |
There was a problem hiding this comment.
Is this going to be addressed in this PR, or separately?
| CloudStackVolume cloudStackVolume = null; | ||
| FileInfo fileInfo = getFile(cloudStackVolumeMap.get(OntapStorageConstants.VOLUME_UUID),cloudStackVolumeMap.get(OntapStorageConstants.FILE_PATH)); | ||
|
|
||
| if(fileInfo != null){ |
There was a problem hiding this comment.
| if(fileInfo != null){ | |
| if (fileInfo != null) { |
| @@ -180,11 +212,11 @@ public void disableLogicalAccess(Map<String, String> values) { | |||
|
|
|||
| @Override | |||
| public Map<String, String> getLogicalAccess(Map<String, String> values) { | |||
There was a problem hiding this comment.
This method does not seem to be used outside the tests. Is this expected?
| } | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Methods from line 301-367 are not used. Is this expected?
| } catch (CloudRuntimeException e) { | ||
| throw e; | ||
| } finally { | ||
| if (!result) { |
There was a problem hiding this comment.
This if can be inverted to reduce indentation
| deleteFlexVolSnapshots(flexVolDetails); | ||
| } | ||
|
|
||
| // Also handle legacy STORAGE_SNAPSHOT details (backward compatibility) |
There was a problem hiding this comment.
Is this needed for the ONTAP plugin?
| revertFlexVolSnapshots(flexVolDetails); | ||
| } | ||
|
|
||
| // Also handle legacy STORAGE_SNAPSHOT details (backward compatibility) |
There was a problem hiding this comment.
Is this needed for the ONTAP plugin?
|
@winterhazel I have pushed changes addressing most of the changes you suggested except for the comments "This if can be inverted to throw early and reduce the indentation" where we can discuss more. Please re-review. |
|
@piyush5netapp thanks. I intend to have a look at the feedback and the new changes later today. I will resolve the open conversations that were already addressed as I read them. |
|
@piyush5netapp @rajiv-jain-netapp I went through the reviews and resolved the ones that already seem addressed. Could you go through the comments that are still open and address them, or close with a comment if you judge it unnecessary (the indentation ones)? |
- extracted the ONTAP plugin name to interface nane to use it from one place. - Corrected indentation gaps.
|
Thank you for your comments, @winterhazel. |
Description
Co-authored-by: Sandeep Locharla sandeep.locharla@netapp.com
Co-authored-by: Piyush Srivastava piyush5@netapp.com
Co-authored-by: Surya Gupta suryag@netapp.com
This PR...
1. memory snapshot
2. user input for quicing option during snapshot creation
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Testing Done:
How did you try to break this feature and the system with this change?