Skip to content
3 changes: 2 additions & 1 deletion api/src/main/java/com/cloud/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ public static enum StoragePoolType {
DatastoreCluster(true, true, EncryptionSupport.Unsupported), // for VMware, to abstract pool of clusters
StorPool(true, true, EncryptionSupport.Hypervisor),
FiberChannel(true, true, EncryptionSupport.Unsupported), // Fiber Channel Pool for KVM hypervisors is used to find the volume by WWN value (/dev/disk/by-id/wwn-<wwnvalue>)
NVMeTCP(true, true, EncryptionSupport.Unsupported); // NVMe over TCP (NVMe-oF/TCP) Pool for KVM hypervisors; volumes are identified by EUI-128 NGUID (/dev/disk/by-id/nvme-eui.<eui>)
NVMeTCP(true, true, EncryptionSupport.Unsupported), // NVMe over TCP (NVMe-oF/TCP) Pool for KVM hypervisors; volumes are identified by EUI-128 NGUID (/dev/disk/by-id/nvme-eui.<eui>)
OntapiSCSI(true, true, EncryptionSupport.Unsupported); // NetApp ONTAP iSCSI

private final boolean shared;
private final boolean overProvisioning;
Expand Down
2 changes: 2 additions & 0 deletions api/src/test/java/com/cloud/storage/StorageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void isSharedStoragePool() {
Assert.assertTrue(StoragePoolType.ManagedNFS.isShared());
Assert.assertTrue(StoragePoolType.DatastoreCluster.isShared());
Assert.assertTrue(StoragePoolType.Linstor.isShared());
Assert.assertTrue(StoragePoolType.OntapiSCSI.isShared());
}

@Test
Expand All @@ -73,6 +74,7 @@ public void supportsOverProvisioningTestAllStoragePoolTypes() {
Assert.assertFalse(StoragePoolType.ManagedNFS.supportsOverProvisioning());
Assert.assertTrue(StoragePoolType.DatastoreCluster.supportsOverProvisioning());
Assert.assertTrue(StoragePoolType.Linstor.supportsOverProvisioning());
Assert.assertTrue(StoragePoolType.OntapiSCSI.supportsOverProvisioning());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,25 @@ CREATE TABLE IF NOT EXISTS `cloud`.`instance_boot_group_details` (
PRIMARY KEY (`id`),
CONSTRAINT `fk_instance_boot_group_details__group_id` FOREIGN KEY (`boot_group_id`) REFERENCES `instance_boot_group` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Re-tag NetApp ONTAP iSCSI storage pools to the dedicated 'OntapiSCSI' pool type.
UPDATE `cloud`.`storage_pool`
SET `pool_type` = 'OntapiSCSI'
WHERE `storage_provider_name` = 'NetApp ONTAP'
AND `pool_type` = 'Iscsi';

-- The denormalized copy on every volume that lives on such a pool.
UPDATE `cloud`.`volumes` v
JOIN `cloud`.`storage_pool` sp ON sp.`id` = v.`pool_id`
SET v.`pool_type` = 'OntapiSCSI'
WHERE sp.`storage_provider_name` = 'NetApp ONTAP'
AND sp.`pool_type` IN ('Iscsi', 'OntapiSCSI')
AND v.`pool_type` = 'Iscsi';

-- Volume format realignment.
UPDATE `cloud`.`volumes` v
JOIN `cloud`.`storage_pool` sp ON sp.`id` = v.`pool_id`
SET v.`format` = 'RAW'
WHERE sp.`storage_provider_name` = 'NetApp ONTAP'
AND sp.`pool_type` IN ('Iscsi', 'OntapiSCSI')
AND (v.`format` IS NULL OR v.`format` <> 'RAW');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To cover these changes: has an upgrade from 4.23 to this PR been tested using these type of pools?

@piyush5netapp piyush5netapp Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nvazquez Yes, You can refer the testing section of this PR description. So what I did is,I created few VMs in 4.23 with volumes on different storage pool like default primary, ontap nfs primary, ontap iscsi primary and then upgraded them to this PR changes. Rows which had Netapp Ontap storage were changed while rows which were other than Netapp Ontap provider were untouched.

Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,9 @@ private void verifyFormatWithPoolType(ImageFormat imageFormat, StoragePoolType p
if (imageFormat != ImageFormat.VHD && imageFormat != ImageFormat.OVA && imageFormat != ImageFormat.QCOW2 &&
!(imageFormat == ImageFormat.RAW && (StoragePoolType.PowerFlex == poolType ||
StoragePoolType.FiberChannel == poolType ||
StoragePoolType.NVMeTCP == poolType))) {
throw new CloudRuntimeException(String.format("Only the following image types are currently supported: %s, %s, %s, %s (for PowerFlex, FiberChannel and NVMeTCP)",
StoragePoolType.NVMeTCP == poolType ||
StoragePoolType.OntapiSCSI == poolType))) {
throw new CloudRuntimeException(String.format("Only the following image types are currently supported: %s, %s, %s, %s (for PowerFlex, FiberChannel, NVMeTCP and OntapiSCSI)",
ImageFormat.VHD.toString(), ImageFormat.OVA.toString(), ImageFormat.QCOW2.toString(), ImageFormat.RAW.toString()));
}
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ public Answer copyTemplateToPrimaryStorage(final CopyCommand cmd) {
StoragePoolType.Linstor,
StoragePoolType.FiberChannel,
StoragePoolType.CLVM,
StoragePoolType.NVMeTCP).contains(primaryPool.getType())) {
StoragePoolType.NVMeTCP,
StoragePoolType.OntapiSCSI).contains(primaryPool.getType())) {
newTemplate.setFormat(ImageFormat.RAW);
} else {
newTemplate.setFormat(ImageFormat.QCOW2);
Expand Down Expand Up @@ -3516,7 +3517,8 @@ private Storage.ImageFormat getFormat(StoragePoolType poolType) {
StoragePoolType.Linstor,
StoragePoolType.FiberChannel,
StoragePoolType.CLVM,
StoragePoolType.NVMeTCP).contains(poolType)) {
StoragePoolType.NVMeTCP,
StoragePoolType.OntapiSCSI).contains(poolType)) {
return ImageFormat.RAW;
} else {
return ImageFormat.QCOW2;
Expand Down
Loading
Loading