From 93814d17387372e77c9e2df2cc04945d669fbc3a Mon Sep 17 00:00:00 2001 From: Min Chen Date: Tue, 6 Aug 2013 14:38:32 -0700 Subject: [PATCH] CLOUDSTACK-4002: We should use backup_snap_id in snapshots table to construct snapshot install_path in snapshot_store_ref for pre-4.2.0 snapshot. --- engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java index 678bd688f1d..b5da56bd7be 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java @@ -1952,7 +1952,7 @@ public class Upgrade410to420 implements DbUpgrade { try { snapshotStoreInsert = conn - .prepareStatement("INSERT INTO `cloud`.`snapshot_store_ref` (store_id, snapshot_id, created, size, parent_snapshot_id, install_path, volume_id, update_count, ref_cnt, store_role, state) select sechost_id, id, created, size, prev_snap_id, CONCAT('snapshots', '/', account_id, '/', volume_id, '/', path), volume_id, 0, 0, 'Image', 'Ready' from `cloud`.`snapshots` where status = 'BackedUp' and sechost_id is not null and removed is null"); + .prepareStatement("INSERT INTO `cloud`.`snapshot_store_ref` (store_id, snapshot_id, created, size, parent_snapshot_id, install_path, volume_id, update_count, ref_cnt, store_role, state) select sechost_id, id, created, size, prev_snap_id, CONCAT('snapshots', '/', account_id, '/', volume_id, '/', backup_snap_id), volume_id, 0, 0, 'Image', 'Ready' from `cloud`.`snapshots` where status = 'BackedUp' and sechost_id is not null and removed is null"); snapshotStoreInsert.executeUpdate(); } catch (SQLException e) {