-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CloudStack Volume support with ONTAP storage #13053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4c8c8d9
bf838b3
b82fb40
1199d55
ebc3f00
28faca1
fe0f752
35f1011
a03a2c4
2e0efe8
a96eb9e
0f09c5f
2cc4b0c
033c23d
2822946
f7b837a
c585299
a492797
25353c2
973f5e2
686a892
edfcdde
73eb9f5
465fffe
3d6bd91
5815ebd
618f957
6c4b24e
1b0c7f7
54ddfa9
b23ac40
2c61e76
e99b98e
ef0354a
2f02d8a
1ae738b
890c2db
2d3b279
8a2c7fb
b26542f
856c5cc
7c2b229
763aa3b
eace4ee
f42552b
8894248
3f0019a
9b79f46
7a0d61e
7c3419e
d2b6a27
c5d5428
3f18c11
723561b
09968db
0a1a9c4
49df4c3
776b9a2
c04e223
186e59b
1020a2c
672d7a4
9c63c61
79730ed
ae96e9b
1b0bba9
7780a93
5bff41f
2abbed6
2340400
ce93705
e1a6465
9138e20
5f9e51c
142e0e6
aa74a5a
55447b7
fccaf83
ea40967
a41eb28
7d08878
4a62d40
a6e4b49
b58fd24
0f5370a
ddb119f
929d30f
a20b6cc
9748198
cddacd1
34e910c
c86d377
c6e222b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,6 +77,8 @@ public class KvmFileBasedStorageVmSnapshotStrategy extends StorageVMSnapshotStra | |||||||||
|
|
||||||||||
| 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"; | ||||||||||
|
|
||||||||||
| @Inject | ||||||||||
| protected SnapshotDataStoreDao snapshotDataStoreDao; | ||||||||||
|
|
||||||||||
|
|
@@ -325,6 +327,11 @@ public StrategyPriority canHandle(Long vmId, Long rootPoolId, boolean snapshotMe | |||||||||
| List<VolumeVO> volumes = volumeDao.findByInstance(vmId); | ||||||||||
| for (VolumeVO volume : volumes) { | ||||||||||
| StoragePoolVO storagePoolVO = storagePool.findById(volume.getPoolId()); | ||||||||||
| if (storagePoolVO.isManaged() && ONTAP_PROVIDER_NAME.equals(storagePoolVO.getStorageProviderName())) { | ||||||||||
| logger.debug(String.format("%s as the VM has a volume on ONTAP managed storage pool [%s]. " + | ||||||||||
| "ONTAP managed storage has its own dedicated VM snapshot strategy.", cantHandleLog, storagePoolVO.getName())); | ||||||||||
|
Comment on lines
+331
to
+332
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Replace String.format occurrences with parametrized log messages |
||||||||||
| return StrategyPriority.CANT_HANDLE; | ||||||||||
| } | ||||||||||
| if (!supportedStoragePoolTypes.contains(storagePoolVO.getPoolType())) { | ||||||||||
| logger.debug(String.format("%s as the VM has a volume that is in a storage with unsupported type [%s].", cantHandleLog, storagePoolVO.getPoolType())); | ||||||||||
| return StrategyPriority.CANT_HANDLE; | ||||||||||
|
|
@@ -503,8 +510,9 @@ protected VMSnapshot takeVmSnapshotInternal(VMSnapshot vmSnapshot, Map<VolumeInf | |||||||||
| return processCreateVmSnapshotAnswer(vmSnapshot, volumeInfoToSnapshotObjectMap, createDiskOnlyVMSnapshotAnswer, userVm, vmSnapshotVO, virtualSize, parentSnapshotVo); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| logger.error("Disk-only VM snapshot for VM [{}] failed{}.", userVm.getUuid(), answer != null ? " due to" + answer.getDetails() : ""); | ||||||||||
| throw new CloudRuntimeException(String.format("Disk-only VM snapshot for VM [%s] failed.", userVm.getUuid())); | ||||||||||
| String details = answer != null ? answer.getDetails() : String.format("No answer received from host [%s]. The host may be unreachable.", hostId); | ||||||||||
| logger.error("Disk-only VM snapshot for VM [{}] failed due to: {}.", userVm.getUuid(), details); | ||||||||||
| throw new CloudRuntimeException(String.format("Disk-only VM snapshot for VM [%s] failed due to: %s.", userVm.getUuid(), details)); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1340,6 +1340,15 @@ private void createManagedVolumeCopyTemplateAsync(VolumeInfo volumeInfo, Primary | |||||
| primaryDataStore.setDetails(details); | ||||||
|
|
||||||
| grantAccess(volumeInfo, destHost, primaryDataStore); | ||||||
| volumeInfo = volFactory.getVolume(volumeInfo.getId(), primaryDataStore); | ||||||
| // For Netapp ONTAP iscsiName or Lun path is available only after grantAccess | ||||||
| String managedStoreTarget = volumeInfo.get_iScsiName() != null ? volumeInfo.get_iScsiName() : volumeInfo.getUuid(); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| details.put(PrimaryDataStore.MANAGED_STORE_TARGET, managedStoreTarget); | ||||||
| primaryDataStore.setDetails(details); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this set be done inside |
||||||
| // Update destTemplateInfo with the iSCSI path from volumeInfo | ||||||
| if (destTemplateInfo instanceof TemplateObject) { | ||||||
| ((TemplateObject)destTemplateInfo).setInstallPath(volumeInfo.getPath()); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||||||
| } | ||||||
|
|
||||||
| try { | ||||||
| motionSrv.copyAsync(srcTemplateInfo, destTemplateInfo, destHost, caller); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?