feat(xo-server/snapshotVm): tag xo-disable-quiesce (#3350)

This commit is contained in:
Julien Fontanet 2018-08-22 15:15:05 +02:00 committed by GitHub
parent 92a93e4393
commit 4d2909567c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1489,6 +1489,8 @@ export default class Xapi extends XapiBase {
)
let ref
do {
if (!vm.tags.includes('xo-disable-quiesce')) {
try {
ref = await this.callAsync(
$cancelToken,
@ -1497,6 +1499,8 @@ export default class Xapi extends XapiBase {
nameLabel
).then(extractOpaqueRef)
this.addTag(ref, 'quiesce')::ignoreErrors()
break
} catch (error) {
const { code } = error
if (
@ -1509,13 +1513,16 @@ export default class Xapi extends XapiBase {
) {
throw error
}
}
}
ref = await this.callAsync(
$cancelToken,
'VM.snapshot',
vm.$ref,
nameLabel
).then(extractOpaqueRef)
}
} while (false)
// Convert the template to a VM and wait to have receive the up-
// to-date object.
const [, snapshot] = await Promise.all([