From 7d087d07a46507ea32198f1db997df7eeb1b1c0e Mon Sep 17 00:00:00 2001 From: Sumedh Alok Sharma Date: Wed, 11 Dec 2024 11:16:26 +0530 Subject: [PATCH] runtime: relax timeout for CreateVM + BootVM in CLH This commit introduces changes merged in upstream PR 9153 of relaxing the timeout for calling CLH's CreateVM+BootVM APIs. Further, the commit increases the timeout to 100s to handle guest boot with large memory requests. Signed-off-by: Sumedh Alok Sharma --- src/runtime/virtcontainers/clh.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index 1ab89a727fe3..dfb865963bf4 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -81,6 +81,10 @@ const ( // successfully, on a single Host. clhAPITimeoutConfidentialGuest = 300 + // Minimum timout for calling CreateVM followed by BootVM. Executing these two APIs + // might take longer than the value returned by getClhAPITimeout(). + clhCreateAndBootVMMinimumTimeout = 100 + // Timeout for hot-plug - hotplug devices can take more time, than usual API calls // Use longer time timeout for it. clhHotPlugAPITimeout = 5 @@ -766,9 +770,8 @@ func (clh *cloudHypervisor) StartVM(ctx context.Context, timeout int) error { } bootvm_timeout := clh.getClhAPITimeout() - // TODO: review this 10 second minimum timeout value. - if bootvm_timeout < 10 { - bootvm_timeout = 10 + if bootvm_timeout < clhCreateAndBootVMMinimumTimeout { + bootvm_timeout = clhCreateAndBootVMMinimumTimeout } ctx, cancel := context.WithTimeout(context.Background(), bootvm_timeout*time.Second)