@xen-orchestra/backups 0.56.0 → 0.58.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.
- package/README.md +13 -0
- package/RemoteAdapter.mjs +5 -1
- package/_cleanVm.mjs +1 -1
- package/_getOldEntries.mjs +1 -1
- package/_runners/_vmRunners/_Abstract.mjs +5 -2
- package/_runners/_vmRunners/_AbstractXapi.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -12,6 +12,19 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/backu
|
|
|
12
12
|
npm install --save @xen-orchestra/backups
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
## Changing the default backup configuration
|
|
18
|
+
|
|
19
|
+
This library receives a backup configuration from `xo-server` or `xo-proxy`. This configuration is split between multiple properties:
|
|
20
|
+
|
|
21
|
+
- `config` contains values related to the general backup configuration
|
|
22
|
+
- `config.defaultSettings`, `config.vm.defaultSettings` and `config.metadata.defaultSettings` contain values related to backup jobs default settings:
|
|
23
|
+
- `config.vm.defaultSettings` is related to VM backup jobs (see [DEFAULT_XAPI_VM_SETTINGS](https://github.com/vatesfr/xen-orchestra/blob/568e14f7eec7c3ddf685d324ad4733a3ef577995/%40xen-orchestra/backups/_runners/VmsRemote.mjs#L15))
|
|
24
|
+
- `config.metadata.defaultSettings` is related to metadata backup jobs (see [DEFAULT_METADATA_SETTINGS](https://github.com/vatesfr/xen-orchestra/blob/568e14f7eec7c3ddf685d324ad4733a3ef577995/%40xen-orchestra/backups/_runners/Metadata.mjs#L12))
|
|
25
|
+
- `config.defaultSettings` is related to all backup jobs (see [DEFAULT_SETTINGS](https://github.com/vatesfr/xen-orchestra/blob/568e14f7eec7c3ddf685d324ad4733a3ef577995/%40xen-orchestra/backups/_runners/_Abstract.mjs#L7))
|
|
26
|
+
- in case of duplicate value, `config.vm.defaultSettings` and `config.metadata.defaultSettings` will prevail over `config.defaultSettings`, and a defined job setting will prevail over any `defaultSettings`
|
|
27
|
+
|
|
15
28
|
## Contributions
|
|
16
29
|
|
|
17
30
|
Contributions are _very_ welcomed, either on the documentation or on
|
package/RemoteAdapter.mjs
CHANGED
|
@@ -700,7 +700,11 @@ export class RemoteAdapter {
|
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
|
|
703
|
-
async outputStream(
|
|
703
|
+
async outputStream(
|
|
704
|
+
path,
|
|
705
|
+
input,
|
|
706
|
+
{ checksum = !this._handler.isEncrypted, maxStreamLength, streamLength, validator = noop } = {}
|
|
707
|
+
) {
|
|
704
708
|
const container = watchStreamSize(input)
|
|
705
709
|
await this._handler.outputStream(path, input, {
|
|
706
710
|
checksum,
|
package/_cleanVm.mjs
CHANGED
|
@@ -575,7 +575,7 @@ export async function cleanVm(
|
|
|
575
575
|
if (mergedSize) {
|
|
576
576
|
// all disks are now key disk
|
|
577
577
|
metadata.isVhdDifferencing = {}
|
|
578
|
-
for (const id of Object.
|
|
578
|
+
for (const id of Object.keys(metadata.vdis ?? {})) {
|
|
579
579
|
metadata.isVhdDifferencing[`${id}.vhd`] = false
|
|
580
580
|
}
|
|
581
581
|
}
|
package/_getOldEntries.mjs
CHANGED
|
@@ -27,7 +27,7 @@ const LTR_DEFINITIONS = {
|
|
|
27
27
|
copy.date(date.date() - firstDayOfWeek)
|
|
28
28
|
// warning, the year in term of week may different from YYYY
|
|
29
29
|
// since the computation of the first week of a year is timezone dependant
|
|
30
|
-
return copy.format('gggg-
|
|
30
|
+
return copy.format('gggg-ww')
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
ancestor: 'daily',
|
|
@@ -74,9 +74,12 @@ export const Abstract = class AbstractVmBackupRunner {
|
|
|
74
74
|
|
|
75
75
|
// check if current VM has tags
|
|
76
76
|
const tags = this._tags
|
|
77
|
-
const intersect = settings.healthCheckVmsWithTags.some(t => tags.includes(t))
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
// accept both 'xo:no-health-check' and 'xo:no-health-check=reason'
|
|
79
|
+
const vmAlwaysIgnored = tags.some(t => t.startsWith('xo:no-health-check'))
|
|
80
|
+
const intersect = !vmAlwaysIgnored && settings.healthCheckVmsWithTags.some(t => tags.includes(t))
|
|
81
|
+
|
|
82
|
+
if (vmAlwaysIgnored || (settings.healthCheckVmsWithTags.length !== 0 && !intersect)) {
|
|
80
83
|
// create a task to have an info in the logs and reports
|
|
81
84
|
return Task.run(
|
|
82
85
|
{
|
|
@@ -150,7 +150,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
|
|
150
150
|
try {
|
|
151
151
|
// enable CBT on all disks if possible
|
|
152
152
|
const diskRefs = await xapi.VM_getDisks(vm.$ref)
|
|
153
|
-
await Promise.all(diskRefs.map(diskRef => xapi.
|
|
153
|
+
await Promise.all(diskRefs.map(diskRef => xapi.callAsync('VDI.enable_cbt', diskRef)))
|
|
154
154
|
} catch (error) {
|
|
155
155
|
Task.info(`couldn't enable CBT`, error)
|
|
156
156
|
}
|
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.58.0",
|
|
12
12
|
"engines": {
|
|
13
13
|
"node": ">=14.18"
|
|
14
14
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@vates/nbd-client": "^3.1.2",
|
|
29
29
|
"@vates/parse-duration": "^0.1.1",
|
|
30
30
|
"@xen-orchestra/async-map": "^0.1.2",
|
|
31
|
-
"@xen-orchestra/fs": "^4.
|
|
31
|
+
"@xen-orchestra/fs": "^4.4.0",
|
|
32
32
|
"@xen-orchestra/log": "^0.7.1",
|
|
33
33
|
"@xen-orchestra/template": "^0.1.0",
|
|
34
34
|
"app-conf": "^3.0.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"uuid": "^9.0.0",
|
|
50
50
|
"value-matcher": "^0.2.0",
|
|
51
51
|
"vhd-lib": "^4.11.2",
|
|
52
|
-
"xen-api": "^4.
|
|
52
|
+
"xen-api": "^4.7.0",
|
|
53
53
|
"yazl": "^2.5.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"tmp": "^0.2.1"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@xen-orchestra/xapi": "^7.
|
|
62
|
+
"@xen-orchestra/xapi": "^7.11.0"
|
|
63
63
|
},
|
|
64
64
|
"license": "AGPL-3.0-or-later",
|
|
65
65
|
"author": {
|