weizhouapache commented on code in PR #6589:
URL: https://github.com/apache/cloudstack/pull/6589#discussion_r1432694167
##########
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);
Review Comment:
`AND volumes.removed IS NULL` ?
--
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]