mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Externalize KVM Agent's option to change migration thread timeout (#4570)
* Externalize KVM Agent's option to change migration thread timeout * Update javadoc Co-authored-by: GutoVeronezi <daniel@scclouds.com.br>
This commit is contained in:
parent
041b8f6220
commit
159c72fa97
@ -271,6 +271,9 @@ iscsi.session.cleanup.enabled=false
|
||||
# Depending on the use case, this timeout might need increasing/decreasing.
|
||||
# heartbeat.update.timeout=60000
|
||||
|
||||
# This parameter specifies the timeout in seconds to retrieve the target's domain id when migrating a VM with KVM.
|
||||
# vm.migrate.domain.retrieve.timeout=10
|
||||
|
||||
# This parameter specifies if the host must be rebooted when something goes wrong with the heartbeat.
|
||||
# reboot.host.and.alert.management.on.heartbeat.timeout=true
|
||||
|
||||
|
||||
@ -29,9 +29,16 @@ public class AgentProperties{
|
||||
* Heartbeat update timeout. <br>
|
||||
* Data type: int. <br>
|
||||
* Default value: 60000 (ms).
|
||||
*/
|
||||
*/
|
||||
public static final Property<Integer> HEARTBEAT_UPDATE_TIMEOUT = new Property<Integer>("heartbeat.update.timeout", 60000);
|
||||
|
||||
/**
|
||||
* The timeout in seconds to retrieve the target's domain id when migrating a VM with KVM. <br>
|
||||
* Data type: int. <br>
|
||||
* Default value: 10 (sec).
|
||||
*/
|
||||
public static final Property<Integer> VM_MIGRATE_DOMAIN_RETRIEVE_TIMEOUT = new Property<Integer>("vm.migrate.domain.retrieve.timeout", 10);
|
||||
|
||||
/**
|
||||
* Reboot host and alert management on heartbeat timeout. <br>
|
||||
* Data type: boolean.<br>
|
||||
|
||||
@ -66,6 +66,8 @@ import com.cloud.agent.api.MigrateAnswer;
|
||||
import com.cloud.agent.api.MigrateCommand;
|
||||
import com.cloud.agent.api.MigrateCommand.MigrateDiskInfo;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.properties.AgentProperties;
|
||||
import com.cloud.agent.properties.AgentPropertiesFileHandler;
|
||||
import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
|
||||
import com.cloud.hypervisor.kvm.resource.LibvirtConnection;
|
||||
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.DiskDef;
|
||||
@ -239,7 +241,7 @@ public final class LibvirtMigrateCommandWrapper extends CommandWrapper<MigrateCo
|
||||
}
|
||||
s_logger.info("Migration thread for " + vmName + " is done");
|
||||
|
||||
destDomain = migrateThread.get(10, TimeUnit.SECONDS);
|
||||
destDomain = migrateThread.get(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.VM_MIGRATE_DOMAIN_RETRIEVE_TIMEOUT), TimeUnit.SECONDS);
|
||||
|
||||
if (destDomain != null) {
|
||||
deleteOrDisconnectDisksOnSourcePool(libvirtComputingResource, migrateDiskInfoList, disks);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user