mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-10244: Cache whether to migrate storage (#2416)
KVM online storage migration fails, this fixes use of whether to migrate storage using a cached variable.
This commit is contained in:
parent
5eb09565b3
commit
2ca264ca4d
@ -132,8 +132,11 @@ public final class LibvirtMigrateCommandWrapper extends CommandWrapper<MigrateCo
|
|||||||
vmsnapshots = libvirtComputingResource.cleanVMSnapshotMetadata(dm);
|
vmsnapshots = libvirtComputingResource.cleanVMSnapshotMetadata(dm);
|
||||||
|
|
||||||
Map<String, MigrateCommand.MigrateDiskInfo> mapMigrateStorage = command.getMigrateStorage();
|
Map<String, MigrateCommand.MigrateDiskInfo> mapMigrateStorage = command.getMigrateStorage();
|
||||||
|
// migrateStorage is declared as final because the replaceStorage method may mutate mapMigrateStorage, but
|
||||||
|
// migrateStorage's value should always only be associated with the initial state of mapMigrateStorage.
|
||||||
|
final boolean migrateStorage = MapUtils.isNotEmpty(mapMigrateStorage);
|
||||||
|
|
||||||
if (MapUtils.isNotEmpty(mapMigrateStorage)) {
|
if (migrateStorage) {
|
||||||
xmlDesc = replaceStorage(xmlDesc, mapMigrateStorage);
|
xmlDesc = replaceStorage(xmlDesc, mapMigrateStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +145,7 @@ public final class LibvirtMigrateCommandWrapper extends CommandWrapper<MigrateCo
|
|||||||
//run migration in thread so we can monitor it
|
//run migration in thread so we can monitor it
|
||||||
s_logger.info("Live migration of instance " + vmName + " initiated");
|
s_logger.info("Live migration of instance " + vmName + " initiated");
|
||||||
final ExecutorService executor = Executors.newFixedThreadPool(1);
|
final ExecutorService executor = Executors.newFixedThreadPool(1);
|
||||||
final Callable<Domain> worker = new MigrateKVMAsync(libvirtComputingResource, dm, dconn, xmlDesc, MapUtils.isNotEmpty(mapMigrateStorage),
|
final Callable<Domain> worker = new MigrateKVMAsync(libvirtComputingResource, dm, dconn, xmlDesc, migrateStorage,
|
||||||
command.isAutoConvergence(), vmName, command.getDestinationIp());
|
command.isAutoConvergence(), vmName, command.getDestinationIp());
|
||||||
final Future<Domain> migrateThread = executor.submit(worker);
|
final Future<Domain> migrateThread = executor.submit(worker);
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user