rhtyd commented on a change in pull request #2983: KVM live storage migration
intra cluster from NFS source and destination
URL: https://github.com/apache/cloudstack/pull/2983#discussion_r252203448
##########
File path:
engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
##########
@@ -2046,6 +2208,51 @@ private void
verifyLiveMigrationMapForKVM(Map<VolumeInfo, DataStore> volumeDataS
if (destStoragePoolVO == null) {
throw new CloudRuntimeException("Destination storage pool with
ID " + dataStore.getId() + " was not located.");
}
+
+ if (storageTypeConsistency == null) {
+ storageTypeConsistency = destStoragePoolVO.isManaged();
+ } else if (storageTypeConsistency !=
destStoragePoolVO.isManaged()) {
+ throw new CloudRuntimeException("Destination storage pools
must be either all managed or all not managed");
+ }
+
+ if (!destStoragePoolVO.isManaged()) {
+ if (srcStoragePoolVO.getPoolType() !=
Storage.StoragePoolType.NetworkFilesystem ||
+ destStoragePoolVO.getPoolType() !=
Storage.StoragePoolType.NetworkFilesystem) {
+ throw new CloudRuntimeException("Currently only NFS source
and destination storage pools are supported " +
+ "when destination is not managed on KVM live
storage migrations");
+ }
+ if (destStoragePoolVO.getScope() != ScopeType.CLUSTER) {
+ throw new CloudRuntimeException("KVM live storage
migrations currently support cluster-wide " +
+ "not managed destination storage");
+ }
+ if (!sourcePools.containsKey(srcStoragePoolVO.getUuid())) {
+ sourcePools.put(srcStoragePoolVO.getUuid(),
srcStoragePoolVO.getPoolType());
+ }
+ }
+ }
+ verifyDestinationStorage(sourcePools, destHost);
+ }
+
+ /**
+ * Perform storage validation on destination host for KVM live storage
migrations.
+ * Validate that volume source storage pools are mounted on the
destination host prior the migration
+ * @throws CloudRuntimeException if any source storage pool is not mounted
on the destination host
+ */
+ private void verifyDestinationStorage(Map<String, Storage.StoragePoolType>
sourcePools, Host destHost) {
+ if (MapUtils.isNotEmpty(sourcePools)) {
+ LOGGER.debug("Verifying NFS source pools are already mounted on
destination host " + destHost.getUuid());
Review comment:
Fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services