diff --git a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41610to41700.java b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41610to41700.java index be1e42cb5d9..6b41ba42b22 100644 --- a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41610to41700.java +++ b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41610to41700.java @@ -61,7 +61,7 @@ public class Upgrade41610to41700 implements DbUpgrade, DbUpgradeSystemVmTemplate @Override public void performDataMigration(Connection conn) { - fixWrongPoolUuid(conn); + fixWrongDatastoreClusterPoolUuid(conn); } @Override @@ -90,10 +90,11 @@ public class Upgrade41610to41700 implements DbUpgrade, DbUpgradeSystemVmTemplate } } - public void fixWrongPoolUuid(Connection conn) { - LOG.debug("Replacement of faulty pool uuids"); + public void fixWrongDatastoreClusterPoolUuid(Connection conn) { + LOG.debug("Replacement of faulty pool uuids on datastorecluster"); try (PreparedStatement pstmt = conn.prepareStatement("SELECT id,uuid FROM storage_pool " - + "WHERE uuid NOT LIKE \"%-%-%-%\" AND removed IS NULL;"); ResultSet rs = pstmt.executeQuery()) { + + "WHERE uuid NOT LIKE \"%-%-%-%\" AND removed IS NULL " + + "AND pool_type = 'DatastoreCluster';"); ResultSet rs = pstmt.executeQuery()) { PreparedStatement updateStmt = conn.prepareStatement("update storage_pool set uuid = ? where id = ?"); while (rs.next()) { UUID poolUuid = new UUID(