You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 80aff27
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: engine/schema/src/main/java/com/cloud/storage/dao/VolumeDaoImpl.java
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,12 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
96
96
protectedstaticfinalStringSELECT_HYPERTYPE_FROM_CLUSTER_VOLUME = "SELECT c.hypervisor_type from volumes v, storage_pool s, cluster c where v.pool_id = s.id and s.cluster_id = c.id and v.id = ?";
97
97
protectedstaticfinalStringSELECT_HYPERTYPE_FROM_ZONE_VOLUME = "SELECT s.hypervisor from volumes v, storage_pool s where v.pool_id = s.id and v.id = ?";
98
98
protectedstaticfinalStringSELECT_POOLSCOPE = "SELECT s.scope from storage_pool s, volumes v where s.id = v.pool_id and v.id = ?";
99
+
privatestaticfinalStringHAS_MULTI_POOL_VM =
100
+
"SELECT 1 FROM volumes root INNER JOIN volumes data ON data.instance_id = root.instance_id "
101
+
+ "WHERE root.pool_id = ? AND root.volume_type = 'ROOT' AND root.instance_id IS NOT NULL "
102
+
+ "AND root.removed IS NULL AND root.state NOT IN ('Destroy', 'Expunged') "
103
+
+ "AND data.volume_type = 'DATADISK' AND data.pool_id IS NOT NULL AND data.pool_id <> ? "
104
+
+ "AND data.removed IS NULL AND data.state NOT IN ('Destroy', 'Expunged') LIMIT 1";
99
105
100
106
privatestaticfinalStringORDER_POOLS_NUMBER_OF_VOLUMES_FOR_ACCOUNT_PART1 = "SELECT pool.id, SUM(IF(vol.state='Ready' AND vol.account_id = ?, 1, 0)) FROM `cloud`.`storage_pool` pool LEFT JOIN `cloud`.`volumes` vol ON pool.id = vol.pool_id WHERE pool.data_center_id = ? ";
101
107
privatestaticfinalStringORDER_POOLS_NUMBER_OF_VOLUMES_FOR_ACCOUNT_PART2 = " GROUP BY pool.id ORDER BY 2 ASC ";
@@ -998,6 +1004,21 @@ public boolean existsWithKmsKey(long kmsKeyId) {
0 commit comments