Skip to content

Externalize KVM Agent's option to change migration thread timeout #4570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions agent/conf/agent.properties
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,6 @@ iscsi.session.cleanup.enabled=false
# This parameter specifies the heartbeat update timeout in ms; The default value is 60000ms (1 min).
# 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
Original file line number Diff line number Diff line change
Expand Up @@ -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);

public static class Property <T>{
private final String name;
private final T defaultValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
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;
Expand Down Expand Up @@ -239,7 +241,7 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0.
}
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);
Expand Down