@xen-orchestra/backups 0.48.1 → 0.49.0

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.
@@ -244,12 +244,20 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
244
244
 
245
245
  // block migration during the backup on the VM itself, not the latest snapshot
246
246
  {
247
- const { pool_migrate = null, migrate_send = null } = vm.blocked_operations
247
+ const { pool_migrate, migrate_send } = vm.blocked_operations
248
248
 
249
249
  const reason = 'VM migration is blocked during backup'
250
250
  await vm.update_blocked_operations({ pool_migrate: reason, migrate_send: reason })
251
251
 
252
- $defer(() => vm.update_blocked_operations({ pool_migrate, migrate_send }))
252
+ $defer(() =>
253
+ // delete the entries if they did not exist previously or if they were
254
+ // equal to reason (which happen if a previous backup was interrupted
255
+ // before resetting them)
256
+ vm.update_blocked_operations({
257
+ migrate_send: migrate_send === undefined || migrate_send === reason ? null : migrate_send,
258
+ pool_migrate: pool_migrate === undefined || pool_migrate === reason ? null : pool_migrate,
259
+ })
260
+ )
253
261
  }
254
262
 
255
263
  await this._fetchJobSnapshots()
@@ -1,4 +1,3 @@
1
- import { extractOpaqueRef } from '@xen-orchestra/xapi'
2
1
  import assert from 'node:assert/strict'
3
2
 
4
3
  import { HealthCheckVmBackup } from '../../HealthCheckVmBackup.mjs'
@@ -49,23 +48,18 @@ export const MixinXapiWriter = (BaseClass = Object) =>
49
48
  if (await this.#isAlreadyOnHealthCheckSr(baseVm)) {
50
49
  healthCheckVmRef = await Task.run(
51
50
  { name: 'cloning-vm' },
52
- async () =>
53
- await xapi
54
- .callAsync('VM.clone', this._targetVmRef, `Health Check - ${baseVm.name_label}`)
55
- .then(extractOpaqueRef)
51
+ async () => await xapi.callAsync('VM.clone', this._targetVmRef, `Health Check - ${baseVm.name_label}`)
56
52
  )
57
53
  } else {
58
54
  healthCheckVmRef = await Task.run(
59
55
  { name: 'copying-vm' },
60
56
  async () =>
61
- await xapi
62
- .callAsync(
63
- 'VM.copy',
64
- this._targetVmRef,
65
- `Health Check - ${baseVm.name_label}`,
66
- this._healthCheckSr.$ref
67
- )
68
- .then(extractOpaqueRef)
57
+ await xapi.callAsync(
58
+ 'VM.copy',
59
+ this._targetVmRef,
60
+ `Health Check - ${baseVm.name_label}`,
61
+ this._healthCheckSr.$ref
62
+ )
69
63
  )
70
64
  }
71
65
  const healthCheckVm =
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.48.1",
11
+ "version": "0.49.0",
12
12
  "engines": {
13
13
  "node": ">=14.18"
14
14
  },
@@ -25,19 +25,19 @@
25
25
  "@vates/decorate-with": "^2.1.0",
26
26
  "@vates/disposable": "^0.1.5",
27
27
  "@vates/fuse-vhd": "^2.1.0",
28
- "@vates/nbd-client": "^3.0.1",
28
+ "@vates/nbd-client": "^3.0.2",
29
29
  "@vates/parse-duration": "^0.1.1",
30
30
  "@xen-orchestra/async-map": "^0.1.2",
31
- "@xen-orchestra/fs": "^4.1.6",
31
+ "@xen-orchestra/fs": "^4.1.7",
32
32
  "@xen-orchestra/log": "^0.6.0",
33
33
  "@xen-orchestra/template": "^0.1.0",
34
- "app-conf": "^2.3.0",
34
+ "app-conf": "^3.0.0",
35
35
  "compare-versions": "^6.0.0",
36
36
  "d3-time-format": "^4.1.0",
37
37
  "decorator-synchronized": "^0.6.0",
38
38
  "golike-defer": "^0.5.1",
39
39
  "human-format": "^1.2.0",
40
- "limit-concurrency-decorator": "^0.5.0",
40
+ "limit-concurrency-decorator": "^0.6.0",
41
41
  "lodash": "^4.17.20",
42
42
  "ms": "^2.1.3",
43
43
  "node-zone": "^0.4.0",
@@ -47,18 +47,18 @@
47
47
  "tar": "^6.1.15",
48
48
  "uuid": "^9.0.0",
49
49
  "vhd-lib": "^4.9.2",
50
- "xen-api": "^3.0.1",
50
+ "xen-api": "^4.0.0",
51
51
  "yazl": "^2.5.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "fs-extra": "^11.1.0",
55
55
  "rimraf": "^5.0.1",
56
- "sinon": "^17.0.1",
56
+ "sinon": "^18.0.0",
57
57
  "test": "^3.2.1",
58
58
  "tmp": "^0.2.1"
59
59
  },
60
60
  "peerDependencies": {
61
- "@xen-orchestra/xapi": "^5.0.1"
61
+ "@xen-orchestra/xapi": "^6.0.0"
62
62
  },
63
63
  "license": "AGPL-3.0-or-later",
64
64
  "author": {