DaanHoogland commented on a change in pull request #4816:
URL: https://github.com/apache/cloudstack/pull/4816#discussion_r596911435
##########
File path:
plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
##########
@@ -44,4 +45,14 @@ public static String getPVbootloaderArgs(String guestOS) {
}
return "";
}
+
+ public static String getSRNameLabel(final String poolUuid,
+ final Storage.StoragePoolType poolType,
+ final String poolPath) {
+ if (Storage.StoragePoolType.PreSetup.equals(poolType) &&
+ !poolPath.contains(poolUuid)) {
Review comment:
aren't there any presetup scenarios where the path could contain the
uuid?
##########
File path:
plugins/hypervisors/xenserver/src/main/java/org/apache/cloudstack/storage/motion/XenServerStorageMotionStrategy.java
##########
@@ -326,7 +327,13 @@ private Answer
migrateVmWithVolumesAcrossCluster(VMInstanceVO vm, VirtualMachine
volumeToStorageUuid.add(new Pair<>(volumeTo, iqn));
}
else {
- volumeToStorageUuid.add(new Pair<>(volumeTo,
((StoragePool)entry.getValue()).getUuid()));
+ StoragePool pool = (StoragePool)entry.getValue();
+ String srNameLabel = pool.getUuid();
+ if
(Storage.StoragePoolType.PreSetup.equals(pool.getPoolType()) &&
+ !pool.getPath().contains(pool.getUuid())) {
+ srNameLabel = pool.getPath().replaceFirst("/", "");
+ }
Review comment:
```suggestion
Sting srNameLabel =
CitrixHelper.getSRNameLabel(pool.getUuid(), pool.getPoolType(), pool.getPath())
```
or if need be put the usitlity method elsewere, but make sure it only exists
once!?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]