feat(xo-server/snapshotVm): tag xo-disable-quiesce (#3350)
This commit is contained in:
parent
92a93e4393
commit
4d2909567c
@ -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([
|
||||
|
Loading…
Reference in New Issue
Block a user