From ede24d35dda43b40bdbcdd8e2d74434540b572bd Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Wed, 27 Sep 2023 23:54:17 -0700 Subject: [PATCH] Retry VM lacks feature errors as well. PV drivers aren't loaded when trying to reboot --- client/client.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index c641f9ca..048e13a0 100644 --- a/client/client.go +++ b/client/client.go @@ -229,7 +229,14 @@ func NewClient(config Config) (XOClient, error) { } func IsRetryableError(err jsonrpc2.Error) bool { - if err.Code == 11 { + // Error code 11 corresponds to an error condition where a VM is missing PV drivers. + // https://github.com/vatesfr/xen-orchestra/blob/a3a2fda157fa30af4b93d34c99bac550f7c82bbc/packages/xo-common/api-errors.js#L95 + + // During the boot process, there is a race condition where the PV drivers aren't available yet and + // making XO api calls during this time can return a VM_MISSING_PV_DRIVERS error. These errors can + // be treated as retryable since we want to wait until the VM has finished booting and its PV driver + // is initialized. + if err.Code == 11 || err.Code == 14 { return true } return false