@xen-orchestra/backups 0.62.0 → 0.64.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.
|
@@ -13,15 +13,35 @@ export const FullXapi = class FullXapiVmBackupRunner extends AbstractXapi {
|
|
|
13
13
|
return [FullRemoteWriter, FullXapiWriter]
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
_mustDoSnapshot() {
|
|
16
|
+
async _mustDoSnapshot() {
|
|
17
17
|
const vm = this._vm
|
|
18
|
-
|
|
19
18
|
const settings = this._settings
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
|
|
20
|
+
// General setting forcing snapshot at all times
|
|
21
|
+
if (settings.unconditionalSnapshot) {
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// If offline backup option is not checked
|
|
26
|
+
// and vm is running, we make a snapshot
|
|
27
|
+
if (!settings.offlineBackup && vm.power_state === 'Running') {
|
|
28
|
+
return true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// General setting used for snapshot retention
|
|
32
|
+
// see schedule in backupJob edition
|
|
33
|
+
if (settings.snapshotRetention !== 0) {
|
|
34
|
+
return true
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const vdis = await this._xapi.getRecords('VDI', await vm.$getDisks())
|
|
38
|
+
const hasNOBAKtag = vdis.some(idx => idx.name_label.includes('[NOBAK]'))
|
|
39
|
+
|
|
40
|
+
// if there is a disk with NOBAK tag
|
|
41
|
+
// we need to make a snapshot
|
|
42
|
+
if (hasNOBAKtag) {
|
|
43
|
+
return true
|
|
44
|
+
}
|
|
25
45
|
}
|
|
26
46
|
_selectBaseVm() {}
|
|
27
47
|
|
|
@@ -18,6 +18,7 @@ const asyncEach = async (iterable, fn, thisArg = iterable) => {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const Abstract = class AbstractVmBackupRunner {
|
|
21
|
+
_hasTransferredData
|
|
21
22
|
// calls fn for each function, warns of any errors, and throws only if there are no writers left
|
|
22
23
|
async _callWriters(fn, step, parallel = true) {
|
|
23
24
|
const writers = this._writers
|
|
@@ -71,6 +72,14 @@ export const Abstract = class AbstractVmBackupRunner {
|
|
|
71
72
|
if (this._healthCheckSr === undefined) {
|
|
72
73
|
return
|
|
73
74
|
}
|
|
75
|
+
if (this._hasTransferredData === undefined) {
|
|
76
|
+
throw new Error('Missing tag to check there are some transferred data ')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!this._hasTransferredData) {
|
|
80
|
+
Task.info(`No healthCheck needed because no data was transferred.`)
|
|
81
|
+
return
|
|
82
|
+
}
|
|
74
83
|
|
|
75
84
|
// check if current VM has tags
|
|
76
85
|
const tags = this._tags
|
|
@@ -141,7 +141,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
|
|
141
141
|
|
|
142
142
|
const settings = this._settings
|
|
143
143
|
|
|
144
|
-
if (this._mustDoSnapshot()) {
|
|
144
|
+
if (await this._mustDoSnapshot()) {
|
|
145
145
|
await Task.run({ name: 'snapshot' }, async () => {
|
|
146
146
|
if (!settings.bypassVdiChainsCheck) {
|
|
147
147
|
await vm.$assertHealthyVdiChains()
|
|
@@ -324,7 +324,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
|
|
324
324
|
throw new Error('Not implemented')
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
_mustDoSnapshot() {
|
|
327
|
+
async _mustDoSnapshot() {
|
|
328
328
|
throw new Error('Not implemented')
|
|
329
329
|
}
|
|
330
330
|
|
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.
|
|
11
|
+
"version": "0.64.0",
|
|
12
12
|
"engines": {
|
|
13
13
|
"node": ">=14.18"
|
|
14
14
|
},
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"@vates/decorate-with": "^2.1.0",
|
|
26
26
|
"@vates/disposable": "^0.1.6",
|
|
27
27
|
"@vates/fuse-vhd": "^2.1.2",
|
|
28
|
-
"@vates/generator-toolbox": "^1.0.
|
|
29
|
-
"@vates/nbd-client": "^3.
|
|
28
|
+
"@vates/generator-toolbox": "^1.0.4",
|
|
29
|
+
"@vates/nbd-client": "^3.2.0",
|
|
30
30
|
"@vates/parse-duration": "^0.1.1",
|
|
31
31
|
"@xen-orchestra/async-map": "^0.1.2",
|
|
32
32
|
"@xen-orchestra/disk-transform": "^1.1.0",
|
|
33
|
-
"@xen-orchestra/fs": "^4.6.
|
|
33
|
+
"@xen-orchestra/fs": "^4.6.3",
|
|
34
34
|
"@xen-orchestra/log": "^0.7.1",
|
|
35
35
|
"@xen-orchestra/qcow2": "^1.0.0",
|
|
36
36
|
"@xen-orchestra/template": "^0.1.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"uuid": "^9.0.0",
|
|
53
53
|
"value-matcher": "^0.2.0",
|
|
54
54
|
"vhd-lib": "^4.14.0",
|
|
55
|
-
"xen-api": "^4.7.
|
|
55
|
+
"xen-api": "^4.7.4",
|
|
56
56
|
"yazl": "^2.5.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"tmp": "^0.2.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@xen-orchestra/xapi": "^8.
|
|
65
|
+
"@xen-orchestra/xapi": "^8.4.0"
|
|
66
66
|
},
|
|
67
67
|
"license": "AGPL-3.0-or-later",
|
|
68
68
|
"author": {
|