mirror of https://github.com/apache/cloudstack.git
parent
010b47f82e
commit
1fd1f0626a
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue