feat(xo-server): use @xen-orchestra/backups lib to run VM backups (#5642)

This commit is contained in:
badrAZ 2021-03-08 14:05:41 +01:00 committed by GitHub
parent d601290c46
commit 0811da9014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 137 additions and 1387 deletions

View File

@ -75,25 +75,6 @@ defaultSignInPage = '/signin'
# This is used to mitigate bruteforce attacks without being visible to users.
throttlingDelay = '2 seconds'
[backup]
# Mode to use for newly created backup directories
#
# https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation
dirMode = 0o700
# Delay for which backups listing on a remote is cached
listingDebounce = '1 min'
# This is a work-around.
#
# See https://github.com/vatesfr/xen-orchestra/pull/4674
maxMergedDeltasPerRun = 2
# Duration for which we can wait for the backup size before returning
#
# It should be short to avoid blocking the display of the available backups.
vmBackupSizeTimeout = '2 seconds'
[backups]
# Mode to use for newly created backup directories
#
@ -111,6 +92,24 @@ reportWhen = 'failure'
retentionPoolMetadata = 0
retentionXoMetadata = 0
[backups.vm.defaultSettings]
bypassVdiChainsCheck = false
checkpointSnapshot = false
concurrency = 2
deleteFirst = false
exportRetention = 0
fullInterval = 0
offlineBackup = false
offlineSnapshot = false
snapshotRetention = 0
timeout = 0
vmTimeout = 0
# This is a work-around.
#
# See https://github.com/vatesfr/xen-orchestra/pull/4674
maxMergedDeltasPerRun = 2
# https://github.com/naugtur/blocked-at#params-and-return-value
[blockedAtOptions]
enabled = false

View File

@ -129,7 +129,6 @@
"split2": "^3.1.1",
"stack-chain": "^2.0.0",
"stoppable": "^1.0.5",
"strict-timeout": "^1.0.0",
"struct-fu": "^1.2.0",
"subleveldown": "^5.0.1",
"tar-stream": "^2.0.1",

View File

@ -10,7 +10,7 @@ import pick from 'lodash/pick'
import tmp from 'tmp'
import { createLogger } from '@xen-orchestra/log'
import { randomBytes } from 'crypto'
import { dirname, resolve } from 'path'
import { resolve } from 'path'
import { utcFormat, utcParse } from 'd3-time-format'
import { fromCallback, pAll, pReflect, promisify } from 'promise-toolbox'
@ -208,11 +208,6 @@ export const popProperty = obj => {
// -------------------------------------------------------------------
// resolve a relative path from a file
export const resolveRelativeFromFile = (file, path) => resolve('/', dirname(file), path).slice(1)
// -------------------------------------------------------------------
// Format a date in ISO 8601 in a safe way to be used in filenames
// (even on Windows).
export const safeDateFormat = utcFormat('%Y%m%dT%H%M%SZ')

View File

@ -4,12 +4,10 @@ import { type Readable } from 'stream'
declare export function getPseudoRandomBytes(n: number): Buffer
declare export function resolveRelativeFromFile(file: string, path: string): string
declare export function safeDateFormat(timestamp: number): string
declare export function serializeError(error: Error): Object
declare export function streamToBuffer(stream: Readable): Promise<Buffer>
export type SimpleIdPattern = {| id: string | {| __or: string[] |}, |}
export type SimpleIdPattern = {| id: string | {| __or: string[] |} |}

View File

@ -3,7 +3,7 @@ import camelCase from 'lodash/camelCase'
import isEqual from 'lodash/isEqual'
import isPlainObject from 'lodash/isPlainObject'
import pickBy from 'lodash/pickBy'
import { utcFormat, utcParse } from 'd3-time-format'
import { utcParse } from 'd3-time-format'
import { satisfies as versionSatisfies } from 'semver'
import { camelToSnakeCase, forEach, isInteger, map, mapFilter, mapToArray, noop } from '../utils'
@ -76,10 +76,6 @@ export const getVmDisks = vm => {
// -------------------------------------------------------------------
// Format a date (pseudo ISO 8601) from one XenServer get by
// xapi.call('host.get_servertime', host.$ref) for example
export const formatDateTime = utcFormat('%Y%m%dT%H:%M:%SZ')
const parseDateTimeHelper = utcParse('%Y%m%dT%H:%M:%SZ')
export function parseDateTime(str, defaultValue) {

File diff suppressed because it is too large Load Diff

View File

@ -17301,11 +17301,6 @@ strict-event-emitter-types@~2.0.0:
resolved "https://registry.yarnpkg.com/strict-event-emitter-types/-/strict-event-emitter-types-2.0.0.tgz#05e15549cb4da1694478a53543e4e2f4abcf277f"
integrity sha512-Nk/brWYpD85WlOgzw5h173aci0Teyv8YdIAEtV+N88nDB0dLlazZyJMIsN6eo1/AR61l+p6CJTG1JIyFaoNEEA==
strict-timeout@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/strict-timeout/-/strict-timeout-1.0.0.tgz#f77c6dedec379a3b9d8d922bee0398ae5b1415ee"
integrity sha512-CW2XC7sLJ2Qvc69sv9jFal48c6+hupGzFF04nJOsThriJcPfHO9iAtVnr6jvHWyvDj1XlOOFJkljZneex97STg==
strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"