From 3263511b7236f7989b0b89762c833162ab3882c8 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Tue, 21 Jun 2016 11:19:46 +0200 Subject: [PATCH] fix(Xapi#snapshotVm): fallback if quiesce failed Fixes vatesfr/xo-web#1088 --- src/xapi/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xapi/index.js b/src/xapi/index.js index 2290d7b2a..bb701707c 100644 --- a/src/xapi/index.js +++ b/src/xapi/index.js @@ -1634,9 +1634,16 @@ export default class Xapi extends XapiBase { await this._waitObjectState(ref, vm => includes(vm.tags, 'quiesce')) } catch (error) { + const { code } = error if ( - error.code !== 'VM_SNAPSHOT_WITH_QUIESCE_NOT_SUPPORTED' && - error.code !== 'VM_BAD_POWER_STATE' // quiesce only work on a running VM + code !== 'VM_SNAPSHOT_WITH_QUIESCE_NOT_SUPPORTED' && + + // quiesce only work on a running VM + code !== 'VM_BAD_POWER_STATE' && + + // quiesce failed, fallback on standard snapshot + // TODO: emit warning + code !== 'VM_SNAPSHOT_WITH_QUIESCE_FAILED' ) { throw error }