@xen-orchestra/backups 0.71.1 → 0.71.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -365,12 +365,16 @@ export const importIncrementalVm = defer(async function importIncrementalVm(
365
365
  }
366
366
  }),
367
367
  ])
368
- // recreate VTPMs
369
- await Promise.all(
370
- (incrementalVm.vtpms ?? []).map(async contents => {
371
- await xapi.VTPM_create({ VM: vmRef, contents })
372
- })
373
- )
368
+
369
+ // recreate vtpm (note there is normally only one VTPM per VM at most)
370
+ const existingVtpmRefs = await xapi.getField('VM', vmRef, 'VTPMs')
371
+ for (const vtpmRef of existingVtpmRefs ?? []) {
372
+ await xapi.call('VTPM_destroy', vtpmRef)
373
+ }
374
+ for (const contents of incrementalVm.vtpms ?? []) {
375
+ await xapi.VTPM_create({ VM: vmRef, contents })
376
+ }
377
+
374
378
  const vm = await xapi.getRecord('VM', vmRef)
375
379
  await Promise.all([
376
380
  vmRecord.ha_always_run && xapi.setField('VM', vmRef, 'ha_always_run', true),
@@ -54,7 +54,7 @@ export const AbstractRemote = class AbstractRemoteVmBackupRunner extends Abstrac
54
54
  config,
55
55
  healthCheckSr,
56
56
  job,
57
- scheduleId: schedule.id,
57
+ schedule,
58
58
  vmUuid,
59
59
  settings,
60
60
  })
@@ -72,7 +72,7 @@ export const AbstractRemote = class AbstractRemoteVmBackupRunner extends Abstrac
72
72
  config,
73
73
  healthCheckSr,
74
74
  job,
75
- scheduleId: schedule.id,
75
+ schedule,
76
76
  vmUuid,
77
77
  remoteId,
78
78
  settings: targetSettings,
@@ -107,7 +107,7 @@ export class AbstractAggregatedRemoteWriter {
107
107
  }
108
108
 
109
109
  async getEntriesPerAdapter(adapter) {
110
- const scheduleId = this.#props.scheduleId
110
+ const scheduleId = this.#props.schedule.id
111
111
  const vmUuid = this.#props.vmUuid
112
112
  return (await adapter.listVmBackups(vmUuid, _ => _.scheduleId === scheduleId)).map(entry => ({
113
113
  ...entry,
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/vatesfr/xen-orchestra.git"
10
10
  },
11
- "version": "0.71.1",
11
+ "version": "0.71.2",
12
12
  "engines": {
13
13
  "node": ">=14.18"
14
14
  },