Add VM snapshot quiesce support
This commit is contained in:
parent
d07ea1b337
commit
0b3858f91d
11
src/xapi.js
11
src/xapi.js
@ -586,8 +586,15 @@ export default class Xapi extends XapiBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _snapshotVm (vm, nameLabel = vm.name_label) {
|
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.
|
// Convert the template to a VM.
|
||||||
await this.call('VM.set_is_a_template', ref, false)
|
await this.call('VM.set_is_a_template', ref, false)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user