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:
Daniel Augusto Veronezi Salvador 2021-08-26 08:18:17 -03:00 committed by GitHub
parent 041b8f6220
commit 159c72fa97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -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

View File

@ -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>

View File

@ -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);