From 0b3858f91d6a1671a3952a3798187b7c00aaa126 Mon Sep 17 00:00:00 2001 From: Olivier Lambert Date: Fri, 13 Nov 2015 21:40:20 +0100 Subject: [PATCH] Add VM snapshot quiesce support --- src/xapi.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xapi.js b/src/xapi.js index 8a7abb594..c3d4c8d8f 100644 --- a/src/xapi.js +++ b/src/xapi.js @@ -586,8 +586,15 @@ export default class Xapi extends XapiBase { } async _snapshotVm (vm, nameLabel = vm.name_label) { - const ref = await this.call('VM.snapshot', vm.$ref, nameLabel) - + let ref + try { + ref = await this.call('VM.snapshot_with_quiesce', vm.$ref, nameLabel) + } catch (error) { + if (error.code !== 'VM_SNAPSHOT_WITH_QUIESCE_NOT_SUPPORTED') { + throw error + } + ref = await this.call('VM.snapshot', vm.$ref, nameLabel) + } // Convert the template to a VM. await this.call('VM.set_is_a_template', ref, false)