fix(xo-server/backupNg.importVmBackup): do not try to detect base VM

This commit is contained in:
Julien Fontanet 2018-03-16 17:30:42 +01:00
parent 39d7b4c7bd
commit d34f641130
2 changed files with 13 additions and 9 deletions

View File

@ -919,6 +919,7 @@ export default class Xapi extends XapiBase {
delta: DeltaVmExport,
{
deleteBase = false,
detectBase = true,
disableStartAfterImport = true,
mapVdisSrs = {},
name_label = delta.vm.name_label,
@ -931,17 +932,19 @@ export default class Xapi extends XapiBase {
throw new Error(`Unsupported delta backup version: ${version}`)
}
const remoteBaseVmUuid = delta.vm.other_config[TAG_BASE_DELTA]
let baseVm
if (remoteBaseVmUuid) {
baseVm = find(
this.objects.all,
obj =>
(obj = obj.other_config) && obj[TAG_COPY_SRC] === remoteBaseVmUuid
)
if (detectBase) {
const remoteBaseVmUuid = delta.vm.other_config[TAG_BASE_DELTA]
if (remoteBaseVmUuid) {
baseVm = find(
this.objects.all,
obj =>
(obj = obj.other_config) && obj[TAG_COPY_SRC] === remoteBaseVmUuid
)
if (!baseVm) {
throw new Error('could not find the base VM')
if (!baseVm) {
throw new Error('could not find the base VM')
}
}
}

View File

@ -212,6 +212,7 @@ const importers: $Dict<
}
const { vm: newVm } = await xapi.importDeltaVm(delta, {
detectBase: false,
disableStartAfterImport: false,
srId: sr,
// TODO: support mapVdisSrs