shwstppr commented on code in PR #6589:
URL: https://github.com/apache/cloudstack/pull/6589#discussion_r1347004926


##########
engine/schema/src/main/resources/META-INF/db/schema-41720to41800.sql:
##########
@@ -1562,6 +1562,21 @@ DELETE FROM `cloud`.`snapshot_store_ref`
 WHERE store_role = "Primary" AND store_id IN (SELECT id FROM storage_pool 
WHERE removed IS NOT NULL);
 
 
+ALTER TABLE `cloud`.`backups` ADD backup_volumes TEXT NULL COMMENT 'details of 
backedup volumes';
+
+-- Populate column backup_volumes in table backups with a GSON
+-- formed by concatenating the UUID, type, size, path and deviceId
+-- of the volumes of VMs that have some backup offering.
+-- Required for the restore process of a backup using Veeam
+-- The Gson result can be in one of this formats:
+-- When VM has only ROOT disk: 
[{"uuid":"<uuid>","type":"<type>","size":<size>,"path":"<path>","deviceId":<deviceId>}]
+-- When VM has more tha one disk: 
[{"uuid":"<uuid>","type":"<type>","size":<size>,"path":"<path>","deviceId":<deviceId>},
 
{"uuid":"<uuid>","type":"<type>","size":<size>,"path":"<path>","deviceId":<deviceId>},
 <>]
+UPDATE `cloud`.`backups` b INNER JOIN `cloud`.`vm_instance` vm ON b.vm_id = 
vm.id SET b.backup_volumes = (SELECT CONCAT("[", GROUP_CONCAT( 
CONCAT("{\"uuid\":\"", v.uuid, "\",\"type\":\"", v.volume_type, "\",\"size\":", 
v.`size`, ",\"path\":\"", v.path, "\",\"deviceId\":", v.device_id, "}") 
SEPARATOR ","), "]") FROM `cloud`.`volumes` v WHERE v.instance_id = vm.id);
+
+ALTER TABLE `cloud`.`vm_instance` ADD backup_name varchar(255) NULL COMMENT 
'backup job name when using Veeam provider';
+
+UPDATE `cloud`.`vm_instance` vm INNER JOIN `cloud`.`backup_offering` bo ON 
vm.backup_offering_id = bo.id SET vm.backup_name = CONCAT(vm.instance_name, 
"-CSBKP-", vm.uuid);
+

Review Comment:
   @SadiJr this would need addressing



-- 
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