fix(backups): restore VM with memory as suspended (#6774)

Fixes #5061
This commit is contained in:
Julien Fontanet
2023-04-07 16:02:52 +02:00
committed by GitHub
parent 5c6ae1912b
commit 4d55c5ae48
3 changed files with 4 additions and 3 deletions

View File

@@ -747,7 +747,7 @@ class RemoteAdapter {
async readDeltaVmBackup(metadata, ignoredVdis) {
const handler = this._handler
const { vbds, vhds, vifs, vm } = metadata
const { vbds, vhds, vifs, vm, vmSnapshot } = metadata
const dir = dirname(metadata._filename)
const vdis = ignoredVdis === undefined ? metadata.vdis : pickBy(metadata.vdis, vdi => !ignoredVdis.has(vdi.uuid))
@@ -762,7 +762,7 @@ class RemoteAdapter {
vdis,
version: '1.0.0',
vifs,
vm,
vm: { ...vm, suspend_VDI: vmSnapshot.suspend_VDI },
}
}

View File

@@ -187,7 +187,7 @@ exports.importDeltaVm = defer(async function importDeltaVm(
// 0. Create suspend_VDI
let suspendVdi
if (vmRecord.power_state === 'Suspended') {
if (vmRecord.suspend_VDI !== undefined) {
const vdi = vdiRecords[vmRecord.suspend_VDI]
if (vdi === undefined) {
Task.warning('Suspend VDI not available for this suspended VM', {

View File

@@ -15,6 +15,7 @@
- [Plugins/usage-report] Compute stats on configured period instead of the whole year (PR [#6723](https://github.com/vatesfr/xen-orchestra/pull/6723))
- [Backup] Fix `Invalid parameters` when deleting `speed limit` value (PR [#6768](https://github.com/vatesfr/xen-orchestra/pull/6768))
- [Delta Backup] Restoring a backup with memory must create a suspended VM [#5061](https://github.com/vatesfr/xen-orchestra/issues/5061) (PR [#6774](https://github.com/vatesfr/xen-orchestra/pull/6774))
### Packages to release