mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Randomize managed volume copy host (#5789)
* Randomize managed volume copy host * Managed volume copy was always returning first host that could see storage pools * Fix null value in logging for ScaleIOPrimaryDataStoreDriver due to if/else logic error Signed-off-by: Marcus Sorensen <mls@apple.com> * Use String.format for ScaleIO debug message Signed-off-by: Marcus Sorensen <mls@apple.com> * Update debug message for ScaleIO copy methods Signed-off-by: Marcus Sorensen <mls@apple.com> Co-authored-by: Marcus Sorensen <mls@apple.com>
This commit is contained in:
parent
62089767f6
commit
dcdcd09058
@ -629,7 +629,7 @@ public class ScaleIOPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
||||
|
||||
private Answer copyTemplateToVolume(DataObject srcData, DataObject destData, Host destHost) {
|
||||
// Copy PowerFlex/ScaleIO template to volume
|
||||
LOGGER.debug("Initiating copy from PowerFlex template volume on host " + destHost != null ? destHost.getId() : "");
|
||||
LOGGER.debug(String.format("Initiating copy from PowerFlex template volume on host %s", destHost != null ? destHost.getId() : "<not specified>"));
|
||||
int primaryStorageDownloadWait = StorageManager.PRIMARY_STORAGE_DOWNLOAD_WAIT.value();
|
||||
CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), primaryStorageDownloadWait, VirtualMachineManager.ExecuteInSequence.value());
|
||||
|
||||
@ -648,7 +648,7 @@ public class ScaleIOPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
||||
|
||||
private Answer copyVolume(DataObject srcData, DataObject destData, Host destHost) {
|
||||
// Copy PowerFlex/ScaleIO volume
|
||||
LOGGER.debug("Initiating copy from PowerFlex volume on host " + destHost != null ? destHost.getId() : "");
|
||||
LOGGER.debug(String.format("Initiating copy from PowerFlex template volume on host %s", destHost != null ? destHost.getId() : "<not specified>"));
|
||||
String value = configDao.getValue(Config.CopyVolumeWait.key());
|
||||
int copyVolumeWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
|
||||
|
||||
|
||||
@ -2136,6 +2136,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
||||
if (hostIds.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Collections.shuffle(hostIds);
|
||||
|
||||
for (Long hostId : hostIds) {
|
||||
Host host = _hostDao.findById(hostId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user