piyush5netapp commented on code in PR #14192:
URL: https://github.com/apache/cloudstack/pull/14192#discussion_r4467003191


##########
engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql:
##########
@@ -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');

Review Comment:
   @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 ontap storage were changed while rows 
which were other than ontap were untouched.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to