Skip to content

Commit

Permalink
Retry VM lacks feature errors as well. PV drivers aren't loaded when …
Browse files Browse the repository at this point in the history
…trying to reboot
  • Loading branch information
ddelnano committed Sep 28, 2023
1 parent c311984 commit ede24d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ede24d3

Please sign in to comment.