@xen-orchestra/backups 0.44.0 → 0.44.1

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.
@@ -16,26 +16,35 @@ async function resolveUuid(xapi, cache, uuid, type) {
16
16
  return cache.get(uuid)
17
17
  }
18
18
  export class ImportVmBackup {
19
- constructor({ adapter, metadata, srUuid, xapi, settings: { newMacAddresses, mapVdisSrs = {} } = {} }) {
19
+ constructor({
20
+ adapter,
21
+ metadata,
22
+ srUuid,
23
+ xapi,
24
+ settings: { additionnalVmTag, newMacAddresses, mapVdisSrs = {} } = {},
25
+ }) {
20
26
  this._adapter = adapter
21
- this._importIncrementalVmSettings = { newMacAddresses, mapVdisSrs }
27
+ this._importIncrementalVmSettings = { additionnalVmTag, newMacAddresses, mapVdisSrs }
22
28
  this._metadata = metadata
23
29
  this._srUuid = srUuid
24
30
  this._xapi = xapi
25
31
  }
26
32
 
27
33
  async #decorateIncrementalVmMetadata(backup) {
28
- const { mapVdisSrs } = this._importIncrementalVmSettings
34
+ const { additionnalVmTag, mapVdisSrs } = this._importIncrementalVmSettings
29
35
  const xapi = this._xapi
30
36
 
31
37
  const cache = new Map()
32
38
  const mapVdisSrRefs = {}
39
+ if (additionnalVmTag !== undefined) {
40
+ backup.vm.tags.push(additionnalVmTag)
41
+ }
33
42
  for (const [vdiUuid, srUuid] of Object.entries(mapVdisSrs)) {
34
43
  mapVdisSrRefs[vdiUuid] = await resolveUuid(xapi, cache, srUuid, 'SR')
35
44
  }
36
- const sr = await resolveUuid(xapi, cache, this._srUuid, 'SR')
45
+ const srRef = await resolveUuid(xapi, cache, this._srUuid, 'SR')
37
46
  Object.values(backup.vdis).forEach(vdi => {
38
- vdi.SR = mapVdisSrRefs[vdi.uuid] ?? sr.$ref
47
+ vdi.SR = mapVdisSrRefs[vdi.uuid] ?? srRef
39
48
  })
40
49
  return backup
41
50
  }
@@ -96,6 +96,9 @@ export const MixinRemoteWriter = (BaseClass = Object) =>
96
96
  metadata,
97
97
  srUuid,
98
98
  xapi,
99
+ settings: {
100
+ additionnalVmTag: 'xo:no-bak=Health Check',
101
+ },
99
102
  }).run()
100
103
  const restoredVm = xapi.getObject(restoredId)
101
104
  try {
@@ -58,7 +58,7 @@ export const MixinXapiWriter = (BaseClass = Object) =>
58
58
  )
59
59
  }
60
60
  const healthCheckVm = xapi.getObject(healthCheckVmRef) ?? (await xapi.waitObject(healthCheckVmRef))
61
-
61
+ await healthCheckVm.add_tag('xo:no-bak=Health Check')
62
62
  await new HealthCheckVmBackup({
63
63
  restoredVm: healthCheckVm,
64
64
  xapi,
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.44.0",
11
+ "version": "0.44.1",
12
12
  "engines": {
13
13
  "node": ">=14.18"
14
14
  },