mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-12-02 13:24:35 -06:00
Compare commits
1 Commits
web-core/r
...
docs/incre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89f728c4dd |
@@ -25,17 +25,6 @@ const task = new Task({
|
||||
const { reason } = event
|
||||
}
|
||||
},
|
||||
|
||||
// only for a detached task, inherited by its subtasks
|
||||
//
|
||||
// if true, a subtask created after the abort of its parent is aborted, and ended, right away: running it rejects
|
||||
// with the abort reason without calling its function, so the remaining steps of an aborted task are skipped
|
||||
skipSubtasksAfterAbort: false,
|
||||
|
||||
// if true, this subtask does not follow the abort of its parent, so that it still runs after an abort
|
||||
//
|
||||
// meant for the cleanup steps of an aborted task
|
||||
cleanup: false,
|
||||
})
|
||||
|
||||
// this field is settable once before being observed
|
||||
@@ -49,12 +38,9 @@ task.id
|
||||
// - failure
|
||||
task.status
|
||||
|
||||
// Triggers the abort signal associated to the task, and the ones of its subtasks.
|
||||
// Triggers the abort signal associated to the task.
|
||||
//
|
||||
// A running task is only requested to abort: it is up to its function to handle or not this signal.
|
||||
//
|
||||
// A task that is not running ends right away as failed, with `reason` as result, and running it afterwards rejects
|
||||
// with `reason` without calling its function. See `skipSubtasksAfterAbort` for the subtasks created after the abort.
|
||||
// This simply requests the task to abort, it will be up to the task to handle or not this signal.
|
||||
task.abort(reason)
|
||||
|
||||
// if fn rejects, the task will be marked as failed
|
||||
|
||||
@@ -41,17 +41,6 @@ const task = new Task({
|
||||
const { reason } = event
|
||||
}
|
||||
},
|
||||
|
||||
// only for a detached task, inherited by its subtasks
|
||||
//
|
||||
// if true, a subtask created after the abort of its parent is aborted, and ended, right away: running it rejects
|
||||
// with the abort reason without calling its function, so the remaining steps of an aborted task are skipped
|
||||
skipSubtasksAfterAbort: false,
|
||||
|
||||
// if true, this subtask does not follow the abort of its parent, so that it still runs after an abort
|
||||
//
|
||||
// meant for the cleanup steps of an aborted task
|
||||
cleanup: false,
|
||||
})
|
||||
|
||||
// this field is settable once before being observed
|
||||
@@ -65,12 +54,9 @@ task.id
|
||||
// - failure
|
||||
task.status
|
||||
|
||||
// Triggers the abort signal associated to the task, and the ones of its subtasks.
|
||||
// Triggers the abort signal associated to the task.
|
||||
//
|
||||
// A running task is only requested to abort: it is up to its function to handle or not this signal.
|
||||
//
|
||||
// A task that is not running ends right away as failed, with `reason` as result, and running it afterwards rejects
|
||||
// with `reason` without calling its function. See `skipSubtasksAfterAbort` for the subtasks created after the abort.
|
||||
// This simply requests the task to abort, it will be up to the task to handle or not this signal.
|
||||
task.abort(reason)
|
||||
|
||||
// if fn rejects, the task will be marked as failed
|
||||
|
||||
@@ -35,17 +35,6 @@ function define(object, property, value) {
|
||||
|
||||
const noop = Function.prototype
|
||||
|
||||
// aborts `controller` when `signal` is aborted, right away if it already is
|
||||
//
|
||||
// `signal.aborted` must be checked: the abort event of an already aborted signal is never dispatched again
|
||||
function followSignal(signal, controller) {
|
||||
if (signal.aborted) {
|
||||
controller.abort(signal.reason)
|
||||
} else {
|
||||
signal.addEventListener('abort', () => controller.abort(signal.reason), { once: true })
|
||||
}
|
||||
}
|
||||
|
||||
const FAILURE = 'failure'
|
||||
const PENDING = 'pending'
|
||||
const SUCCESS = 'success'
|
||||
@@ -97,12 +86,11 @@ class Task {
|
||||
}
|
||||
}
|
||||
|
||||
// These properties should not be used outside the class
|
||||
// These two properties should not be used outside the class
|
||||
//
|
||||
// To ensure compatibility between multiple versions of this lib, they are kept public for now
|
||||
_abortController = new AbortController()
|
||||
_onProgress
|
||||
_skipSubtasksAfterAbort = false
|
||||
|
||||
get id() {
|
||||
// Use a compact, sortable, string representation of the creation date,
|
||||
@@ -122,26 +110,18 @@ class Task {
|
||||
return this.#status
|
||||
}
|
||||
|
||||
// `skipSubtasksAfterAbort` (root task only, inherited by its subtasks): a subtask created after the abort is
|
||||
// aborted right away, so the steps of an aborted task are skipped.
|
||||
//
|
||||
// `cleanup`: this subtask does not follow the abort of its parent, so that it still runs after an abort.
|
||||
constructor({ properties, onProgress, cleanup = false, skipSubtasksAfterAbort = false } = {}) {
|
||||
constructor({ properties, onProgress } = {}) {
|
||||
this.#startData = { properties }
|
||||
|
||||
// the parent signal this task's abort follows, once its own listener is registered
|
||||
let parentSignal
|
||||
if (onProgress !== undefined) {
|
||||
this._onProgress = onProgress
|
||||
this._skipSubtasksAfterAbort = skipSubtasksAfterAbort
|
||||
} else {
|
||||
const parent = getTask()
|
||||
if (parent !== undefined) {
|
||||
// `_skipSubtasksAfterAbort` is missing on a task created by an older version of this library
|
||||
this._skipSubtasksAfterAbort = parent._skipSubtasksAfterAbort === true
|
||||
if (!cleanup) {
|
||||
parentSignal = parent._abortController.signal
|
||||
}
|
||||
const { signal } = parent._abortController
|
||||
signal.addEventListener('abort', () => {
|
||||
this._abortController.abort(signal.reason)
|
||||
})
|
||||
|
||||
this._onProgress = parent._onProgress
|
||||
this.#startData.parentId = parent.id
|
||||
@@ -158,23 +138,10 @@ class Task {
|
||||
this.#emit('abortionRequested', { reason: signal.reason })
|
||||
|
||||
if (!this.#running) {
|
||||
this.#endedByAbort = true
|
||||
this.#end(FAILURE, signal.reason)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (parentSignal !== undefined) {
|
||||
if (this._skipSubtasksAfterAbort) {
|
||||
// after the listener above: a task created under an aborted parent is aborted, and ended, right away (its
|
||||
// `run()` then rejects without calling its function), as if its parent had been aborted just after its creation
|
||||
followSignal(parentSignal, this._abortController)
|
||||
} else {
|
||||
parentSignal.addEventListener('abort', () => {
|
||||
this._abortController.abort(parentSignal.reason)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abort(reason) {
|
||||
@@ -225,14 +192,8 @@ class Task {
|
||||
return result
|
||||
}
|
||||
|
||||
#endedByAbort = false
|
||||
#running = false
|
||||
async runInside(fn) {
|
||||
// aborted before it could run, either directly or because it was created under an aborted parent
|
||||
if (this.#endedByAbort) {
|
||||
throw this._abortController.signal.reason
|
||||
}
|
||||
|
||||
assert.equal(this.status, PENDING)
|
||||
assert.equal(this.#running, false)
|
||||
this.#running = true
|
||||
|
||||
@@ -175,213 +175,6 @@ describe('Task', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('subtask of an aborted task', function () {
|
||||
// events of `subtask`, in the order they were emitted to the root task
|
||||
const subtaskEventTypes = (task, subtask) => task.$events.filter(_ => _.id === subtask.id).map(_ => _.type)
|
||||
|
||||
describe('without skipSubtasksAfterAbort', function () {
|
||||
it('runs when created after the abort, as before this option existed', async function () {
|
||||
const task = createTask()
|
||||
|
||||
await task.run(async () => {
|
||||
task.abort()
|
||||
|
||||
assert.equal(
|
||||
await Task.run(() => {
|
||||
assert.equal(Task.abortSignal.aborted, false)
|
||||
return 'done'
|
||||
}),
|
||||
'done'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
it('is aborted when its parent is aborted while it runs', async function () {
|
||||
const task = createTask()
|
||||
|
||||
await task.run(() =>
|
||||
Task.run(() => {
|
||||
task.abort()
|
||||
assert.equal(Task.abortSignal.aborted, true)
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('with skipSubtasksAfterAbort', function () {
|
||||
it('does not run when created after the abort', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
const reason = {}
|
||||
let called = false
|
||||
let subtask
|
||||
|
||||
await task.run(async () => {
|
||||
task.abort(reason)
|
||||
|
||||
subtask = new Task()
|
||||
await assert.rejects(
|
||||
subtask.run(() => {
|
||||
called = true
|
||||
}),
|
||||
error => error === reason
|
||||
)
|
||||
})
|
||||
|
||||
assert.equal(called, false)
|
||||
assert.equal(subtask.status, 'failure')
|
||||
assert.deepEqual(subtaskEventTypes(task, subtask), ['start', 'abortionRequested', 'end'])
|
||||
const end = task.$events.findLast(_ => _.id === subtask.id)
|
||||
assert.equal(end.status, 'failure')
|
||||
assert.equal(end.result, reason)
|
||||
})
|
||||
|
||||
it('does not run a step started with Task.run() after the abort', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
let called = false
|
||||
|
||||
await task.run(async () => {
|
||||
task.abort()
|
||||
|
||||
await assert.rejects(
|
||||
Task.run({ properties: { name: 'step' } }, () => {
|
||||
called = true
|
||||
}),
|
||||
{ name: 'AbortError' }
|
||||
)
|
||||
})
|
||||
|
||||
assert.equal(called, false)
|
||||
})
|
||||
|
||||
it('does not run when created before the abort and run after it', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
const reason = {}
|
||||
let called = false
|
||||
let subtask
|
||||
|
||||
await task.run(async () => {
|
||||
subtask = new Task()
|
||||
task.abort(reason)
|
||||
|
||||
await assert.rejects(
|
||||
subtask.run(() => {
|
||||
called = true
|
||||
}),
|
||||
error => error === reason
|
||||
)
|
||||
})
|
||||
|
||||
assert.equal(called, false)
|
||||
assert.equal(subtask.status, 'failure')
|
||||
assert.deepEqual(subtaskEventTypes(task, subtask), ['start', 'abortionRequested', 'end'])
|
||||
})
|
||||
|
||||
it('is inherited by the subtasks of the subtasks', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
let called = false
|
||||
|
||||
await task.run(() =>
|
||||
Task.run(async () => {
|
||||
task.abort()
|
||||
|
||||
await assert.rejects(
|
||||
Task.run(() => {
|
||||
called = true
|
||||
}),
|
||||
{ name: 'AbortError' }
|
||||
)
|
||||
}).catch(noop)
|
||||
)
|
||||
|
||||
assert.equal(called, false)
|
||||
})
|
||||
|
||||
it('is ignored on a subtask', async function () {
|
||||
const task = createTask()
|
||||
|
||||
await task.run(async () => {
|
||||
task.abort()
|
||||
|
||||
assert.equal(await Task.run({ skipSubtasksAfterAbort: true }, () => Task.run(() => 'done')), 'done')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('still throws when run after it ended for another reason', async function () {
|
||||
const task = createTask()
|
||||
task.start()
|
||||
task.success()
|
||||
|
||||
await assert.rejects(task.run(noop), { name: 'AssertionError' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('cleanup subtask', function () {
|
||||
it('runs when created after the abort', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
let subtask
|
||||
|
||||
await task.run(async () => {
|
||||
task.abort()
|
||||
|
||||
subtask = new Task({ cleanup: true })
|
||||
const result = await subtask.run(() => {
|
||||
assert.equal(Task.abortSignal.aborted, false)
|
||||
return 'cleaned'
|
||||
})
|
||||
assert.equal(result, 'cleaned')
|
||||
})
|
||||
|
||||
assert.equal(subtask.status, 'success')
|
||||
})
|
||||
|
||||
it('runs through Task.run() with the cleanup option', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
|
||||
await task.run(async () => {
|
||||
task.abort()
|
||||
|
||||
assert.equal(await Task.run({ properties: { name: 'clean-vm' }, cleanup: true }, () => 'cleaned'), 'cleaned')
|
||||
})
|
||||
})
|
||||
|
||||
it('is not aborted when its parent is aborted while it runs', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
|
||||
await task.run(() =>
|
||||
Task.run({ cleanup: true }, () => {
|
||||
task.abort()
|
||||
assert.equal(Task.abortSignal.aborted, false)
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
it('lets its own subtasks run normally', async function () {
|
||||
const task = createTask({ skipSubtasksAfterAbort: true })
|
||||
|
||||
await task.run(async () => {
|
||||
task.abort()
|
||||
|
||||
const result = await Task.run({ cleanup: true }, () => Task.run(() => 'done'))
|
||||
assert.equal(result, 'done')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('without abort', function () {
|
||||
it('emits the same events for a task and its subtasks', async function () {
|
||||
const task = createTask()
|
||||
|
||||
await task.run(() => Task.run({ properties: { name: 'step' } }, () => Task.run(() => 'foo')))
|
||||
|
||||
assert.deepEqual(
|
||||
task.$events.map(_ => _.type),
|
||||
['start', 'start', 'start', 'end', 'end', 'end']
|
||||
)
|
||||
assert.equal(task.status, 'success')
|
||||
})
|
||||
})
|
||||
|
||||
describe('#failure()', function () {
|
||||
const error = new Error()
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@vates/types",
|
||||
"private": false,
|
||||
"version": "3.2.0",
|
||||
"version": "3.1.0",
|
||||
"main": "./dist/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@vates/types": "^3.2.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"rimraf": "^6.0.1",
|
||||
"typescript": "~5.6",
|
||||
"typescript-eslint": "^8.61.0"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"tar-stream": "^3.1.8",
|
||||
"@types/tar-stream": "^3.1.4",
|
||||
"tmp": "^0.2.1",
|
||||
"@vates/types": "^3.2.0"
|
||||
"@vates/types": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xen-orchestra/log": "^1.0.0",
|
||||
|
||||
@@ -21,9 +21,6 @@ export class HealthCheckVmBackup {
|
||||
const xapi = this.#xapi
|
||||
const restoredId = restoredVm.uuid
|
||||
|
||||
// the health check stops waiting once the backup is aborted; the caller removes the restored VM
|
||||
const signal = Task.abortSignal
|
||||
|
||||
// remove vifs
|
||||
await Promise.all(restoredVm.$VIFs.map(vif => xapi.callAsync('VIF.destroy', vif.$ref)))
|
||||
const waitForScript = restoredVm.tags.includes('xo-backup-health-check-xenstore')
|
||||
@@ -36,7 +33,6 @@ export class HealthCheckVmBackup {
|
||||
// start Vm
|
||||
|
||||
await xapi.callAsync(
|
||||
signal,
|
||||
'VM.start',
|
||||
restoredVm.$ref,
|
||||
false, // Start paused?
|
||||
@@ -55,7 +51,6 @@ export class HealthCheckVmBackup {
|
||||
// wait for the 'Running' event to be really stored in local xapi object cache
|
||||
|
||||
restoredVm = await xapi.waitObjectState(restoredVm.$ref, vm => vm.power_state === 'Running', {
|
||||
signal,
|
||||
timeout: remainingTimeout,
|
||||
timeoutMessage: refOrUuid =>
|
||||
`local xapi did not get Running state for VM ${refOrUuid} after ${timeout / 1000} second`,
|
||||
@@ -66,7 +61,6 @@ export class HealthCheckVmBackup {
|
||||
|
||||
// wait for the guest tools to be detected
|
||||
await xapi.waitObjectState(restoredVm.guest_metrics, gm => gm?.PV_drivers_detected, {
|
||||
signal,
|
||||
timeout: remainingTimeout,
|
||||
timeoutMessage: refOrUuid =>
|
||||
`timeout reached while waiting for ${refOrUuid} to report the driver version through the Xen tools. Please check or update the Xen tools.`,
|
||||
@@ -83,7 +77,6 @@ export class HealthCheckVmBackup {
|
||||
(vm.xenstore_data['vm-data/xo-backup-health-check'] === 'success' ||
|
||||
vm.xenstore_data['vm-data/xo-backup-health-check'] === 'failure'),
|
||||
{
|
||||
signal,
|
||||
timeout: remainingTimeout,
|
||||
timeoutMessage: refOrUuid =>
|
||||
`timeout reached while waiting for ${refOrUuid} to report the startup script execution.`,
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { HealthCheckVmBackup } from './HealthCheckVmBackup.mjs'
|
||||
|
||||
describe('HealthCheckVmBackup#run() after an abort', () => {
|
||||
it('stops waiting for the restored VM without waiting for its timeout', async () => {
|
||||
// resolved once the restored VM is started
|
||||
const { promise: pStarted, resolve: onStarted } = Promise.withResolvers()
|
||||
const xapi = {
|
||||
callAsync: async (...args) => {
|
||||
if (args.includes('VM.start')) {
|
||||
onStarted()
|
||||
}
|
||||
},
|
||||
// the restored VM never reaches the expected state: only an abort can end the wait
|
||||
waitObjectState: (ref, predicate, { signal } = {}) =>
|
||||
new Promise((resolve, reject) => {
|
||||
// as `Xapi#waitObjectState()` does, rejects right away when already aborted
|
||||
if (signal?.aborted) {
|
||||
reject(signal.reason)
|
||||
} else {
|
||||
signal?.addEventListener('abort', () => reject(signal.reason), { once: true })
|
||||
}
|
||||
}),
|
||||
}
|
||||
const healthCheck = new HealthCheckVmBackup({
|
||||
restoredVm: { $ref: 'vm-ref', $VIFs: [], tags: [], uuid: 'vm-uuid' },
|
||||
timeout: 60e3,
|
||||
xapi,
|
||||
})
|
||||
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
const result = await vmTask
|
||||
.run(async () => {
|
||||
const pRun = healthCheck.run()
|
||||
await pStarted
|
||||
vmTask.abort()
|
||||
return Promise.race([
|
||||
pRun.then(
|
||||
() => 'resolved',
|
||||
error => error.name
|
||||
),
|
||||
new Promise(resolve => setTimeout(resolve, 1e3, 'still waiting')),
|
||||
])
|
||||
})
|
||||
.catch(error => error.name)
|
||||
|
||||
assert.equal(result, 'AbortError')
|
||||
})
|
||||
})
|
||||
@@ -3,7 +3,6 @@ import assert from 'node:assert'
|
||||
import { formatFilenameDate } from './_filenameDate.mjs'
|
||||
import { importIncrementalVm } from './_incrementalVm.mjs'
|
||||
import { liveMountXapiLabels } from './liveMountXapiLabels.mjs'
|
||||
import { destroyOnAbort } from './_destroyOnAbort.mjs'
|
||||
import { watchStreamSize } from './_watchStreamSize.mjs'
|
||||
import { decorateClass } from '@vates/decorate-with'
|
||||
import { Task } from '@vates/task'
|
||||
@@ -426,13 +425,6 @@ export class ImportVmBackup {
|
||||
}
|
||||
backup = await adapter.readFullVmBackup(metadata)
|
||||
watchStreamSize(backup, sizeContainer)
|
||||
|
||||
// the restore stops once aborted (e.g. the health check of an aborted backup): a full backup is a stream that
|
||||
// `VM_import()` sends as is, destroying it fails the import, and XAPI drops the partial VM
|
||||
//
|
||||
// set up as soon as the stream exists, so that an abort landing before the import starts, or leaving the transfer
|
||||
// subtask unable to run, still closes it (a file handle or an S3 request)
|
||||
$defer(destroyOnAbort(backup, Task.abortSignal))
|
||||
} else {
|
||||
assert.strictEqual(metadata.mode, 'delta')
|
||||
|
||||
@@ -459,21 +451,12 @@ export class ImportVmBackup {
|
||||
additionalVmTag !== undefined && vm.add_tags(additionalVmTag),
|
||||
])
|
||||
|
||||
const signal = Task.abortSignal
|
||||
let vmRef
|
||||
try {
|
||||
vmRef = isFull
|
||||
? await xapi.VM_import(backup, srRef, onVmCreation)
|
||||
: await importIncrementalVm(backup, await xapi.getRecord('SR', srRef), {
|
||||
newMacAddresses,
|
||||
signal,
|
||||
vmNamePrefix,
|
||||
})
|
||||
} catch (error) {
|
||||
// the error of the destroyed stream: report the abort instead
|
||||
signal?.throwIfAborted()
|
||||
throw error
|
||||
}
|
||||
const vmRef = isFull
|
||||
? await xapi.VM_import(backup, srRef, onVmCreation)
|
||||
: await importIncrementalVm(backup, await xapi.getRecord('SR', srRef), {
|
||||
newMacAddresses,
|
||||
vmNamePrefix,
|
||||
})
|
||||
let size = 0
|
||||
if (isFull) {
|
||||
size = sizeContainer.size
|
||||
|
||||
@@ -304,109 +304,3 @@ describe('ImportVmBackup#_reuseNearestSnapshot()', () => {
|
||||
await assert.rejects(() => importer._reuseNearestSnapshot(new Set([SYSTEM.uuid])), /would transfer the disk/)
|
||||
})
|
||||
})
|
||||
|
||||
describe('ImportVmBackup#run() after an abort', () => {
|
||||
// a full restore whose steps `xapi` and `adapter` are controlled by the test: it reads `xva` and imports it with
|
||||
// `VM_import()`, which, as the XAPI one does, reads its input until it ends and fails when the input fails
|
||||
async function makeFullRestore({ onOpen, onSrLookup } = {}) {
|
||||
const { PassThrough } = await import('node:stream')
|
||||
const xva = new PassThrough()
|
||||
// `importing` is resolved once `VM_import()` reads the stream
|
||||
const { promise: importing, resolve: onImport } = Promise.withResolvers()
|
||||
const state = { imported: false, importing }
|
||||
const importer = new ImportVmBackup({
|
||||
adapter: {
|
||||
_handler: { _remote: {} },
|
||||
readFullVmBackup: async () => {
|
||||
await onOpen?.()
|
||||
return xva
|
||||
},
|
||||
},
|
||||
metadata: { ...makeMetadata(), mode: 'full' },
|
||||
srUuid: DEFAULT_SR,
|
||||
xapi: {
|
||||
call: async () => {
|
||||
await onSrLookup?.()
|
||||
return 'OpaqueRef:sr'
|
||||
},
|
||||
VM_import: stream =>
|
||||
new Promise((resolve, reject) => {
|
||||
state.imported = true
|
||||
onImport()
|
||||
stream.on('error', () => reject(new Error('premature close'))).resume()
|
||||
}),
|
||||
},
|
||||
})
|
||||
return { importer, state, xva }
|
||||
}
|
||||
|
||||
// the outcome of `run()`, `'still running'` if it does not settle within a second
|
||||
const outcomeOf = pRun =>
|
||||
Promise.race([
|
||||
pRun.then(
|
||||
() => 'resolved',
|
||||
error => error.name
|
||||
),
|
||||
new Promise(resolve => setTimeout(resolve, 1e3, 'still running')),
|
||||
])
|
||||
|
||||
it('stops the import of a full backup and fails with the abort', async () => {
|
||||
const { Task } = await import('@vates/task')
|
||||
const { importer, state } = await makeFullRestore()
|
||||
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
const result = await vmTask
|
||||
.run(async () => {
|
||||
const pRun = importer.run()
|
||||
await state.importing
|
||||
vmTask.abort()
|
||||
return outcomeOf(pRun)
|
||||
})
|
||||
.catch(error => error.name)
|
||||
|
||||
assert.equal(result, 'AbortError')
|
||||
})
|
||||
|
||||
it('stops a full restore aborted before its import has started, and destroys its stream', async () => {
|
||||
const { Task } = await import('@vates/task')
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
// the abort lands during the lookup of the SR, after the transfer subtask started
|
||||
const { importer, xva } = await makeFullRestore({ onSrLookup: () => vmTask.abort() })
|
||||
|
||||
const result = await vmTask.run(() => outcomeOf(importer.run())).catch(error => error.name)
|
||||
|
||||
assert.equal(result, 'AbortError')
|
||||
assert.equal(xva.destroyed, true)
|
||||
})
|
||||
|
||||
it('destroys the stream of a full backup when the abort lands while it is opened', async () => {
|
||||
const { Task } = await import('@vates/task')
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
// the transfer subtask is then created under an aborted task: it fails without running
|
||||
const { importer, state, xva } = await makeFullRestore({ onOpen: () => vmTask.abort() })
|
||||
|
||||
const result = await vmTask.run(() => outcomeOf(importer.run())).catch(error => error.name)
|
||||
|
||||
assert.equal(result, 'AbortError')
|
||||
assert.equal(state.imported, false)
|
||||
assert.equal(xva.destroyed, true, 'the stream (a file handle or an S3 request) is not left open')
|
||||
})
|
||||
|
||||
it('restores a full backup outside a task, as the proxy does', async t => {
|
||||
// `golike-defer` logs the errors of the deferred functions instead of rejecting with them
|
||||
const logError = t.mock.method(console, 'error', () => {})
|
||||
const { importer, xva } = await makeFullRestore()
|
||||
importer._xapi.VM_import = async stream => {
|
||||
stream.resume()
|
||||
throw new Error('stop after the import')
|
||||
}
|
||||
xva.end()
|
||||
|
||||
// the error of the import, not one of the abort handling, which has no signal to listen to
|
||||
await assert.rejects(importer.run(), { message: 'stop after the import' })
|
||||
assert.deepEqual(
|
||||
logError.mock.calls.map(call => String(call.arguments[0])),
|
||||
[]
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -317,34 +317,6 @@ describe('RemoteAdapter#writeVhd validated by checkDisk', { concurrency: 1 }, ()
|
||||
assert.deepEqual(await handler.list(basePath, { ignoreMissing: true }), useVhdDirectory ? ['data'] : [])
|
||||
assert.deepEqual(await handler.list(`${basePath}/data`, { ignoreMissing: true }), [])
|
||||
})
|
||||
|
||||
test(`${mode}: an aborted write stops and leaves no disk behind`, async () => {
|
||||
const adapter = await getAdapter({ useVhdDirectory })
|
||||
const path = `${basePath}/${adapter.getVhdFileName('base')}`
|
||||
const controller = new AbortController()
|
||||
const read = []
|
||||
// the backup is aborted once the first block has been read
|
||||
class AbortedDisk extends MockDisk {
|
||||
async readBlock(index) {
|
||||
read.push(index)
|
||||
if (read.length === 1) {
|
||||
controller.abort()
|
||||
}
|
||||
return super.readBlock(index)
|
||||
}
|
||||
}
|
||||
|
||||
await assert.rejects(
|
||||
adapter.writeVhd(path, new AbortedDisk(8, [0, 1, 2, 3, 4, 5, 6, 7], 0x11), {
|
||||
signal: controller.signal,
|
||||
uuid: uniqueIdBuffer(),
|
||||
}),
|
||||
{ name: 'AbortError' }
|
||||
)
|
||||
|
||||
assert.deepEqual(await handler.list(basePath, { ignoreMissing: true }), useVhdDirectory ? ['data'] : [])
|
||||
assert.deepEqual(await handler.list(`${basePath}/data`, { ignoreMissing: true }), [])
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -687,14 +687,12 @@ export class RemoteAdapter {
|
||||
return path
|
||||
}
|
||||
|
||||
// `signal` stops the write once aborted: the partial disk is then removed
|
||||
async writeVhd(path, disk, { signal, validator = noop, writeBlockConcurrency, uuid, parentUuid, parentPath } = {}) {
|
||||
async writeVhd(path, disk, { validator = noop, writeBlockConcurrency, uuid, parentUuid, parentPath } = {}) {
|
||||
const handler = this._handler
|
||||
|
||||
if (this.useVhdDirectory()) {
|
||||
return await writeToVhdDirectory({
|
||||
disk,
|
||||
signal,
|
||||
target: {
|
||||
handler,
|
||||
path,
|
||||
@@ -707,11 +705,7 @@ export class RemoteAdapter {
|
||||
},
|
||||
})
|
||||
} else {
|
||||
const stream = await toVhdStream(disk, { signal, uuid, parentUuid, parentPath })
|
||||
// the stream starts reading the disk before the output stream is piped (`outputStream()` creates it first): an
|
||||
// error in between (an abort, a read error) must not be emitted without listener, which would crash the process
|
||||
// the pipeline still fails with this error, kept by the stream
|
||||
stream.on('error', noop)
|
||||
const stream = await toVhdStream(disk, { uuid, parentUuid, parentPath })
|
||||
const size = await this.outputStream(path, stream, {
|
||||
validator,
|
||||
// no checksum for VHDs, because they will be invalidated by
|
||||
|
||||
@@ -178,8 +178,6 @@ process.on('message', async message => {
|
||||
? await Task.run(
|
||||
{
|
||||
properties: { name: 'backup run', ...message.data.jobData },
|
||||
// the steps of an aborted backup are skipped, as when the backup runs in the main thread
|
||||
skipSubtasksAfterAbort: true,
|
||||
onProgress: data =>
|
||||
emitMessage({
|
||||
data,
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
const noop = Function.prototype
|
||||
|
||||
/**
|
||||
* Destroys `stream` with the reason of `signal` once it is aborted, right away if it already is.
|
||||
*
|
||||
* Nothing may be listening to the stream when it is destroyed: an error event without a listener would crash the
|
||||
* process, so a noop listener is added.
|
||||
*
|
||||
* @param {import('node:stream').Readable} stream
|
||||
* @param {AbortSignal} [signal] nothing is done without a signal, e.g. a restore run outside a task
|
||||
* @returns {() => void} removes the abort listener
|
||||
*/
|
||||
export function destroyOnAbort(stream, signal) {
|
||||
if (signal === undefined) {
|
||||
return noop
|
||||
}
|
||||
|
||||
stream.on('error', noop)
|
||||
|
||||
const onAbort = () => stream.destroy(signal.reason)
|
||||
if (signal.aborted) {
|
||||
onAbort()
|
||||
return noop
|
||||
}
|
||||
|
||||
signal.addEventListener('abort', onAbort, { once: true })
|
||||
return () => signal.removeEventListener('abort', onAbort)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { PassThrough } from 'node:stream'
|
||||
|
||||
import { destroyOnAbort } from './_destroyOnAbort.mjs'
|
||||
|
||||
describe('destroyOnAbort()', () => {
|
||||
it('does nothing without a signal', () => {
|
||||
const stream = new PassThrough()
|
||||
|
||||
destroyOnAbort(stream, undefined)()
|
||||
|
||||
assert.equal(stream.destroyed, false)
|
||||
assert.equal(stream.listenerCount('error'), 0)
|
||||
})
|
||||
|
||||
it('destroys the stream right away when the signal is already aborted', () => {
|
||||
const stream = new PassThrough()
|
||||
const reason = new Error('aborted')
|
||||
|
||||
destroyOnAbort(stream, AbortSignal.abort(reason))
|
||||
|
||||
assert.equal(stream.destroyed, true)
|
||||
assert.equal(stream.errored, reason)
|
||||
})
|
||||
|
||||
it('destroys the stream once aborted, without crashing when nothing listens to it', async () => {
|
||||
const stream = new PassThrough()
|
||||
const controller = new AbortController()
|
||||
const reason = new Error('aborted')
|
||||
|
||||
destroyOnAbort(stream, controller.signal)
|
||||
controller.abort(reason)
|
||||
// the error event is emitted on the next tick: an unhandled one would crash the test process
|
||||
await new Promise(resolve => setImmediate(resolve))
|
||||
|
||||
assert.equal(stream.destroyed, true)
|
||||
assert.equal(stream.errored, reason)
|
||||
})
|
||||
|
||||
it('returns a function that stops listening to the signal', () => {
|
||||
const stream = new PassThrough()
|
||||
const controller = new AbortController()
|
||||
|
||||
destroyOnAbort(stream, controller.signal)()
|
||||
controller.abort()
|
||||
|
||||
assert.equal(stream.destroyed, false)
|
||||
})
|
||||
})
|
||||
@@ -32,9 +32,7 @@ export async function exportIncrementalVm(vm, baseVdis = {}, { signal, nbdConcur
|
||||
const disks = {}
|
||||
const vdis = {}
|
||||
const vbds = {}
|
||||
// the signal given to the callback stops the other initializations when one fails; the disks keep `signal`, which
|
||||
// must keep reaching them once the export is built
|
||||
await abortableMap(signal, vm.$VBDs, async (_initSignal, vbd) => {
|
||||
await abortableMap(signal, vm.$VBDs, async (signal, vbd) => {
|
||||
let vdi
|
||||
if (vbd.type !== 'Disk' || !(vdi = vbd.$VDI)) {
|
||||
// Ignore this VBD.
|
||||
@@ -70,7 +68,6 @@ export async function exportIncrementalVm(vm, baseVdis = {}, { signal, nbdConcur
|
||||
baseRef: baseVdi?.$ref,
|
||||
nbdConcurrency,
|
||||
preferNbd,
|
||||
signal,
|
||||
})
|
||||
await disks[vdiRef].init()
|
||||
})
|
||||
@@ -87,7 +84,6 @@ export async function exportIncrementalVm(vm, baseVdis = {}, { signal, nbdConcur
|
||||
xapi: vm.$xapi,
|
||||
nbdConcurrency,
|
||||
preferNbd,
|
||||
signal,
|
||||
})
|
||||
await disks[vdiRef].init()
|
||||
}
|
||||
|
||||
@@ -40,9 +40,6 @@ export const VmsRemote = class RemoteVmsBackupRunner extends Abstract {
|
||||
}
|
||||
|
||||
async run() {
|
||||
// abort signal of the backup run: once aborted, no new VM backup starts and no VM backup is retried
|
||||
const signal = Task.abortSignal
|
||||
|
||||
const job = this._job
|
||||
const schedule = this._schedule
|
||||
const settings = this._settings
|
||||
@@ -84,10 +81,6 @@ export const VmsRemote = class RemoteVmsBackupRunner extends Abstract {
|
||||
const nTriesByVmId = {}
|
||||
|
||||
const handleVm = async vmUuid => {
|
||||
if (signal?.aborted) {
|
||||
return
|
||||
}
|
||||
|
||||
if (nTriesByVmId[vmUuid] === undefined) {
|
||||
nTriesByVmId[vmUuid] = 0
|
||||
}
|
||||
@@ -150,10 +143,9 @@ export const VmsRemote = class RemoteVmsBackupRunner extends Abstract {
|
||||
nbVmsDone++
|
||||
return task.success(result)
|
||||
}
|
||||
// once aborted, the VM backup is not retried: it failed because of the abort, whatever its error
|
||||
if (isLastRun || signal?.aborted) {
|
||||
if (isLastRun) {
|
||||
nbVmsDone++
|
||||
return task.failure(signal?.aborted ? signal.reason : taskError)
|
||||
return task.failure(taskError)
|
||||
}
|
||||
Task.set('progress', Math.round((nbVmsDone * 100) / nbVms))
|
||||
// don't end the task
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { FullRemote } from './_vmRunners/FullRemote.mjs'
|
||||
import { VmsRemote } from './VmsRemote.mjs'
|
||||
|
||||
// a VM backup that runs until the run is aborted, as a transfer does
|
||||
const backupUntilAborted = () =>
|
||||
new Promise((resolve, reject) => {
|
||||
const signal = Task.abortSignal
|
||||
if (signal.aborted) {
|
||||
reject(signal.reason)
|
||||
} else {
|
||||
signal.addEventListener('abort', () => reject(signal.reason), { once: true })
|
||||
}
|
||||
})
|
||||
|
||||
function createRunner({ vms, settings = {} }) {
|
||||
const sourceAdapter = {
|
||||
listAllVms: async () => vms,
|
||||
listVmBackups: async () => [{ mode: 'full', vm: {} }],
|
||||
}
|
||||
return new VmsRemote({
|
||||
config: { snapshotNameLabelTpl: '[XO Backup {job.name}] {vm.name_label}' },
|
||||
getAdapter: async remoteId => ({ value: remoteId === 'source' ? sourceAdapter : {}, dispose() {} }),
|
||||
getConnectedRecord: async () => {
|
||||
throw new Error('no record in these tests')
|
||||
},
|
||||
job: {
|
||||
id: 'job',
|
||||
mode: 'full',
|
||||
name: 'job',
|
||||
remotes: { id: { __or: ['source', 'target'] } },
|
||||
settings: { '': { concurrency: 1, ...settings } },
|
||||
sourceRemote: 'source',
|
||||
},
|
||||
schedule: { id: 'schedule' },
|
||||
})
|
||||
}
|
||||
|
||||
// runs the runner inside a root task, aborted once the first VM backup has started
|
||||
async function runAndAbort(runner, calls) {
|
||||
const events = []
|
||||
const root = new Task({ skipSubtasksAfterAbort: true, onProgress: event => events.push(event) })
|
||||
const pRun = root.run(() => runner.run())
|
||||
|
||||
while ((calls.vm1 ?? 0) === 0) {
|
||||
await new Promise(resolve => setImmediate(resolve))
|
||||
}
|
||||
root.abort()
|
||||
await pRun.catch(() => {})
|
||||
|
||||
return events.filter(_ => _.type === 'start' && _.properties?.type === 'VM').map(_ => _.properties.id)
|
||||
}
|
||||
|
||||
describe('VmsRemote#run() after an abort', () => {
|
||||
it('does not start the backup of the next VMs, nor retry the aborted one', async t => {
|
||||
const calls = {}
|
||||
t.mock.method(FullRemote.prototype, 'run', function () {
|
||||
calls[this._vmUuid] = (calls[this._vmUuid] ?? 0) + 1
|
||||
return this._vmUuid === 'vm1' ? backupUntilAborted() : Promise.resolve()
|
||||
})
|
||||
|
||||
const vmTaskIds = await runAndAbort(
|
||||
createRunner({ vms: ['vm1', 'vm2'], settings: { nRetriesVmBackupFailures: 2 } }),
|
||||
calls
|
||||
)
|
||||
|
||||
assert.deepEqual(calls, { vm1: 1 }, 'the aborted VM is not retried and the second VM is not backed up')
|
||||
assert.deepEqual(vmTaskIds, ['vm1'], 'no task is created for the VMs not started')
|
||||
})
|
||||
})
|
||||
@@ -63,9 +63,6 @@ export const VmsXapi = class VmsXapiBackupRunner extends Abstract {
|
||||
}
|
||||
|
||||
async run() {
|
||||
// abort signal of the backup run: once aborted, no new VM backup starts and no VM backup is retried
|
||||
const signal = Task.abortSignal
|
||||
|
||||
const job = this._job
|
||||
|
||||
// FIXME: proper SimpleIdPattern handling
|
||||
@@ -146,10 +143,6 @@ export const VmsXapi = class VmsXapiBackupRunner extends Abstract {
|
||||
await asyncEach(
|
||||
[...vms].filter(vm => batchIds.has(vm.uuid)),
|
||||
async vm => {
|
||||
if (signal?.aborted) {
|
||||
return
|
||||
}
|
||||
|
||||
const { task } = getVmTask(vm.uuid, vm.name_label)
|
||||
|
||||
const vmSettings = { ...settings, ...allSettings[vm.uuid] }
|
||||
@@ -212,14 +205,9 @@ export const VmsXapi = class VmsXapiBackupRunner extends Abstract {
|
||||
const queue = new Set(snapshotedVmIds)
|
||||
|
||||
const handleVm = vmUuid => {
|
||||
if (signal?.aborted) {
|
||||
return
|
||||
}
|
||||
|
||||
const vmBackupFailed = async (error, task) => {
|
||||
// once aborted, the VM backup is not retried: it failed because of the abort, whatever its error
|
||||
if (isLastRun || signal?.aborted) {
|
||||
return task.failure(signal?.aborted ? signal.reason : error)
|
||||
if (isLastRun) {
|
||||
return task.failure(error)
|
||||
} else {
|
||||
// don't end the task
|
||||
task.warning(`Retry the VM backup due to an error`, {
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { VmsXapi } from './VmsXapi.mjs'
|
||||
|
||||
// a VM backup that runs until the run is aborted, as a transfer does
|
||||
const backupUntilAborted = () =>
|
||||
new Promise((resolve, reject) => {
|
||||
const signal = Task.abortSignal
|
||||
if (signal.aborted) {
|
||||
reject(signal.reason)
|
||||
} else {
|
||||
signal.addEventListener('abort', () => reject(signal.reason), { once: true })
|
||||
}
|
||||
})
|
||||
|
||||
function createRunner({ backups, settings = {} }) {
|
||||
const runner = new VmsXapi({
|
||||
config: { snapshotNameLabelTpl: '[XO Backup {job.name}] {vm.name_label}' },
|
||||
getAdapter: () => {
|
||||
throw new Error('no remote in these tests')
|
||||
},
|
||||
getConnectedRecord: async (type, id) => ({ $type: type, uuid: id, name_label: id }),
|
||||
job: {
|
||||
id: 'job',
|
||||
mode: 'full',
|
||||
name: 'job',
|
||||
settings: { '': { concurrency: 1, ...settings } },
|
||||
srs: { id: 'sr' },
|
||||
vms: { id: { __or: Object.keys(backups) } },
|
||||
},
|
||||
schedule: { id: 'schedule' },
|
||||
})
|
||||
|
||||
const calls = Object.fromEntries(Object.keys(backups).map(id => [id, 0]))
|
||||
runner._getVmBackup = (mode, { vm }) => ({
|
||||
run: () => {
|
||||
++calls[vm.uuid]
|
||||
return backups[vm.uuid]()
|
||||
},
|
||||
})
|
||||
|
||||
return { runner, calls }
|
||||
}
|
||||
|
||||
// runs the runner inside a root task, aborted once the first VM backup has started
|
||||
async function runAndAbort(runner, calls) {
|
||||
const events = []
|
||||
const root = new Task({ skipSubtasksAfterAbort: true, onProgress: event => events.push(event) })
|
||||
const pRun = root.run(() => runner.run())
|
||||
|
||||
while (calls.vm1 === 0) {
|
||||
await new Promise(resolve => setImmediate(resolve))
|
||||
}
|
||||
root.abort()
|
||||
await pRun.catch(() => {})
|
||||
|
||||
const vmTaskIds = events.filter(_ => _.type === 'start' && _.properties?.type === 'VM').map(_ => _.properties.id)
|
||||
return { events, vmTaskIds }
|
||||
}
|
||||
|
||||
describe('VmsXapi#run() after an abort', () => {
|
||||
it('does not start the backup of the next VMs', async () => {
|
||||
const { runner, calls } = createRunner({
|
||||
backups: { vm1: backupUntilAborted, vm2: async () => {} },
|
||||
})
|
||||
|
||||
const { vmTaskIds } = await runAndAbort(runner, calls)
|
||||
|
||||
assert.equal(calls.vm2, 0, 'the second VM is not backed up')
|
||||
assert.deepEqual(vmTaskIds, ['vm1'], 'no task is created for the VMs not started')
|
||||
})
|
||||
|
||||
it('does not retry the aborted VM', async () => {
|
||||
const { runner, calls } = createRunner({
|
||||
backups: { vm1: backupUntilAborted },
|
||||
settings: { nRetriesVmBackupFailures: 2 },
|
||||
})
|
||||
|
||||
const { events } = await runAndAbort(runner, calls)
|
||||
|
||||
assert.equal(calls.vm1, 1, 'the aborted VM backup is not run again')
|
||||
const vmTaskId = events.find(_ => _.type === 'start' && _.properties?.id === 'vm1').id
|
||||
const vmEnd = events.find(_ => _.type === 'end' && _.id === vmTaskId)
|
||||
assert.equal(vmEnd.status, 'failure')
|
||||
assert.equal(vmEnd.result.name, 'AbortError')
|
||||
})
|
||||
})
|
||||
@@ -3,7 +3,6 @@ import { createLogger } from '@xen-orchestra/log'
|
||||
import { AbstractRemote } from './_AbstractRemote.mjs'
|
||||
import { FullRemoteWriter } from '../_writers/FullRemoteWriter.mjs'
|
||||
import { forkStreamUnpipe } from '../_forkStreamUnpipe.mjs'
|
||||
import { destroyOnAbort } from '../../_destroyOnAbort.mjs'
|
||||
import { watchStreamSize } from '../../_watchStreamSize.mjs'
|
||||
import { AggregatedFullRemoteWriter } from '../_writers/AggregatedFullRemoteWriter.mjs'
|
||||
import { Task } from '@vates/task'
|
||||
@@ -24,7 +23,6 @@ export const FullRemote = class FullRemoteVmBackupRunner extends AbstractRemote
|
||||
const nbTransferrableVms = transferList.length
|
||||
let nbTransferredVms = 0
|
||||
for (const metadata of transferList) {
|
||||
Task.abortSignal?.throwIfAborted()
|
||||
const stream = this._throttleStream(await this._sourceRemoteAdapter.readFullVmBackup(metadata))
|
||||
const sizeContainer = watchStreamSize(stream)
|
||||
let checksum
|
||||
@@ -38,9 +36,6 @@ export const FullRemote = class FullRemoteVmBackupRunner extends AbstractRemote
|
||||
// a single writer can consume the stream itself: no need to fork it
|
||||
const isForked = this._writers.size > 1
|
||||
|
||||
// the source is a plain stream: destroying it stops the reading and makes the writers fail
|
||||
const stopDestroyOnAbort = destroyOnAbort(stream, Task.abortSignal)
|
||||
|
||||
// @todo shouldn't transfer backup if it will be deleted by retention policy (higher retention on source than destination)
|
||||
await this._callWriters(
|
||||
writer =>
|
||||
@@ -56,7 +51,7 @@ export const FullRemote = class FullRemoteVmBackupRunner extends AbstractRemote
|
||||
sizeContainer,
|
||||
}),
|
||||
'writer.run()'
|
||||
).finally(stopDestroyOnAbort)
|
||||
)
|
||||
// for healthcheck
|
||||
this._vm = metadata.vm
|
||||
nbTransferredVms++
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { PassThrough } from 'node:stream'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { FullRemote } from './FullRemote.mjs'
|
||||
|
||||
const makeRunner = props => Object.assign(Object.create(FullRemote.prototype), props)
|
||||
|
||||
describe('FullRemote#_run() after an abort', () => {
|
||||
it('stops reading the source backup', async () => {
|
||||
const source = new PassThrough()
|
||||
// resolved once the writer reads the stream
|
||||
const { promise: pWriting, resolve: onWriting } = Promise.withResolvers()
|
||||
const runner = makeRunner({
|
||||
_computeTransferList: async () => [{ timestamp: 0, vm: {}, vmSnapshot: {} }],
|
||||
_sourceRemoteAdapter: {
|
||||
readFullVmBackup: async () => source,
|
||||
readFullVmBackupChecksum: async () => {
|
||||
throw new Error('no checksum')
|
||||
},
|
||||
},
|
||||
_throttleStream: stream => stream,
|
||||
_writers: new Set([
|
||||
{
|
||||
// a writer which writes until its input ends or fails
|
||||
run: ({ stream }) =>
|
||||
new Promise((resolve, reject) => {
|
||||
onWriting()
|
||||
stream.on('error', reject).on('end', resolve).resume()
|
||||
}),
|
||||
},
|
||||
]),
|
||||
})
|
||||
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
const result = await vmTask
|
||||
.run(async () => {
|
||||
const pRun = runner._run()
|
||||
await pWriting
|
||||
vmTask.abort()
|
||||
return Promise.race([
|
||||
pRun.then(
|
||||
() => 'resolved',
|
||||
error => error.name
|
||||
),
|
||||
new Promise(resolve => setTimeout(resolve, 1e3, 'still reading')),
|
||||
])
|
||||
})
|
||||
.catch(error => error.name)
|
||||
|
||||
assert.equal(result, 'AbortError')
|
||||
})
|
||||
|
||||
it('destroys the source stream when the abort came while the source was being opened', async () => {
|
||||
// nothing listens to its errors: destroying it must not crash the process
|
||||
const source = new PassThrough()
|
||||
let written = false
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
const runner = makeRunner({
|
||||
_computeTransferList: async () => [{ timestamp: 0, vm: {}, vmSnapshot: {} }],
|
||||
_sourceRemoteAdapter: {
|
||||
readFullVmBackup: async () => source,
|
||||
readFullVmBackupChecksum: async () => {
|
||||
// the abort lands during the awaits that precede the registration of the listener
|
||||
vmTask.abort()
|
||||
throw new Error('no checksum')
|
||||
},
|
||||
},
|
||||
_throttleStream: stream => stream,
|
||||
_writers: new Set([
|
||||
{
|
||||
run: async () => {
|
||||
written = true
|
||||
},
|
||||
},
|
||||
]),
|
||||
})
|
||||
|
||||
// the writers do not consume the stream: only the abort handling can close it
|
||||
await vmTask.run(() => runner._run()).catch(() => {})
|
||||
|
||||
assert.equal(source.destroyed, true)
|
||||
assert.equal(written, true)
|
||||
})
|
||||
|
||||
it('does not open the source of the next backup once aborted', async () => {
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
let opened = 0
|
||||
const runner = makeRunner({
|
||||
_computeTransferList: async () => [
|
||||
{ timestamp: 0, vm: {}, vmSnapshot: {} },
|
||||
{ timestamp: 1, vm: {}, vmSnapshot: {} },
|
||||
],
|
||||
_sourceRemoteAdapter: {
|
||||
readFullVmBackup: async () => {
|
||||
++opened
|
||||
// nothing listens to its errors: destroying it must not crash the process
|
||||
return new PassThrough()
|
||||
},
|
||||
readFullVmBackupChecksum: async () => 'checksum',
|
||||
},
|
||||
_throttleStream: stream => stream,
|
||||
_writers: new Set([
|
||||
{
|
||||
run: async () => {
|
||||
vmTask.abort()
|
||||
},
|
||||
},
|
||||
]),
|
||||
})
|
||||
|
||||
await assert.rejects(
|
||||
vmTask.run(() => runner._run()),
|
||||
{ name: 'AbortError' }
|
||||
)
|
||||
assert.equal(opened, 1)
|
||||
})
|
||||
})
|
||||
@@ -1,5 +1,4 @@
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { forkStreamUnpipe } from '../_forkStreamUnpipe.mjs'
|
||||
import { FullRemoteWriter } from '../_writers/FullRemoteWriter.mjs'
|
||||
@@ -56,8 +55,6 @@ export const FullXapi = class FullXapiVmBackupRunner extends AbstractXapi {
|
||||
(
|
||||
await this._xapi.VM_export(exportedVm.$ref, {
|
||||
compress: Boolean(compression) && (compression === 'native' ? 'gzip' : 'zstd'),
|
||||
// the export stream fails once the backup is aborted, which stops the writers
|
||||
signal: Task.abortSignal,
|
||||
useSnapshot: false,
|
||||
})
|
||||
).body
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { PassThrough } from 'node:stream'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { FullXapi } from './FullXapi.mjs'
|
||||
|
||||
const makeRunner = props => Object.assign(Object.create(FullXapi.prototype), props)
|
||||
|
||||
describe('FullXapi#_copy() after an abort', () => {
|
||||
it('stops the XAPI export, and settles only once its writers have settled', async () => {
|
||||
let exportOpts
|
||||
// resolved once the XAPI export is called
|
||||
const { promise: pExport, resolve: onExport } = Promise.withResolvers()
|
||||
let writerSettledAt
|
||||
const body = new PassThrough()
|
||||
const runner = makeRunner({
|
||||
job: {},
|
||||
_vm: { uuid: 'vm-uuid' },
|
||||
_exportedVm: { $ref: 'snapshot-ref', $getDisks: async () => [] },
|
||||
_throttleStream: stream => stream,
|
||||
_xapi: {
|
||||
// as the HTTP export does: the body fails once the signal is aborted
|
||||
VM_export: async (ref, opts) => {
|
||||
exportOpts = opts
|
||||
onExport()
|
||||
opts.signal?.addEventListener('abort', () => body.destroy(opts.signal.reason), { once: true })
|
||||
return { body }
|
||||
},
|
||||
},
|
||||
_writers: new Set([
|
||||
{
|
||||
// a writer that needs some time to clean up after its input failed
|
||||
run: ({ stream }) =>
|
||||
new Promise((resolve, reject) => {
|
||||
stream.on('error', error =>
|
||||
setTimeout(() => {
|
||||
writerSettledAt = Date.now()
|
||||
reject(error)
|
||||
}, 100)
|
||||
)
|
||||
stream.resume()
|
||||
}),
|
||||
},
|
||||
]),
|
||||
})
|
||||
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
let copyRejectedAt
|
||||
await vmTask
|
||||
.run(async () => {
|
||||
const pCopy = runner._copy()
|
||||
await pExport
|
||||
assert.ok(exportOpts.signal instanceof AbortSignal, 'the export gets the abort signal')
|
||||
|
||||
vmTask.abort()
|
||||
await assert.rejects(pCopy, { name: 'AbortError' })
|
||||
copyRejectedAt = Date.now()
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.name !== 'AbortError') {
|
||||
throw error
|
||||
}
|
||||
})
|
||||
|
||||
assert.ok(writerSettledAt <= copyRejectedAt, 'the copy settles after its writers')
|
||||
})
|
||||
})
|
||||
@@ -85,8 +85,6 @@ class IncrementalRemoteVmBackupRunner extends AbstractRemote {
|
||||
const nbTransferrableVms = transferList.length
|
||||
let nbTransferredVms = 0
|
||||
for (const metadata of transferList) {
|
||||
// an abort during the previous VM's writer steps: its disks would be opened and never closed
|
||||
Task.abortSignal?.throwIfAborted()
|
||||
assert.strictEqual(metadata.mode, 'delta')
|
||||
const incrementalExport = await this._sourceRemoteAdapter.readIncrementalVmBackup(metadata, undefined, {
|
||||
useChain: false,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { describe, it } from 'node:test'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { IncrementalRemote } from './IncrementalRemote.mjs'
|
||||
|
||||
@@ -44,42 +43,3 @@ describe('IncrementalRemote prepare()', () => {
|
||||
assert.equal(aggWriter.props.schedule, schedule)
|
||||
})
|
||||
})
|
||||
|
||||
describe('IncrementalRemote#_run() after an abort', () => {
|
||||
it('does not open the disks of the next backup once aborted', async () => {
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
let opened = 0
|
||||
// a real instance: `_run()` uses a private method
|
||||
const runner = Object.assign(makeRunner({ schedule: { id: 'schedule-id' } }), {
|
||||
_computeTransferList: async () => [
|
||||
{ mode: 'delta', timestamp: 0, vm: {}, vmSnapshot: {} },
|
||||
{ mode: 'delta', timestamp: 1, vm: {}, vmSnapshot: {} },
|
||||
],
|
||||
_selectBaseVm: async () => {},
|
||||
_sourceRemoteAdapter: {
|
||||
getVhdDirectoryCompression: () => undefined,
|
||||
readIncrementalVmBackup: async () => {
|
||||
++opened
|
||||
return { disks: {}, vbds: {}, vdis: {}, vifs: {}, vm: {}, vtpms: {} }
|
||||
},
|
||||
},
|
||||
_writers: new Set([
|
||||
{
|
||||
getVhdDirectoryCompression: () => undefined,
|
||||
prepare: async () => {},
|
||||
transfer: async () => {},
|
||||
// the abort lands during the writer steps of the first backup
|
||||
cleanup: async () => {
|
||||
vmTask.abort()
|
||||
},
|
||||
},
|
||||
]),
|
||||
})
|
||||
|
||||
await assert.rejects(
|
||||
vmTask.run(() => runner._run()),
|
||||
{ name: 'AbortError' }
|
||||
)
|
||||
assert.equal(opened, 1)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -55,8 +55,6 @@ export const IncrementalXapi = class IncrementalXapiVmBackupRunner extends Abstr
|
||||
const deltaExport = await exportIncrementalVm(exportedVm, baseVdis, {
|
||||
nbdConcurrency: this._settings.nbdConcurrency,
|
||||
preferNbd: this._settings.preferNbd,
|
||||
// the reads of the disks stop once the backup is aborted
|
||||
signal: Task.abortSignal,
|
||||
})
|
||||
|
||||
const isVhdDifferencing = {}
|
||||
|
||||
@@ -233,7 +233,6 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
||||
const snapshotRef = await vm[settings.checkpointSnapshot ? '$checkpoint' : '$snapshot']({
|
||||
ignoredVdisTag: '[NOBAK]',
|
||||
name_label: TEMP_SNAPSHOT_NAME,
|
||||
signal: Task.abortSignal,
|
||||
unplugVusbs: true,
|
||||
})
|
||||
this.timestamp = Date.now()
|
||||
@@ -382,9 +381,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
||||
const xapi = this._xapi
|
||||
|
||||
const vdiCandidates = {}
|
||||
// only disks: an empty CD drive has an empty VDI ref, which would match the
|
||||
// snapshot_of of every VDI that is not a snapshot
|
||||
const vdiUuids = this._vm.$VBDs.filter(({ type }) => type === 'Disk').map(({ VDI }) => VDI)
|
||||
const vdiUuids = this._vm.$VBDs.map(({ VDI }) => VDI)
|
||||
Object.values(xapi.objects.indexes.type.VDI)
|
||||
.filter(_ => !!_) // filter nullish
|
||||
.filter(({ other_config, snapshot_of }) => {
|
||||
@@ -403,20 +400,21 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
||||
|
||||
this._jobSnapshotVdis = Object.values(vdiCandidates)
|
||||
|
||||
// also harvest each of the snapshot chain without any disk
|
||||
// a VBD missing from the cache may be a disk: such a snapshot is skipped
|
||||
// here, since it could also be reachable (and destroyed) through its VDIs
|
||||
const hasNoDisk = ({ $VBDs }) => $VBDs.every(vbd => vbd !== undefined && vbd.type !== 'Disk')
|
||||
this._disklessJobSnapshotVms = this._vm.$snapshots
|
||||
.filter(Boolean)
|
||||
.filter(
|
||||
snapshot =>
|
||||
snapshot.$snapshot_of !== undefined &&
|
||||
snapshot.other_config[JOB_ID] === jobId &&
|
||||
snapshot.other_config[VM_UUID] === this._vm.uuid &&
|
||||
snapshot.other_config[COPY_OF] === undefined &&
|
||||
hasNoDisk(snapshot)
|
||||
)
|
||||
// For VMs with no disks, retention must be tracked directly on VM snapshots
|
||||
// since there are no VDIs to anchor the discovery.
|
||||
if (vdiUuids.length === 0) {
|
||||
this._disklessJobSnapshotVms = this._vm.$snapshots
|
||||
.filter(Boolean)
|
||||
.filter(
|
||||
({ other_config, $snapshot_of }) =>
|
||||
$snapshot_of !== undefined &&
|
||||
other_config[JOB_ID] === jobId &&
|
||||
other_config[VM_UUID] === this._vm.uuid &&
|
||||
other_config[COPY_OF] === undefined
|
||||
)
|
||||
} else {
|
||||
this._disklessJobSnapshotVms = []
|
||||
}
|
||||
}
|
||||
|
||||
async _removeUnusedSnapshots() {
|
||||
@@ -452,13 +450,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
||||
.pop()
|
||||
|
||||
// remove older snapshot schedule per schedule
|
||||
// a VM snapshot without any disk is not reachable via its VDIs: both kinds
|
||||
// share the same retention, so they are grouped by datetime together
|
||||
const jobSnapshots = [
|
||||
...this._jobSnapshotVdis.map(vdi => ({ other_config: vdi.other_config, vdi })),
|
||||
...disklessVmSnapshots.map(vm => ({ other_config: vm.other_config, vm })),
|
||||
]
|
||||
const snapshotsPerSchedule = groupBy(jobSnapshots, _ => _.other_config[SCHEDULE_ID])
|
||||
const snapshotsPerSchedule = groupBy(this._jobSnapshotVdis, _ => _.other_config[SCHEDULE_ID])
|
||||
await asyncMap(Object.entries(snapshotsPerSchedule), async ([scheduleId, snapshots]) => {
|
||||
const snapshotPerDatetime = groupBy(snapshots, _ => _.other_config[DATETIME])
|
||||
|
||||
@@ -481,18 +473,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
||||
) {
|
||||
return
|
||||
}
|
||||
const entries = snapshotPerDatetime[datetime]
|
||||
await asyncEach(
|
||||
// VM snapshots without any disk: nothing to resolve, destroy them directly
|
||||
entries.filter(({ vm }) => vm !== undefined),
|
||||
async ({ vm: { $ref } }) => {
|
||||
this._forgetExportedVm($ref)
|
||||
await xapi.VM_destroy($ref)
|
||||
}
|
||||
)
|
||||
// snapshots reached through their VDIs: resolve the VM snapshot via the
|
||||
// VBDs, or destroy the VDIs alone when no VM is attached (CBT, orphans)
|
||||
const vdis = entries.filter(({ vdi }) => vdi !== undefined).map(({ vdi }) => vdi)
|
||||
const vdis = snapshotPerDatetime[datetime]
|
||||
let vm
|
||||
// if there is an attached VM => destroy the VM (Non CBT backups)
|
||||
for (const vdi of vdis) {
|
||||
@@ -546,6 +527,34 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
|
||||
})
|
||||
})
|
||||
|
||||
// Retention for VMs with no disks: VM snapshots are not reachable via VDIs
|
||||
if (disklessVmSnapshots.length > 0) {
|
||||
const snapshotsPerSchedule = groupBy(disklessVmSnapshots, _ => _.other_config[SCHEDULE_ID])
|
||||
await asyncEach(Object.entries(snapshotsPerSchedule), async ([scheduleId, snapshots]) => {
|
||||
// we only have one snapshot per date time since it's at the VM level
|
||||
const snapshotPerDatetime = Object.fromEntries(snapshots.map(s => [s.other_config[DATETIME], s.$ref]))
|
||||
const datetimes = Object.keys(snapshotPerDatetime).sort()
|
||||
const settings = {
|
||||
...baseSettings,
|
||||
...allSettings[scheduleId],
|
||||
...allSettings[this._vm.uuid],
|
||||
}
|
||||
const retention = settings.snapshotRetention ?? 0
|
||||
await asyncEach(getOldEntries(retention, datetimes), async datetime => {
|
||||
if (
|
||||
this.job.mode === 'delta' &&
|
||||
lastExportedSnapshotDateTime !== undefined &&
|
||||
datetime === lastExportedSnapshotDateTime
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
this._forgetExportedVm(snapshotPerDatetime[datetime])
|
||||
await xapi.VM_destroy(snapshotPerDatetime[datetime])
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// list and remove the snapshot were the jobs failed between
|
||||
// makesnapshot and update_other_config
|
||||
const snapshots = this._vm.$snapshots.filter(_ => !!_).filter(({ name_label }) => name_label === TEMP_SNAPSHOT_NAME)
|
||||
|
||||
@@ -2,10 +2,9 @@ import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
|
||||
import { formatDateTime } from '@xen-orchestra/xapi'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { AbstractXapi } from './_AbstractXapi.mjs'
|
||||
import { DATETIME, EXPORTED_SUCCESSFULLY, JOB_ID, SCHEDULE_ID, VM_UUID } from '../../_otherConfig.mjs'
|
||||
import { DATETIME, EXPORTED_SUCCESSFULLY, JOB_ID, SCHEDULE_ID } from '../../_otherConfig.mjs'
|
||||
|
||||
// Build an AbstractXapi instance without running its heavy constructor, then
|
||||
// assign only the fields the method under test reads.
|
||||
@@ -658,197 +657,3 @@ describe('run() purges the snapshot data only while the snapshot exists', () =>
|
||||
assert.deepEqual(calls.vmDestroyed, [], 'the live VM must never be destroyed')
|
||||
})
|
||||
})
|
||||
|
||||
describe('after an abort', () => {
|
||||
it('_snapshot() passes the abort signal to the snapshot', async () => {
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
let received
|
||||
const runner = makeRunner({
|
||||
_settings: { bypassVdiChainsCheck: true },
|
||||
_vm: {
|
||||
$ref: 'vm-ref',
|
||||
uuid: 'vm-uuid',
|
||||
$snapshot: async opts => {
|
||||
received = opts
|
||||
// the backup is aborted while the snapshot is being taken
|
||||
vmTask.abort()
|
||||
throw new Error('stop after the snapshot call')
|
||||
},
|
||||
},
|
||||
_xapi: {},
|
||||
_mustDoSnapshot: async () => true,
|
||||
})
|
||||
|
||||
await vmTask.run(() => assert.rejects(runner._snapshot(), /stop after the snapshot call/)).catch(() => {})
|
||||
|
||||
assert.ok(received.signal instanceof AbortSignal, 'the snapshot gets a signal')
|
||||
assert.equal(received.signal.aborted, true, 'the snapshot gets the abort signal of the backup')
|
||||
})
|
||||
|
||||
it('run() still applies the retention and restores the blocked operations, but skips the health check', async () => {
|
||||
const calls = []
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
const runner = makeRunner({
|
||||
_settings: { offlineBackup: false, snapshotRetention: 0 },
|
||||
_vm: {
|
||||
uuid: 'live-uuid',
|
||||
power_state: 'Halted',
|
||||
blocked_operations: {},
|
||||
update_blocked_operations: async ops => {
|
||||
calls.push(Object.values(ops).every(_ => _ === null) ? 'unblock' : 'block')
|
||||
},
|
||||
$call: async () => {},
|
||||
},
|
||||
_writers: new Set([{ beforeBackup: async () => {}, afterBackup: async () => calls.push('afterBackup') }]),
|
||||
_xapi: {},
|
||||
_cleanMetadata: async () => {},
|
||||
_fetchJobSnapshots: async () => {},
|
||||
_selectBaseVm: async () => {},
|
||||
_removeUnusedSnapshots: async () => calls.push('removeUnusedSnapshots'),
|
||||
_removeSnapshotData: async () => calls.push('removeSnapshotData'),
|
||||
_healthCheck: async () => calls.push('healthCheck'),
|
||||
_snapshot: async function () {
|
||||
this._exportedVm = { $ref: 'snapshot-ref', is_a_snapshot: true }
|
||||
},
|
||||
// a transfer, aborted while it runs
|
||||
_copy: () =>
|
||||
new Promise((resolve, reject) => {
|
||||
const signal = Task.abortSignal
|
||||
signal.addEventListener('abort', () => reject(signal.reason), { once: true })
|
||||
setImmediate(() => {
|
||||
calls.push('abort')
|
||||
vmTask.abort()
|
||||
})
|
||||
}),
|
||||
})
|
||||
|
||||
await vmTask.run(() => assert.rejects(runner.run(), { name: 'AbortError' })).catch(() => {})
|
||||
|
||||
assert.deepEqual(calls, [
|
||||
'block',
|
||||
'removeUnusedSnapshots',
|
||||
'abort',
|
||||
'removeUnusedSnapshots',
|
||||
'removeSnapshotData',
|
||||
'unblock',
|
||||
'afterBackup',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('_fetchJobSnapshots() diskless VM snapshot detection', () => {
|
||||
const makeFetchRunner = ({ vmVbds, snapshotVbds }) => {
|
||||
const jobSnapshot = {
|
||||
$ref: 'snap-ref',
|
||||
$snapshot_of: {},
|
||||
$VBDs: snapshotVbds,
|
||||
other_config: { [JOB_ID]: 'job-1', [VM_UUID]: 'vm-uuid', [DATETIME]: '20240101T00:00:00Z' },
|
||||
}
|
||||
return makeRunner({
|
||||
_jobId: 'job-1',
|
||||
_vm: { uuid: 'vm-uuid', $VBDs: vmVbds, $snapshots: [jobSnapshot] },
|
||||
_xapi: { objects: { indexes: { type: { VDI: {} } } } },
|
||||
})
|
||||
}
|
||||
const trackedSnapshotRefs = runner => runner._disklessJobSnapshotVms.map(({ $ref }) => $ref)
|
||||
|
||||
it('tracks VM snapshots of a VM with only an empty CD drive', async () => {
|
||||
const cdDrive = { type: 'CD', VDI: 'OpaqueRef:NULL' }
|
||||
const runner = makeFetchRunner({ vmVbds: [cdDrive], snapshotVbds: [cdDrive] })
|
||||
|
||||
await runner._fetchJobSnapshots()
|
||||
|
||||
assert.deepEqual(trackedSnapshotRefs(runner), ['snap-ref'], 'a CD drive must not prevent the diskless retention')
|
||||
})
|
||||
|
||||
it('tracks VM snapshots of a VM whose only disk is [NOBAK]', async () => {
|
||||
// the ignored disk is on the VM, but not on its snapshot
|
||||
const runner = makeFetchRunner({ vmVbds: [{ type: 'Disk', VDI: 'nobak-vdi-ref' }], snapshotVbds: [] })
|
||||
|
||||
await runner._fetchJobSnapshots()
|
||||
|
||||
assert.deepEqual(trackedSnapshotRefs(runner), ['snap-ref'], 'a snapshot without disk must be tracked at VM level')
|
||||
})
|
||||
|
||||
it('does not use the diskless retention for a snapshot with a disk', async () => {
|
||||
const runner = makeFetchRunner({
|
||||
vmVbds: [{ type: 'Disk', VDI: 'vdi-ref' }],
|
||||
snapshotVbds: [{ type: 'Disk', VDI: 'snapshot-vdi-ref' }],
|
||||
})
|
||||
|
||||
await runner._fetchJobSnapshots()
|
||||
|
||||
assert.deepEqual(trackedSnapshotRefs(runner), [], 'this snapshot is handled through its VDIs')
|
||||
})
|
||||
|
||||
it('does not use the diskless retention when a VBD of the snapshot is not in the cache', async () => {
|
||||
const runner = makeFetchRunner({ vmVbds: [{ type: 'Disk', VDI: 'vdi-ref' }], snapshotVbds: [undefined] })
|
||||
|
||||
await runner._fetchJobSnapshots()
|
||||
|
||||
assert.deepEqual(trackedSnapshotRefs(runner), [], 'an unknown VBD may be a disk')
|
||||
})
|
||||
})
|
||||
|
||||
describe('_removeUnusedSnapshots() applies one retention across VDI-reached and diskless snapshots', () => {
|
||||
// A VM that switched between "no backed up disk" and "at least one disk"
|
||||
// has snapshots of both kinds: the retention must apply to their union, not
|
||||
// keep `snapshotRetention` snapshots of each kind.
|
||||
const OLD_DATETIME = '20240101T00:00:00Z'
|
||||
const NEW_DATETIME = '20240102T00:00:00Z'
|
||||
|
||||
const makeSwitchedRunner = ({ oldIsDiskless }) => {
|
||||
const destroyed = []
|
||||
|
||||
const disklessSnapshot = datetime => ({
|
||||
$ref: 'vm-diskless',
|
||||
other_config: { [DATETIME]: datetime, [SCHEDULE_ID]: 'schedule-1' },
|
||||
})
|
||||
const snapshotVm = { $ref: 'vm-with-disk', is_control_domain: false, $snapshot_of: 'live-vm-ref', other_config: {} }
|
||||
const vdiSnapshot = datetime => ({
|
||||
$ref: 'vdi-with-disk',
|
||||
other_config: { [DATETIME]: datetime, [SCHEDULE_ID]: 'schedule-1' },
|
||||
$VBDs: [{ $VM: snapshotVm }],
|
||||
})
|
||||
|
||||
const vm = disklessSnapshot(oldIsDiskless ? OLD_DATETIME : NEW_DATETIME)
|
||||
const vdi = vdiSnapshot(oldIsDiskless ? NEW_DATETIME : OLD_DATETIME)
|
||||
const registry = { [vm.$ref]: vm, [vdi.$ref]: vdi }
|
||||
|
||||
const runner = makeRunner({
|
||||
_vm: { uuid: 'live-uuid', $snapshots: [] },
|
||||
_baseSettings: { snapshotRetention: 1 },
|
||||
_jobSnapshotVdis: [vdi],
|
||||
_disklessJobSnapshotVms: [vm],
|
||||
job: { mode: 'full', settings: {} },
|
||||
_xapi: {
|
||||
barrier: async () => {},
|
||||
getObject: ref => registry[ref],
|
||||
VM_destroy: async ref => {
|
||||
destroyed.push(ref)
|
||||
},
|
||||
VDI_destroy: async ref => {
|
||||
destroyed.push(ref)
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return { runner, destroyed }
|
||||
}
|
||||
|
||||
it('removes the older diskless snapshot once a disk was added', async () => {
|
||||
const { runner, destroyed } = makeSwitchedRunner({ oldIsDiskless: true })
|
||||
|
||||
await runner._removeUnusedSnapshots()
|
||||
|
||||
assert.deepEqual(destroyed, ['vm-diskless'], 'only the older, diskless, snapshot should be removed')
|
||||
})
|
||||
|
||||
it('removes the older snapshot with a disk once the VM became diskless', async () => {
|
||||
const { runner, destroyed } = makeSwitchedRunner({ oldIsDiskless: false })
|
||||
|
||||
await runner._removeUnusedSnapshots()
|
||||
|
||||
assert.deepEqual(destroyed, ['vm-with-disk'], 'only the older snapshot, reached through its VDI, should be removed')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -161,24 +161,8 @@ export class IncrementalRemoteWriter extends MixinRemoteWriter(AbstractIncrement
|
||||
this._prepare = task.wrapInside(this._prepare)
|
||||
this.transfer = task.wrapInside(this.transfer)
|
||||
this.healthCheck = task.wrapInside(this.healthCheck)
|
||||
|
||||
// `cleanup()` applies the retention once the backup has been written: an abort that arrives after the transfer
|
||||
// has already ended the task, the retention then runs in a cleanup subtask, which the abort does not stop
|
||||
const cleanupInTask = task.wrapInside(this.cleanup)
|
||||
const cleanup = this.cleanup
|
||||
this.cleanup = function () {
|
||||
return task.status === 'pending'
|
||||
? cleanupInTask.apply(this, arguments)
|
||||
: Task.run({ properties: { name: 'retention' }, cleanup: true }, () => cleanup.apply(this, arguments))
|
||||
}
|
||||
|
||||
// `afterBackup()` cleans the VM directory and releases its lock: it must run even when the task has already
|
||||
// ended because the transfer failed or was aborted, outside of it then
|
||||
const afterBackupInTask = task.wrap(this.afterBackup)
|
||||
const afterBackup = this.afterBackup
|
||||
this.afterBackup = function () {
|
||||
return task.status === 'pending' ? afterBackupInTask.apply(this, arguments) : afterBackup.apply(this, arguments)
|
||||
}
|
||||
this.cleanup = task.wrapInside(this.cleanup)
|
||||
this.afterBackup = task.wrap(this.afterBackup)
|
||||
|
||||
return this._prepare()
|
||||
}
|
||||
@@ -281,8 +265,6 @@ export class IncrementalRemoteWriter extends MixinRemoteWriter(AbstractIncrement
|
||||
}
|
||||
let size = 0
|
||||
await Task.run({ properties: { name: 'transfer' } }, async () => {
|
||||
// stops the writes once the backup is aborted
|
||||
const signal = Task.abortSignal
|
||||
await asyncEach(
|
||||
Object.entries(deltaExport.disks),
|
||||
async ([diskRef, disk]) => {
|
||||
@@ -303,7 +285,6 @@ export class IncrementalRemoteWriter extends MixinRemoteWriter(AbstractIncrement
|
||||
// no checksum for VHDs, because they will be invalidated by
|
||||
// merges and chains
|
||||
checksum: false,
|
||||
signal,
|
||||
validator: tmpPath => checkDisk(handler, tmpPath),
|
||||
writeBlockConcurrency: this._config.writeBlockConcurrency,
|
||||
uuid: packUuid(vdi.uuid),
|
||||
@@ -319,11 +300,6 @@ export class IncrementalRemoteWriter extends MixinRemoteWriter(AbstractIncrement
|
||||
|
||||
return { size }
|
||||
})
|
||||
|
||||
// the metadata makes the backup restorable: it is not written for an aborted backup, whose disks are removed by
|
||||
// the clean-vm of `afterBackup()`
|
||||
Task.abortSignal?.throwIfAborted()
|
||||
|
||||
metadataContent.tags = await this.getLongTermRetentionTags(metadataContent)
|
||||
metadataContent.size = size // @todo return exactly the size written by this writer
|
||||
this._metadataFileName = await adapter.writeVmBackupMetadata(vm.uuid, metadataContent)
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { IncrementalRemoteWriter } from './IncrementalRemoteWriter.mjs'
|
||||
|
||||
// a writer on a fake remote, whose transfer fails as an aborted transfer does
|
||||
function createWriter() {
|
||||
const calls = { cleanVm: 0, cleanVmOptions: [], deletedEntries: [], lockDisposed: false }
|
||||
const writer = new IncrementalRemoteWriter({
|
||||
adapter: {
|
||||
deleteDeltaVmBackups: async backups => {
|
||||
calls.deletedEntries.push(...backups.map(_ => _._filename))
|
||||
},
|
||||
handler: {
|
||||
mktree: async () => {},
|
||||
lock: async () => ({
|
||||
dispose: async () => {
|
||||
calls.lockDisposed = true
|
||||
},
|
||||
}),
|
||||
},
|
||||
cleanVm: async (vmDir, options) => {
|
||||
++calls.cleanVm
|
||||
calls.cleanVmOptions.push(options)
|
||||
return {}
|
||||
},
|
||||
},
|
||||
config: { disableMergeWorker: true },
|
||||
job: { id: 'job', mode: 'delta' },
|
||||
remoteId: 'remote',
|
||||
schedule: { id: 'schedule' },
|
||||
settings: {},
|
||||
vmUuid: 'vm',
|
||||
})
|
||||
|
||||
// what `prepare()` wraps in its "export" task
|
||||
writer._prepare = async () => {
|
||||
// the backups past the retention
|
||||
writer._oldEntries = [{ _filename: 'old1.json' }, { _filename: 'old2.json' }]
|
||||
}
|
||||
writer.transfer = () =>
|
||||
new Promise((resolve, reject) => {
|
||||
const signal = Task.abortSignal
|
||||
if (signal.aborted) {
|
||||
reject(signal.reason)
|
||||
} else {
|
||||
signal.addEventListener('abort', () => reject(signal.reason), { once: true })
|
||||
}
|
||||
})
|
||||
|
||||
return { calls, writer }
|
||||
}
|
||||
|
||||
// the steps of a VM backup for this writer, in the order `_AbstractXapi#run()` calls them
|
||||
async function runSteps(writer, { abort, afterTransfer = () => {} }) {
|
||||
const events = []
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress: event => events.push(event) })
|
||||
let afterBackupError
|
||||
|
||||
await vmTask
|
||||
.run(async () => {
|
||||
await writer.beforeBackup()
|
||||
try {
|
||||
await writer.prepare({ isFull: true })
|
||||
const pTransfer = writer.transfer()
|
||||
abort(vmTask)
|
||||
await pTransfer
|
||||
afterTransfer(vmTask)
|
||||
await writer.cleanup()
|
||||
} finally {
|
||||
// `$defer` of `_AbstractXapi#run()`
|
||||
await writer.afterBackup().catch(error => {
|
||||
afterBackupError = error
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
|
||||
return { afterBackupError, events }
|
||||
}
|
||||
|
||||
describe('IncrementalRemoteWriter#afterBackup()', () => {
|
||||
it('cleans the VM directory and releases the lock after a failed transfer', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
|
||||
const { afterBackupError } = await runSteps(writer, {
|
||||
// a transfer that fails for another reason than an abort
|
||||
abort: vmTask => setImmediate(() => vmTask._abortController.abort(new Error('target unreachable'))),
|
||||
})
|
||||
|
||||
assert.equal(afterBackupError, undefined)
|
||||
assert.equal(calls.cleanVm, 2, 'clean-vm runs before and after the backup')
|
||||
assert.equal(calls.lockDisposed, true)
|
||||
})
|
||||
|
||||
it('cleans the VM directory and releases the lock after an abort, in a clean-vm subtask', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
|
||||
const { afterBackupError, events } = await runSteps(writer, {
|
||||
abort: vmTask => setImmediate(() => vmTask.abort()),
|
||||
})
|
||||
|
||||
assert.equal(afterBackupError, undefined)
|
||||
assert.equal(calls.cleanVm, 2, 'clean-vm runs before and after the backup')
|
||||
assert.equal(calls.lockDisposed, true)
|
||||
|
||||
const cleanVmIds = events.filter(_ => _.type === 'start' && _.properties?.name === 'clean-vm').map(_ => _.id)
|
||||
assert.equal(cleanVmIds.length, 2)
|
||||
const lastCleanVmEnd = events.find(_ => _.type === 'end' && _.id === cleanVmIds[1])
|
||||
assert.equal(lastCleanVmEnd.status, 'success')
|
||||
})
|
||||
|
||||
it('releases the lock when the clean-vm after the backup fails', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
writer.transfer = async () => {}
|
||||
const cleanVm = writer._cleanVm
|
||||
writer._cleanVm = function (options) {
|
||||
return options.cleanup ? Promise.reject(new Error('clean-vm failed')) : cleanVm.call(this, options)
|
||||
}
|
||||
|
||||
const { afterBackupError } = await runSteps(writer, { abort: () => {} })
|
||||
|
||||
assert.equal(afterBackupError?.message, 'clean-vm failed')
|
||||
assert.equal(calls.lockDisposed, true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('IncrementalRemoteWriter clean-vm and abort', () => {
|
||||
it('merges before and after the backup when it is not aborted', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
|
||||
writer.transfer = async () => {}
|
||||
await runSteps(writer, { abort: () => {} })
|
||||
|
||||
assert.deepEqual(
|
||||
calls.cleanVmOptions.map(_ => _.merge),
|
||||
[true, true]
|
||||
)
|
||||
})
|
||||
|
||||
it('still merges in the cleanup made after an abort, which is not stopped (level 1)', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
|
||||
await runSteps(writer, { abort: vmTask => setImmediate(() => vmTask.abort()) })
|
||||
|
||||
assert.deepEqual(
|
||||
calls.cleanVmOptions.map(_ => _.merge),
|
||||
[true, true]
|
||||
)
|
||||
})
|
||||
|
||||
it('aborts the clean-vm made before the transfer with the backup', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
let signal
|
||||
writer._adapter.cleanVm = async () => {
|
||||
signal = Task.abortSignal
|
||||
vmTask.abort()
|
||||
++calls.cleanVm
|
||||
return {}
|
||||
}
|
||||
|
||||
await vmTask.run(() => writer.beforeBackup())
|
||||
|
||||
assert.equal(signal.aborted, true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('IncrementalRemoteWriter#cleanup() and abort', () => {
|
||||
it('applies the retention in the export task when the backup is not aborted', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
writer.transfer = async () => {}
|
||||
|
||||
const { events } = await runSteps(writer, { abort: () => {} })
|
||||
|
||||
assert.deepEqual(calls.deletedEntries, ['old2.json', 'old1.json'])
|
||||
assert.equal(
|
||||
events.some(_ => _.type === 'start' && _.properties?.name === 'retention'),
|
||||
false,
|
||||
'no retention subtask'
|
||||
)
|
||||
})
|
||||
|
||||
it('still applies the retention when the abort arrives after the transfer, in a retention subtask', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
writer.transfer = async () => {}
|
||||
|
||||
const { afterBackupError, events } = await runSteps(writer, {
|
||||
abort: () => {},
|
||||
afterTransfer: vmTask => vmTask.abort(),
|
||||
})
|
||||
|
||||
assert.equal(afterBackupError, undefined)
|
||||
assert.deepEqual(calls.deletedEntries, ['old2.json', 'old1.json'])
|
||||
const retentionStart = events.find(_ => _.type === 'start' && _.properties?.name === 'retention')
|
||||
assert.notEqual(retentionStart, undefined)
|
||||
const retentionEnd = events.find(_ => _.type === 'end' && _.id === retentionStart.id)
|
||||
assert.equal(retentionEnd.status, 'success')
|
||||
})
|
||||
|
||||
it('does not apply the retention when the transfer is aborted', async () => {
|
||||
const { calls, writer } = createWriter()
|
||||
|
||||
await runSteps(writer, { abort: vmTask => setImmediate(() => vmTask.abort()) })
|
||||
|
||||
assert.deepEqual(calls.deletedEntries, [])
|
||||
})
|
||||
})
|
||||
|
||||
describe('IncrementalRemoteWriter#transfer() after an abort', () => {
|
||||
it('stops writing the disks and writes no metadata', async () => {
|
||||
const writes = []
|
||||
let metadataWritten = false
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
const writer = new IncrementalRemoteWriter({
|
||||
adapter: {
|
||||
getVhdFileName: basename => `${basename}.vhd`,
|
||||
handler: { readFile: async () => Promise.reject(new Error('no such file')) },
|
||||
listVmBackups: async () => [],
|
||||
writeVhd: async (path, disk, { signal }) => {
|
||||
if (signal?.aborted) {
|
||||
throw signal.reason
|
||||
}
|
||||
writes.push(path)
|
||||
// the backup is aborted once the first disk has been written
|
||||
vmTask.abort()
|
||||
return 1
|
||||
},
|
||||
writeVmBackupMetadata: async () => {
|
||||
metadataWritten = true
|
||||
},
|
||||
},
|
||||
config: {},
|
||||
job: { id: 'job', mode: 'delta' },
|
||||
remoteId: 'remote',
|
||||
schedule: { id: 'schedule' },
|
||||
settings: { diskPerVmConcurrency: 1 },
|
||||
vmUuid: 'vm',
|
||||
})
|
||||
const disk = { close: async () => {} }
|
||||
const deltaExport = {
|
||||
disks: { vdi1: disk, vdi2: disk },
|
||||
vbds: {},
|
||||
vdis: { vdi1: { uuid: 'uuid1', $snapshot_of$uuid: 'src1' }, vdi2: { uuid: 'uuid2', $snapshot_of$uuid: 'src2' } },
|
||||
vifs: {},
|
||||
vm: { uuid: 'vm' },
|
||||
vtpms: {},
|
||||
}
|
||||
|
||||
await vmTask
|
||||
.run(() =>
|
||||
writer.transfer({
|
||||
deltaExport,
|
||||
isVhdDifferencing: { vdi1: false, vdi2: false },
|
||||
timestamp: 0,
|
||||
vm: { uuid: 'vm' },
|
||||
vmSnapshot: {},
|
||||
})
|
||||
)
|
||||
.catch(() => {})
|
||||
|
||||
assert.equal(writes.length, 1, 'the second disk is not written')
|
||||
assert.equal(metadataWritten, false, 'no metadata is written for an aborted backup')
|
||||
})
|
||||
})
|
||||
@@ -327,20 +327,11 @@ export class IncrementalXapiWriter extends MixinXapiWriter(AbstractIncrementalWr
|
||||
})
|
||||
this._prepare = task.wrapInside(this._prepare)
|
||||
this.transfer = task.wrapInside(this.transfer)
|
||||
// `cleanup()` applies the retention once the backup has been written: an abort that arrives after the transfer
|
||||
// has already ended the task, the retention then runs in a cleanup subtask, which the abort does not stop
|
||||
let cleanupInTask
|
||||
if (this._healthCheckSr !== undefined) {
|
||||
cleanupInTask = task.wrapInside(this.cleanup)
|
||||
this.cleanup = task.wrapInside(this.cleanup)
|
||||
this.healthCheck = task.wrap(this.healthCheck)
|
||||
} else {
|
||||
cleanupInTask = task.wrap(this.cleanup)
|
||||
}
|
||||
const cleanup = this.cleanup
|
||||
this.cleanup = function () {
|
||||
return task.status === 'pending'
|
||||
? cleanupInTask.apply(this, arguments)
|
||||
: Task.run({ properties: { name: 'retention' }, cleanup: true }, () => cleanup.apply(this, arguments))
|
||||
this.cleanup = task.wrap(this.cleanup)
|
||||
}
|
||||
|
||||
return this._prepare(isFull)
|
||||
@@ -513,8 +504,6 @@ export class IncrementalXapiWriter extends MixinXapiWriter(AbstractIncrementalWr
|
||||
let targetVmRef
|
||||
await Task.run({ properties: { name: 'transfer' } }, async () => {
|
||||
targetVmRef = await importIncrementalVm(this.#decorateVmMetadata(deltaExport, timestamp), sr, {
|
||||
// the import is stopped once the backup is aborted, and the VM and VDIs it created are destroyed
|
||||
signal: Task.abortSignal,
|
||||
targetRef: this._targetVmRef,
|
||||
})
|
||||
// this also ensure the data are up to date on the snapshot
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { IncrementalXapiWriter } from './IncrementalXapiWriter.mjs'
|
||||
|
||||
// a writer whose retention is recorded instead of destroying the old replicas
|
||||
function createWriter({ healthCheckSr } = {}) {
|
||||
const calls = { deleteOldEntries: 0, deleteOrphanVdis: 0 }
|
||||
const writer = new IncrementalXapiWriter({
|
||||
config: {},
|
||||
healthCheckSr,
|
||||
job: { id: 'job' },
|
||||
schedule: { id: 'schedule' },
|
||||
settings: {},
|
||||
sr: { name_label: 'sr', uuid: 'sr' },
|
||||
vmUuid: 'vm',
|
||||
})
|
||||
|
||||
// what `prepare()` wraps in its "export" task
|
||||
writer._prepare = async () => {}
|
||||
writer.transfer = async () => {}
|
||||
writer._deleteOldEntries = async () => {
|
||||
++calls.deleteOldEntries
|
||||
}
|
||||
writer._deleteOrphanVdis = async () => {
|
||||
++calls.deleteOrphanVdis
|
||||
}
|
||||
|
||||
return { calls, writer }
|
||||
}
|
||||
|
||||
// the steps of a VM backup for this writer, in the order `IncrementalXapi#_copy()` calls them
|
||||
async function runSteps(writer, { afterTransfer = () => {} } = {}) {
|
||||
const events = []
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress: event => events.push(event) })
|
||||
let cleanupError
|
||||
|
||||
await vmTask
|
||||
.run(async () => {
|
||||
await writer.prepare({ isFull: true })
|
||||
await writer.transfer()
|
||||
afterTransfer(vmTask)
|
||||
await writer.cleanup().catch(error => {
|
||||
cleanupError = error
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
|
||||
return { cleanupError, events }
|
||||
}
|
||||
|
||||
const retentionTaskOf = events => events.find(_ => _.type === 'start' && _.properties?.name === 'retention')
|
||||
|
||||
for (const [label, healthCheckSr] of [
|
||||
['without health check', undefined],
|
||||
['with health check', { uuid: 'health-check-sr' }],
|
||||
]) {
|
||||
describe(`IncrementalXapiWriter#cleanup() and abort, ${label}`, () => {
|
||||
it('applies the retention in the export task when the backup is not aborted', async () => {
|
||||
const { calls, writer } = createWriter({ healthCheckSr })
|
||||
|
||||
const { cleanupError, events } = await runSteps(writer)
|
||||
|
||||
assert.equal(cleanupError, undefined)
|
||||
assert.deepEqual(calls, { deleteOldEntries: 1, deleteOrphanVdis: 1 })
|
||||
assert.equal(retentionTaskOf(events), undefined, 'no retention subtask')
|
||||
})
|
||||
|
||||
it('still applies the retention when the abort arrives after the transfer, in a retention subtask', async () => {
|
||||
const { calls, writer } = createWriter({ healthCheckSr })
|
||||
|
||||
const { cleanupError, events } = await runSteps(writer, { afterTransfer: vmTask => vmTask.abort() })
|
||||
|
||||
assert.equal(cleanupError, undefined)
|
||||
assert.deepEqual(calls, { deleteOldEntries: 1, deleteOrphanVdis: 1 })
|
||||
const retentionStart = retentionTaskOf(events)
|
||||
assert.notEqual(retentionStart, undefined)
|
||||
const retentionEnd = events.find(_ => _.type === 'end' && _.id === retentionStart.id)
|
||||
assert.equal(retentionEnd.status, 'success')
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -26,12 +26,9 @@ export const MixinRemoteWriter = (BaseClass = Object) =>
|
||||
this._vmBackupDir = getVmBackupDir(rest.vmUuid)
|
||||
}
|
||||
|
||||
// `cleanup`: the clean-vm is a cleanup subtask, it also runs after the backup has been aborted. Otherwise it is
|
||||
// not started once the backup is aborted, but a merge already running is not interrupted: `cleanVm()` does not
|
||||
// read the signal
|
||||
async _cleanVm({ cleanup = false, ...options }) {
|
||||
async _cleanVm(options) {
|
||||
try {
|
||||
return await Task.run({ properties: { name: 'clean-vm' }, cleanup }, () => {
|
||||
return await Task.run({ properties: { name: 'clean-vm' } }, () => {
|
||||
return this._adapter.cleanVm(this._vmBackupDir, {
|
||||
...options,
|
||||
logInfo: info,
|
||||
@@ -75,13 +72,8 @@ export const MixinRemoteWriter = (BaseClass = Object) =>
|
||||
const { handler } = this._adapter
|
||||
const synchronousMerge = this._settings.mergeBackupsSynchronously
|
||||
const willMergeInWorker = !synchronousMerge && !disableMergeWorker && typeof handler.getRealPath === 'function'
|
||||
let merge
|
||||
try {
|
||||
// part of the cleanup: it also runs after an abort, merge included (skipping it is a level 2 abort)
|
||||
;({ merge } = await this._cleanVm({ cleanup: true, remove: true, merge: !willMergeInWorker }))
|
||||
} finally {
|
||||
await this.#lock.dispose()
|
||||
}
|
||||
const { merge } = await this._cleanVm({ remove: true, merge: !willMergeInWorker })
|
||||
await this.#lock.dispose()
|
||||
|
||||
if (merge && willMergeInWorker) {
|
||||
const taskFile =
|
||||
|
||||
@@ -48,20 +48,13 @@ export const MixinXapiWriter = (BaseClass = Object) =>
|
||||
if (await this.#isAlreadyOnHealthCheckSr(baseVm)) {
|
||||
healthCheckVmRef = await Task.run(
|
||||
{ properties: { name: 'cloning-vm' } },
|
||||
async () =>
|
||||
await xapi.callAsync(
|
||||
Task.abortSignal,
|
||||
'VM.clone',
|
||||
this._targetVmRef,
|
||||
`Health Check - ${baseVm.name_label}`
|
||||
)
|
||||
async () => await xapi.callAsync('VM.clone', this._targetVmRef, `Health Check - ${baseVm.name_label}`)
|
||||
)
|
||||
} else {
|
||||
healthCheckVmRef = await Task.run(
|
||||
{ properties: { name: 'copying-vm' } },
|
||||
async () =>
|
||||
await xapi.callAsync(
|
||||
Task.abortSignal,
|
||||
'VM.copy',
|
||||
this._targetVmRef,
|
||||
`Health Check - ${baseVm.name_label}`,
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { Task } from '@vates/task'
|
||||
|
||||
import { FullXapiWriter } from './FullXapiWriter.mjs'
|
||||
|
||||
describe('MixinXapiWriter#healthCheck() after an abort', () => {
|
||||
it('passes the abort signal to the copy of the replica', async () => {
|
||||
const vmTask = new Task({ skipSubtasksAfterAbort: true, onProgress() {} })
|
||||
const calls = []
|
||||
const xapi = {
|
||||
getObject: ref => ({ $ref: ref, $xapi: xapi, name_label: 'replica' }),
|
||||
VM_getDisks: async () => [],
|
||||
callAsync: async (...args) => {
|
||||
calls.push(args)
|
||||
// the backup is aborted while the replica is being copied
|
||||
vmTask.abort()
|
||||
throw new Error('stop after the copy call')
|
||||
},
|
||||
}
|
||||
const writer = new FullXapiWriter({
|
||||
config: {},
|
||||
healthCheckSr: { $ref: 'OpaqueRef:health-check-sr', uuid: 'health-check-sr' },
|
||||
job: { id: 'job' },
|
||||
schedule: { id: 'schedule' },
|
||||
settings: { healthCheckTimeout: '10m' },
|
||||
sr: { $xapi: xapi, name_label: 'sr', uuid: 'sr' },
|
||||
vmUuid: 'vm',
|
||||
})
|
||||
writer._targetVmRef = 'OpaqueRef:replica'
|
||||
// the replica is not on the health check SR: it is copied there
|
||||
xapi.VM_getDisks = async () => ['OpaqueRef:vdi']
|
||||
xapi.getObject = ref =>
|
||||
ref === 'OpaqueRef:vdi' ? { $SR: { uuid: 'sr' } } : { $ref: ref, $xapi: xapi, name_label: 'replica' }
|
||||
|
||||
await vmTask.run(() => assert.rejects(writer.healthCheck(), /stop after the copy call/)).catch(() => {})
|
||||
|
||||
const [[signal, method]] = calls
|
||||
assert.ok(signal instanceof AbortSignal, 'the copy gets a signal')
|
||||
assert.equal(signal.aborted, true, 'the copy gets the abort signal of the backup')
|
||||
assert.equal(method, 'VM.copy')
|
||||
})
|
||||
})
|
||||
@@ -13,7 +13,6 @@
|
||||
- [Of created VMs](#of-created-vms-and-their-associated-vdis)
|
||||
- [Task logs](#task-logs)
|
||||
- [During backup](#during-backup)
|
||||
- [Aborted backup](#aborted-backup)
|
||||
- [During restoration](#during-restoration)
|
||||
- [API](#api)
|
||||
- [Run description object](#run-description-object)
|
||||
@@ -241,41 +240,6 @@ job.start(data: { mode: Mode, reportWhen: ReportWhen })
|
||||
└─ job.end
|
||||
```
|
||||
|
||||
### Aborted backup
|
||||
|
||||
When the backup runs in the xo-server process (`backups.disableWorkers`), it can be aborted from its task. The abort is
|
||||
always an `AbortError`, and it changes the task log above as follows:
|
||||
|
||||
```
|
||||
job.start(data: { mode: Mode, reportWhen: ReportWhen })
|
||||
├─ task.info(message: 'abort requested', data: { type: 'abortRequested', userId: string }) // when requested by a user
|
||||
├─ task.abortionRequested(reason: AbortError)
|
||||
├─ task.start(data: { type: 'VM', id: string, name_label?: string }) // VM being backed up
|
||||
│ ├─ task.abortionRequested(reason: AbortError)
|
||||
│ ├─ task.start(message: 'export', data: { … })
|
||||
│ │ ├─ task.start(message: 'transfer')
|
||||
│ │ │ └─ task.end(status: 'failure', result: AbortError) // the transfer stops
|
||||
│ │ └─ task.end(status: 'failure', result: AbortError)
|
||||
│ ├─ task.start(message: 'clean-vm') // cleanup subtask, still run
|
||||
│ │ └─ task.end
|
||||
│ └─ task.end(status: 'failure', result: AbortError)
|
||||
│ // no task for the VMs not started yet, no retry, no health check
|
||||
└─ job.end(status: 'failure', result: AbortError)
|
||||
```
|
||||
|
||||
- A step started as a subtask once the run is aborted fails right away, without running (the root task of the run
|
||||
is created with `skipSubtasksAfterAbort: true` in `@vates/task`).
|
||||
- The cleanup still runs: snapshot retention, removal of the snapshot data, restore of the VM's blocked operations,
|
||||
and the writers' `afterBackup()`. `clean-vm` (and the merge it runs) is a cleanup subtask (`cleanup: true` in
|
||||
`@vates/task`), which the abort does not stop.
|
||||
- The metadata of an incremental backup is not written, so the aborted backup is never listed as restorable; its disks
|
||||
are removed by `clean-vm`.
|
||||
- The retention of the backups (or replicas) only applies once the new one has been written. When the abort arrives
|
||||
after the transfer, the `export` task has already ended: the retention runs in a `retention` cleanup subtask of the VM
|
||||
task, before `clean-vm`.
|
||||
- In the backup logs and reports, a task that failed after an abort was requested on it (`abortionRequested`) has the
|
||||
status `interrupted`, and does not make its parent `failure`.
|
||||
|
||||
### During restoration
|
||||
|
||||
```
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"@vates/nbd-client": "^3.7.2",
|
||||
"@vates/parse-duration": "^0.1.1",
|
||||
"@vates/task": "^0.7.0",
|
||||
"@vates/types": "^3.2.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@xen-orchestra/async-map": "^0.1.5",
|
||||
"@xen-orchestra/disk-transform": "^1.3.4",
|
||||
"@xen-orchestra/fs": "^4.11.0",
|
||||
@@ -70,7 +70,7 @@
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xen-orchestra/xapi": "^10.1.0"
|
||||
"@xen-orchestra/xapi": "^10.0.0"
|
||||
},
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"author": {
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
## **next**
|
||||
|
||||
- [VM/Network] Add possibility to delete a VIF (PR [#10726](https://github.com/vatesfr/xen-orchestra/pull/10726))
|
||||
|
||||
## **0.28.0** (2026/12/01)
|
||||
|
||||
- [VDIs] The used space of a VDI now includes its whole snapshot chain instead of only its last layer, which showed almost 0% for disks with snapshots. It is shown as a size, without usage bar or free space (PR [#10116](https://github.com/vatesfr/xen-orchestra/pull/10116))
|
||||
- [Web-Core/UiCircleProgressBar] Add a brand accent and an option to hide the value (PR [#10849](https://github.com/vatesfr/xen-orchestra/pull/10849))
|
||||
- [Tables] Cells fit on one line: long names are cut in the middle, extra tags go under "+N" and long texts end with "…" (PR [#10850](https://github.com/vatesfr/xen-orchestra/pull/10850))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xen-orchestra/lite",
|
||||
"version": "0.28.0",
|
||||
"version": "0.27.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "GIT_HEAD=$(git rev-parse HEAD) vite",
|
||||
@@ -27,13 +27,13 @@
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^18.19.80",
|
||||
"@vates/types": "^3.2.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@vitejs/plugin-vue": "^6.0.0",
|
||||
"@vue/tsconfig": "^0.9.0",
|
||||
"@vueuse/core": "^14.0.0",
|
||||
"@vueuse/math": "^14.0.0",
|
||||
"@vueuse/shared": "^14.0.0",
|
||||
"@xen-orchestra/web-core": "^0.67.0",
|
||||
"@xen-orchestra/web-core": "^0.66.1",
|
||||
"complex-matcher": "^1.1.1",
|
||||
"d3-time-format": "^4.1.0",
|
||||
"decorator-synchronized": "^0.6.0",
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { XenApiNetwork, XenApiVif, XenApiVm } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { useVifConnection } from '@/modules/vif/composables/use-vif-connection.composable.ts'
|
||||
import { useVifDelete } from '@/modules/vif/composables/use-vif-delete.composable.ts'
|
||||
import { useVifEdit } from '@/modules/vif/composables/use-vif-edit.composable.ts'
|
||||
import { useNetworkStore } from '@/stores/xen-api/network.store.ts'
|
||||
import { useVifStore } from '@/stores/xen-api/vif.store.ts'
|
||||
@@ -107,8 +106,6 @@ const { HeadCells, BodyCells } = useVifColumns({
|
||||
vm: () => vm,
|
||||
})
|
||||
|
||||
const { deleteVifs, canDeleteVifs, isDeletingVifs, deleteVifsErrorMessage } = useVifDelete(() => [vif])
|
||||
|
||||
const connectionAction = useMapper(
|
||||
() => (vif.currently_attached ? CONNECTION_ACTION.DISCONNECT : CONNECTION_ACTION.CONNECT),
|
||||
() => ({
|
||||
@@ -146,15 +143,6 @@ const { HeadCells, BodyCells } = useVifColumns({
|
||||
actions: [
|
||||
{ label: t('action:edit'), icon: 'action:edit', onClick: () => goToVifEdit(vif) } satisfies ActionItem,
|
||||
connectionAction.value,
|
||||
{
|
||||
label: t('action:delete'),
|
||||
icon: 'action:delete',
|
||||
onClick: () => deleteVifs(),
|
||||
disabled: !canDeleteVifs.value,
|
||||
busy: isDeletingVifs.value,
|
||||
hint: canDeleteVifs.value ? undefined : deleteVifsErrorMessage.value,
|
||||
accent: 'danger',
|
||||
} satisfies ActionItem,
|
||||
],
|
||||
}),
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<template>
|
||||
<VtsDeleteButton
|
||||
:hint="deleteVifsErrorMessage"
|
||||
:disabled="!canDeleteVifs"
|
||||
:busy="isDeletingVifs"
|
||||
@click="deleteVifs()"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { XenApiVif } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { useVifDelete } from '@/modules/vif/composables/use-vif-delete.composable.ts'
|
||||
import VtsDeleteButton from '@core/components/delete-button/VtsDeleteButton.vue'
|
||||
|
||||
const { vif } = defineProps<{
|
||||
vif: XenApiVif
|
||||
}>()
|
||||
|
||||
const { deleteVifs, canDeleteVifs, isDeletingVifs, deleteVifsErrorMessage } = useVifDelete(() => [vif])
|
||||
</script>
|
||||
@@ -3,7 +3,6 @@
|
||||
<template v-if="vif" #actions>
|
||||
<VifEditButton :vif />
|
||||
<VifConnectionToggleButton v-if="vm" :vif :vm />
|
||||
<VifDeleteButton :vif />
|
||||
</template>
|
||||
<template v-if="vif" #default>
|
||||
<!-- VIF -->
|
||||
@@ -111,7 +110,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { XenApiVif } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import VifConnectionToggleButton from '@/modules/vif/components/actions/connection/VifConnectionToggleButton.vue'
|
||||
import VifDeleteButton from '@/modules/vif/components/actions/delete/VifDeleteButton.vue'
|
||||
import VifEditButton from '@/modules/vif/components/actions/edit/VifEditButton.vue'
|
||||
import { isTxChecksummingEnabled } from '@/modules/vif/utils/vif-tx-checksumming.util.ts'
|
||||
import { useNetworkStore } from '@/stores/xen-api/network.store.ts'
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
import type { XenApiVif } from '@/libs/xen-api/xen-api.types.ts'
|
||||
import { useVifDeleteJob } from '@/modules/vif/jobs/vif-delete.job.ts'
|
||||
import { useDeleteModal } from '@core/composables/modals/use-delete-modal.ts'
|
||||
import { useRouteQuery } from '@core/composables/route-query.composable.ts'
|
||||
import { toComputed } from '@core/utils/to-computed.util.ts'
|
||||
import type { MaybeRefOrGetter } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
export function useVifDelete(rawVifs: MaybeRefOrGetter<XenApiVif[]>) {
|
||||
const vifs = toComputed(rawVifs)
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const selectedVifId = useRouteQuery('id')
|
||||
|
||||
const {
|
||||
run,
|
||||
canRun: canDeleteVifs,
|
||||
isRunning: isDeletingVifs,
|
||||
errorMessage: deleteVifsErrorMessage,
|
||||
} = useVifDeleteJob(vifs)
|
||||
|
||||
const { open } = useDeleteModal()
|
||||
|
||||
function deleteVifs() {
|
||||
const count = vifs.value.length
|
||||
|
||||
return open({
|
||||
props: {
|
||||
subject: t('n-vifs', { n: count }),
|
||||
confirmLabel: t('action:delete-n-vifs', { n: count }),
|
||||
},
|
||||
events: {
|
||||
onConfirm: () => {
|
||||
const isSelectedVifDeleted = vifs.value.some(vif => vif.uuid === selectedVifId.value)
|
||||
|
||||
run({
|
||||
detached: true,
|
||||
onSuccess: () => {
|
||||
if (isSelectedVifDeleted) {
|
||||
selectedVifId.value = ''
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
return { deleteVifs, canDeleteVifs, isDeletingVifs, deleteVifsErrorMessage }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import { vifsArg } from '@/modules/vif/jobs/vif-args.ts'
|
||||
import { useXenApiStore } from '@/stores/xen-api.store.ts'
|
||||
import { defineJob, JobError, JobRunningError } from '@core/packages/job'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
export const useVifDeleteJob = defineJob('vif.delete', [vifsArg], () => {
|
||||
const xapi = useXenApiStore().getXapi()
|
||||
const { t } = useI18n()
|
||||
|
||||
return {
|
||||
async run(vifs) {
|
||||
const results = await Promise.allSettled(vifs.map(vif => xapi.vif.delete(vif.$ref)))
|
||||
|
||||
results.forEach((result, index) => {
|
||||
if (result.status === 'rejected') {
|
||||
console.error(`Failed to delete VIF ${vifs[index].uuid}:`, result.reason)
|
||||
}
|
||||
})
|
||||
|
||||
return results
|
||||
},
|
||||
|
||||
validate: (isRunning, vifs) => {
|
||||
if (vifs.length === 0) {
|
||||
throw new JobError(t('job:vif-delete:missing-vif'))
|
||||
}
|
||||
|
||||
if (isRunning) {
|
||||
throw new JobRunningError(t('job:delete:in-progress'))
|
||||
}
|
||||
|
||||
if (vifs.some(vif => vif.currently_attached)) {
|
||||
throw new JobError(t('vif-connected'))
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
@@ -6,7 +6,6 @@
|
||||
prop('accent').required().enum('brand', 'info', 'warning', 'danger').preset('brand').widget(),
|
||||
prop('size').required().enum('small', 'medium', 'large').preset('medium').widget(),
|
||||
prop('disabled').bool().widget(),
|
||||
prop('restricted').bool().widget(),
|
||||
prop('selected').bool().widget(),
|
||||
prop('counter')
|
||||
.type('CounterValue | { value: CounterValue; accent: CounterAccent }')
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
prop('size').type('ButtonSize').enum('small', 'medium').preset('medium').required().widget(),
|
||||
prop('busy').bool().widget(),
|
||||
prop('disabled').bool().widget().ctx(),
|
||||
prop('restricted').bool().widget(),
|
||||
prop('lockIcon').bool().widget(),
|
||||
iconProp('leftIcon'),
|
||||
iconProp('rightIcon'),
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@types/node": "^22.3.0",
|
||||
"@vates/types": "^3.2.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"rimraf": "^6.0.0",
|
||||
"typescript": "~5.6.3",
|
||||
"typescript-eslint": "^8.61.0"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"xo-common": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vates/types": "^3.2.0"
|
||||
"@vates/types": "^3.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"postversion": "npm publish --access public",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@xen-orchestra/proxy",
|
||||
"version": "0.35.2",
|
||||
"version": "0.35.1",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"description": "XO Proxy used to remotely execute backup jobs",
|
||||
"keywords": [
|
||||
@@ -40,7 +40,7 @@
|
||||
"@xen-orchestra/mixin": "^0.2.1",
|
||||
"@xen-orchestra/mixins": "^0.24.0",
|
||||
"@xen-orchestra/self-signed": "^0.2.1",
|
||||
"@xen-orchestra/xapi": "^10.1.0",
|
||||
"@xen-orchestra/xapi": "^10.0.0",
|
||||
"ajv": "^8.0.3",
|
||||
"app-conf": "^3.0.0",
|
||||
"async-iterator-to-stream": "^1.1.0",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"main": "./dist/index.mjs",
|
||||
"name": "@xen-orchestra/rest-api",
|
||||
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/rest-api",
|
||||
"version": "0.43.1",
|
||||
"version": "0.43.0",
|
||||
"description": "REST API to manage your XOA",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"private": false,
|
||||
@@ -38,14 +38,14 @@
|
||||
"@vates/async-each": "^1.0.3",
|
||||
"@vates/obfuscate": "^0.2.0",
|
||||
"@vates/task": "^0.7.0",
|
||||
"@vates/types": "^3.2.0",
|
||||
"@vates/types": "^3.1.0",
|
||||
"@xen-orchestra/acl": "^1.9.0",
|
||||
"@xen-orchestra/backups": "^1.0.1",
|
||||
"@xen-orchestra/cron": "^1.0.7",
|
||||
"@xen-orchestra/log": "^1.0.0",
|
||||
"@xen-orchestra/qcow2": "^1.4.1",
|
||||
"@xen-orchestra/vmdk": "^1.0.0",
|
||||
"@xen-orchestra/xapi": "^10.1.0",
|
||||
"@xen-orchestra/xapi": "^10.0.0",
|
||||
"complex-matcher": "^1.1.1",
|
||||
"fast-xml-parser": "^5.10.1",
|
||||
"golike-defer": "^0.5.1",
|
||||
|
||||
@@ -13,7 +13,6 @@ import { mcpGateMiddleware } from './middlewares/mcp-gate.middleware.mjs'
|
||||
import { type OpenAPIV3 } from 'openapi-types'
|
||||
import { createExternalRouter, sendObjects } from './router/external-router.mjs'
|
||||
import { BASE_URL } from './helpers/utils.helper.mjs'
|
||||
import { rejectCrossSiteMutation } from './middlewares/csrf.middleware.mjs'
|
||||
|
||||
export { sendObjects }
|
||||
|
||||
@@ -56,7 +55,6 @@ export default function setupRestApi(express: Express, xoApp: XoApp) {
|
||||
express.use(BASE_URL, setupApiContext(xoApp))
|
||||
express.use(BASE_URL, logMiddleware)
|
||||
express.use(BASE_URL, mcpGateMiddleware)
|
||||
express.use(BASE_URL, rejectCrossSiteMutation)
|
||||
|
||||
RegisterRoutes(express)
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import type { AuthenticatedRequest } from '../helpers/helper.type.mjs'
|
||||
import { iocContainer } from '../ioc/ioc.mjs'
|
||||
import { RestApi } from '../rest-api/rest-api.mjs'
|
||||
import { ACL_MIDDLEWARE_NAME } from './acl.middleware.mjs'
|
||||
import { parseBasicCredentials } from './basic-auth.helper.mjs'
|
||||
import type { SecurityName } from '@vates/types'
|
||||
const log = createLogger('xo:rest-api:authentication')
|
||||
|
||||
@@ -74,7 +73,7 @@ export function setupApiContext(xoApp: XoApp) {
|
||||
return next(new ApiError('Malformed Authorization header', 400))
|
||||
}
|
||||
|
||||
const { username, password } = parseBasicCredentials(encoded)
|
||||
const [username, password] = Buffer.from(encoded, 'base64').toString().split(':')
|
||||
Object.assign(credentials, { username, password, otp: query.otp })
|
||||
res.locals.authType = 'basic'
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* Extracts the credentials from the base64 payload of a `Authorization: Basic` header.
|
||||
*
|
||||
* Per RFC 7617 §2, the user-id cannot contain a colon but the password can: split on the
|
||||
* first colon only and keep the remainder as the password.
|
||||
*/
|
||||
export function parseBasicCredentials(encoded: string): { username: string; password: string | undefined } {
|
||||
const decoded = Buffer.from(encoded, 'base64').toString()
|
||||
const index = decoded.indexOf(':')
|
||||
if (index === -1) {
|
||||
return { username: decoded, password: undefined }
|
||||
}
|
||||
return { username: decoded.slice(0, index), password: decoded.slice(index + 1) }
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { describe, it } from 'node:test'
|
||||
|
||||
import { parseBasicCredentials } from './basic-auth.helper.mjs'
|
||||
|
||||
const encode = (value: string) => Buffer.from(value).toString('base64')
|
||||
|
||||
describe('parseBasicCredentials()', () => {
|
||||
it('splits username and password', () => {
|
||||
assert.deepEqual(parseBasicCredentials(encode('user:pass')), { username: 'user', password: 'pass' })
|
||||
})
|
||||
|
||||
it('keeps colons found in the password', () => {
|
||||
assert.deepEqual(parseBasicCredentials(encode('user:a:b')), { username: 'user', password: 'a:b' })
|
||||
assert.deepEqual(parseBasicCredentials(encode('user::')), { username: 'user', password: ':' })
|
||||
})
|
||||
|
||||
it('supports an empty password', () => {
|
||||
assert.deepEqual(parseBasicCredentials(encode('user:')), { username: 'user', password: '' })
|
||||
})
|
||||
|
||||
it('has no password when there is no colon', () => {
|
||||
assert.deepEqual(parseBasicCredentials(encode('user')), { username: 'user', password: undefined })
|
||||
})
|
||||
})
|
||||
@@ -1,31 +0,0 @@
|
||||
import type { NextFunction, Response, Request } from 'express'
|
||||
import { ApiError } from '../helpers/error.helper.mjs'
|
||||
|
||||
const SAFE_METHODS = new Set(['GET', 'HEAD', 'OPTIONS'])
|
||||
|
||||
function isCrossSite(req: Request): boolean {
|
||||
const secFetchSite = req.headers['sec-fetch-site']
|
||||
if (secFetchSite !== undefined) {
|
||||
return secFetchSite === 'cross-site'
|
||||
}
|
||||
|
||||
const { origin } = req.headers
|
||||
if (origin !== undefined) {
|
||||
try {
|
||||
return new URL(origin).host !== req.headers.host
|
||||
} catch (error) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
export function rejectCrossSiteMutation(req: Request, res: Response, next: NextFunction) {
|
||||
// res.locals.authType is setup by authentication.middleware#setupApiContext
|
||||
if (!SAFE_METHODS.has(req.method) && res.locals.authType === 'token' && isCrossSite(req)) {
|
||||
return next(new ApiError('cross-site request rejected', 403))
|
||||
}
|
||||
|
||||
next()
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { describe, it } from 'node:test'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { ApiError } from '../helpers/error.helper.mjs'
|
||||
import { rejectCrossSiteMutation } from './csrf.middleware.mjs'
|
||||
|
||||
const run = (method: string, opts: { authType?: 'token' | 'basic'; headers?: Request['headers'] }) => {
|
||||
const req = { method, headers: opts.headers ?? {} } as Request
|
||||
const res = { locals: { authType: 'authType' in opts ? opts.authType : 'token' } } as unknown as Response
|
||||
let next: unknown
|
||||
|
||||
rejectCrossSiteMutation(req, res, (err?: unknown) => {
|
||||
next = err
|
||||
})
|
||||
return next
|
||||
}
|
||||
|
||||
const UNSAFE = ['POST', 'PUT', 'PATCH', 'DELETE']
|
||||
|
||||
describe('rejectCrossSiteMutation', () => {
|
||||
describe('lets through', () => {
|
||||
it('a safe method, even cross-site with a cookie', () => {
|
||||
assert.equal(run('GET', { headers: { 'sec-fetch-site': 'cross-site' } }), undefined)
|
||||
})
|
||||
|
||||
for (const method of UNSAFE) {
|
||||
it(`${method} authenticated by basic, even cross-site`, () => {
|
||||
assert.equal(run(method, { authType: 'basic', headers: { 'sec-fetch-site': 'cross-site' } }), undefined)
|
||||
})
|
||||
it(`${method} unauthenticated, even cross-site`, () => {
|
||||
assert.equal(run(method, { authType: undefined, headers: { 'sec-fetch-site': 'cross-site' } }), undefined)
|
||||
})
|
||||
it(`${method} cookie + Sec-Fetch-Site same-origin`, () => {
|
||||
assert.equal(run(method, { headers: { 'sec-fetch-site': 'same-origin' } }), undefined)
|
||||
})
|
||||
it(`${method} cookie + Sec-Fetch-Site same-site`, () => {
|
||||
assert.equal(run(method, { headers: { 'sec-fetch-site': 'same-site' } }), undefined)
|
||||
})
|
||||
it(`${method} cookie + Sec-Fetch-Site none`, () => {
|
||||
assert.equal(run(method, { headers: { 'sec-fetch-site': 'none' } }), undefined)
|
||||
})
|
||||
it(`${method} cookie + no metadata (xo-cli, curl)`, () => {
|
||||
assert.equal(run(method, { headers: {} }), undefined)
|
||||
})
|
||||
it(`${method} cookie + Origin matches Host`, () => {
|
||||
assert.equal(run(method, { headers: { origin: 'https://xo.example.com', host: 'xo.example.com' } }), undefined)
|
||||
})
|
||||
it(`${method} cookie: Sec-Fetch-Site wins over a mismatching Origin`, () => {
|
||||
assert.equal(
|
||||
run(method, {
|
||||
headers: { 'sec-fetch-site': 'same-origin', origin: 'https://evil.com', host: 'xo.example.com' },
|
||||
}),
|
||||
undefined
|
||||
)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
describe('rejects (403)', () => {
|
||||
const assertRejected = (error: unknown) => {
|
||||
assert.ok(error instanceof ApiError)
|
||||
assert.equal((error as ApiError).status, 403)
|
||||
}
|
||||
|
||||
for (const method of UNSAFE) {
|
||||
it(`${method} cookie + Sec-Fetch-Site cross-site`, () => {
|
||||
assertRejected(run(method, { headers: { 'sec-fetch-site': 'cross-site' } }))
|
||||
})
|
||||
it(`${method} cookie + Origin host != Host`, () => {
|
||||
assertRejected(run(method, { headers: { origin: 'https://evil.com', host: 'xo.example.com' } }))
|
||||
})
|
||||
it(`${method} cookie + malformed Origin (fail closed)`, () => {
|
||||
assertRejected(run(method, { headers: { origin: 'null', host: 'xo.example.com' } }))
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
# Directives
|
||||
|
||||
- [vRestricted](../lib/directives/restricted.directive.md)
|
||||
- [vTooltip](../lib/directives/tooltip.directive.md)
|
||||
|
||||
# Utils
|
||||
|
||||
@@ -64,8 +64,6 @@ Testing uses **Vitest 5** with a single `unit` project (see `vitest.config.ts`):
|
||||
| `test/mount-with-select.ts` | `renderSelect(id, { accent?, ref? }, slots?)`: renders the `VtsSelect` of a select id, `neutral` accent by default; `mountSelect`: a `VtsSelect` of string sources, its config, accent, wrapper message, option slot and a callback receiving the mounted select |
|
||||
| `test/find-title.ts` | `findTitle`: the `.title` of a `VtsSuccessStateHero` or a list item, `undefined` without one (also used by XO 6) |
|
||||
| `test/create-task-item.ts` | `createTaskItem`: a `Task` as the task lists display it, with the given overrides (also used by XO 6) |
|
||||
| `test/find-tooltip-contents.ts` | `findTooltipContents`: the content of every tooltip currently shown, in order |
|
||||
| `test/hover.ts` | `hover`: moves the mouse over an element |
|
||||
| `tsconfig.vitest.json` | Type-checks test files with the Vitest globals and the `@core-test` alias |
|
||||
| `tsconfig.app.json` | Type-checks the library, test files excluded |
|
||||
|
||||
|
||||
@@ -35,12 +35,7 @@
|
||||
import VtsResizeHandle from '@core/components/resize-handle/VtsResizeHandle.vue'
|
||||
import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive.ts'
|
||||
import {
|
||||
SIDEBAR_TRANSITION_DURATION,
|
||||
type SidebarSide,
|
||||
useLeftSidebarStore,
|
||||
useRightSidebarStore,
|
||||
} from '@core/packages/sidebar'
|
||||
import { type SidebarSide, useLeftSidebarStore, useRightSidebarStore } from '@core/packages/sidebar'
|
||||
import { useUiStore } from '@core/stores/ui.store.ts'
|
||||
import { IK_MENU_ACTION_HANDLER } from '@core/utils/injection-keys.util.ts'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
@@ -73,8 +68,6 @@ const showResizeHandle = computed(() => !ui.isSmall && sidebar.value.isExpanded)
|
||||
|
||||
const resizeHandlePosition = computed(() => (side === 'left' ? 'end' : 'start'))
|
||||
|
||||
const slideTransition = `margin-inline ${SIDEBAR_TRANSITION_DURATION}ms, transform ${SIDEBAR_TRANSITION_DURATION}ms`
|
||||
|
||||
provide(IK_MENU_ACTION_HANDLER, () => {
|
||||
if (ui.isSmall) {
|
||||
sidebar.value.toggleExpand(false)
|
||||
@@ -100,7 +93,9 @@ const className = computed(() => [
|
||||
background-color: var(--color-neutral-background-secondary);
|
||||
width: v-bind('sidebar.cssWidth');
|
||||
z-index: 1010;
|
||||
transition: v-bind(slideTransition);
|
||||
transition:
|
||||
margin-inline 0.25s,
|
||||
transform 0.25s;
|
||||
|
||||
&.bordered {
|
||||
&.side--left {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<UiInfo
|
||||
v-tooltip="iconOnly ? currentStatus.text : false"
|
||||
class="vts-status"
|
||||
:accent="currentStatus.accent"
|
||||
:role="iconOnly ? 'img' : undefined"
|
||||
:aria-label="iconOnly ? currentStatus.text : undefined"
|
||||
@@ -74,13 +73,3 @@ const currentStatus = useMapper<Status, { text: string; accent: InfoAccent }>(
|
||||
false
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.ui-info.vts-status {
|
||||
align-items: center;
|
||||
|
||||
:deep(.icon) {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<UiTableCell :flexible>
|
||||
<div class="username">
|
||||
<div class="user-name">
|
||||
<UiUserLogo size="small" />
|
||||
<UiLink :to :href size="medium" class="link">
|
||||
<UiLink :href size="medium" class="link">
|
||||
<VtsMiddleEllipsis v-if="flexible" :text="content" />
|
||||
<span v-else v-tooltip class="text-ellipsis">{{ content }}</span>
|
||||
</UiLink>
|
||||
@@ -15,19 +15,17 @@ import VtsMiddleEllipsis from '@core/components/middle-ellipsis/VtsMiddleEllipsi
|
||||
import UiLink from '@core/components/ui/link/UiLink.vue'
|
||||
import UiTableCell from '@core/components/ui/table-cell/UiTableCell.vue'
|
||||
import UiUserLogo from '@core/components/ui/user-logo/UiUserLogo.vue'
|
||||
import type { LinkOptions } from '@core/composables/link-component.composable.ts'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive.ts'
|
||||
|
||||
defineProps<
|
||||
Pick<LinkOptions, 'to' | 'href'> & {
|
||||
content: string
|
||||
flexible?: boolean
|
||||
}
|
||||
>()
|
||||
defineProps<{
|
||||
content: string
|
||||
href?: string
|
||||
flexible?: boolean
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped lang="postcss">
|
||||
.username {
|
||||
.user-name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
@@ -1,47 +0,0 @@
|
||||
import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
|
||||
import { createGlobalTestConfig } from '@core-test/create-global-test-config.ts'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
function mountButtonIcon({ restricted = false }: { restricted?: boolean } = {}) {
|
||||
const onClick = vi.fn()
|
||||
|
||||
const wrapper = mount(UiButtonIcon, {
|
||||
global: createGlobalTestConfig(),
|
||||
props: { icon: 'fa:trash', accent: 'brand', size: 'medium', restricted },
|
||||
attrs: { onClick },
|
||||
})
|
||||
|
||||
return { wrapper, onClick }
|
||||
}
|
||||
|
||||
it('is marked as disabled but stays focusable when restricted', () => {
|
||||
const { wrapper } = mountButtonIcon({ restricted: true })
|
||||
|
||||
expect(wrapper.attributes('aria-disabled')).toBe('true')
|
||||
expect(wrapper.attributes('disabled')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('is not marked as disabled by default', () => {
|
||||
const { wrapper } = mountButtonIcon()
|
||||
|
||||
expect(wrapper.attributes('aria-disabled')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('has the muted variant when restricted', () => {
|
||||
const restrictedButtonIcon = mountButtonIcon({ restricted: true })
|
||||
const buttonIcon = mountButtonIcon()
|
||||
|
||||
expect(restrictedButtonIcon.wrapper.classes()).toContain('muted')
|
||||
expect(buttonIcon.wrapper.classes()).not.toContain('muted')
|
||||
})
|
||||
|
||||
it('runs its click listener only when not restricted', async () => {
|
||||
const restrictedButtonIcon = mountButtonIcon({ restricted: true })
|
||||
const buttonIcon = mountButtonIcon()
|
||||
|
||||
await restrictedButtonIcon.wrapper.trigger('click')
|
||||
await buttonIcon.wrapper.trigger('click')
|
||||
|
||||
expect(restrictedButtonIcon.onClick).not.toHaveBeenCalled()
|
||||
expect(buttonIcon.onClick).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- v11 -->
|
||||
<!-- v10 -->
|
||||
<!-- TODO: Add complex icon -->
|
||||
<template>
|
||||
<button v-restricted="restricted" :class="classNames" :disabled class="ui-button-icon" type="button">
|
||||
<button :class="classNames" :disabled class="ui-button-icon" type="button">
|
||||
<VtsIcon :name="icon" size="current" />
|
||||
<UiCounter v-if="counterProps !== undefined" v-bind="counterProps" size="small" variant="primary" class="counter" />
|
||||
</button>
|
||||
@@ -10,7 +10,6 @@
|
||||
<script lang="ts" setup>
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import UiCounter, { type CounterAccent, type CounterValue } from '@core/components/ui/counter/UiCounter.vue'
|
||||
import { vRestricted } from '@core/directives/restricted.directive.ts'
|
||||
import type { IconName } from '@core/icons'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
import { computed } from 'vue'
|
||||
@@ -19,12 +18,11 @@ export type ButtonIconAccent = 'brand' | 'info' | 'warning' | 'danger'
|
||||
|
||||
export type ButtonIconSize = 'small' | 'medium' | 'large'
|
||||
|
||||
const { accent, size, disabled, restricted, selected, counter, targetScale } = defineProps<{
|
||||
const { accent, size, disabled, selected, counter, targetScale } = defineProps<{
|
||||
icon: IconName
|
||||
size: ButtonIconSize
|
||||
accent: ButtonIconAccent
|
||||
disabled?: boolean
|
||||
restricted?: boolean
|
||||
selected?: boolean
|
||||
counter?: CounterValue | { value: CounterValue; accent: CounterAccent }
|
||||
targetScale?: number | { x: number; y: number }
|
||||
@@ -57,7 +55,7 @@ const classNames = computed(() => {
|
||||
toVariants({
|
||||
accent,
|
||||
size,
|
||||
muted: disabled || restricted,
|
||||
muted: disabled,
|
||||
selected,
|
||||
}),
|
||||
]
|
||||
@@ -76,7 +74,7 @@ const classNames = computed(() => {
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
|
||||
&.muted {
|
||||
&:disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
import UiButton from '@core/components/ui/button/UiButton.vue'
|
||||
import { createGlobalTestConfig } from '@core-test/create-global-test-config.ts'
|
||||
import { mount } from '@vue/test-utils'
|
||||
|
||||
function mountButton({ restricted = false }: { restricted?: boolean } = {}) {
|
||||
const onClick = vi.fn()
|
||||
|
||||
const wrapper = mount(UiButton, {
|
||||
global: createGlobalTestConfig(),
|
||||
props: { variant: 'primary', accent: 'brand', size: 'medium', restricted },
|
||||
attrs: { onClick },
|
||||
slots: { default: 'Label' },
|
||||
})
|
||||
|
||||
return { wrapper, onClick }
|
||||
}
|
||||
|
||||
it('is marked as disabled but stays focusable when restricted', () => {
|
||||
const { wrapper } = mountButton({ restricted: true })
|
||||
|
||||
expect(wrapper.attributes('aria-disabled')).toBe('true')
|
||||
expect(wrapper.attributes('disabled')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('is not marked as disabled by default', () => {
|
||||
const { wrapper } = mountButton()
|
||||
|
||||
expect(wrapper.attributes('aria-disabled')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('has the disabled variant when restricted', () => {
|
||||
const restrictedButton = mountButton({ restricted: true })
|
||||
const button = mountButton()
|
||||
|
||||
expect(restrictedButton.wrapper.classes()).toContain('disabled')
|
||||
expect(button.wrapper.classes()).not.toContain('disabled')
|
||||
})
|
||||
|
||||
it('runs its click listener only when not restricted', async () => {
|
||||
const restrictedButton = mountButton({ restricted: true })
|
||||
const button = mountButton()
|
||||
|
||||
await restrictedButton.wrapper.trigger('click')
|
||||
await button.wrapper.trigger('click')
|
||||
|
||||
expect(restrictedButton.onClick).not.toHaveBeenCalled()
|
||||
expect(button.onClick).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
@@ -1,12 +1,6 @@
|
||||
<!-- v9 -->
|
||||
<!-- v7 -->
|
||||
<template>
|
||||
<button
|
||||
v-restricted="restricted"
|
||||
:class="classNames"
|
||||
:disabled="busy || isDisabled || lockIcon"
|
||||
class="ui-button"
|
||||
type="button"
|
||||
>
|
||||
<button :class="classNames" :disabled="busy || isDisabled || lockIcon" class="ui-button" type="button">
|
||||
<VtsIcon :name="leftIcon" class="icon" size="current" />
|
||||
<slot />
|
||||
<VtsIcon :name="rightIcon" class="icon" size="current" />
|
||||
@@ -19,7 +13,6 @@
|
||||
import VtsIcon from '@core/components/icon/VtsIcon.vue'
|
||||
import UiLoader from '@core/components/ui/loader/UiLoader.vue'
|
||||
import { useDisabled } from '@core/composables/disabled.composable.ts'
|
||||
import { vRestricted } from '@core/directives/restricted.directive.ts'
|
||||
import type { IconName } from '@core/icons'
|
||||
import { toVariants } from '@core/utils/to-variants.util.ts'
|
||||
import { computed } from 'vue'
|
||||
@@ -34,13 +27,12 @@ export type ButtonProps = {
|
||||
size: ButtonSize
|
||||
busy?: boolean
|
||||
disabled?: boolean
|
||||
restricted?: boolean
|
||||
lockIcon?: boolean
|
||||
leftIcon?: IconName
|
||||
rightIcon?: IconName
|
||||
}
|
||||
|
||||
const { accent, variant, size, disabled, restricted, busy, lockIcon } = defineProps<ButtonProps>()
|
||||
const { accent, variant, size, disabled, busy, lockIcon } = defineProps<ButtonProps>()
|
||||
|
||||
defineSlots<{
|
||||
default(): any
|
||||
@@ -62,7 +54,7 @@ const classNames = computed(() => [
|
||||
size,
|
||||
busy,
|
||||
lock: lockIcon,
|
||||
disabled: isDisabled.value || restricted,
|
||||
disabled: isDisabled.value,
|
||||
}),
|
||||
])
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- v9 -->
|
||||
<template>
|
||||
<div class="ui-checkbox">
|
||||
<label :class="[classNames, { 'has-label': slots.default }]" class="checkbox-label" v-bind="wrapperAttrs">
|
||||
<label :class="classNames" class="checkbox-label" v-bind="wrapperAttrs">
|
||||
<input
|
||||
v-model="checkboxModel"
|
||||
:disabled="isDisabled"
|
||||
@@ -79,14 +79,6 @@ const attrs = useAttrs()
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
|
||||
&.has-label {
|
||||
align-items: flex-start;
|
||||
|
||||
.fake-checkbox {
|
||||
margin-block-start: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.fake-checkbox {
|
||||
--checkbox-mark-color: var(--color-neutral-background-primary);
|
||||
position: relative;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<div class="ui-log-entry-viewer" :class="className">
|
||||
<div class="label-container">
|
||||
<div v-if="label" :class="fontClasses.labelClass" class="label">
|
||||
<div :class="fontClasses.labelClass" class="label">
|
||||
{{ label }}
|
||||
</div>
|
||||
<div class="actions">
|
||||
@@ -36,7 +36,7 @@ const {
|
||||
accent,
|
||||
content: rawContent = '',
|
||||
} = defineProps<{
|
||||
label?: string
|
||||
label: string
|
||||
content: string | object | undefined
|
||||
size: LogEntryViewerSize
|
||||
accent: LogEntryViewerAccent
|
||||
@@ -104,7 +104,6 @@ function openRawValueInNewTab() {
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-inline-start: auto;
|
||||
display: flex;
|
||||
gap: 0.8rem;
|
||||
align-items: center;
|
||||
|
||||
@@ -36,14 +36,13 @@ const isDisabled = useDisabled(() => disabled)
|
||||
.ui-radio-button {
|
||||
--radio-dot-color: var(--color-neutral-background-primary);
|
||||
display: inline-flex;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
gap: 0.8rem;
|
||||
|
||||
.radio {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
margin-block-start: 0.4rem;
|
||||
border-radius: 50%;
|
||||
color: var(--radio-color);
|
||||
transition:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createSharedComposable, useTimestamp } from '@vueuse/core'
|
||||
import { useTimestamp } from '@vueuse/core'
|
||||
import { computed, type MaybeRefOrGetter, toValue } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -23,15 +23,12 @@ const timeThresholds: TimeThreshold[] = [
|
||||
[Infinity, 'year'],
|
||||
]
|
||||
|
||||
// One timer for all the users, which can be a list of a thousand items. It stops when the last user is unmounted
|
||||
const useSharedTimestamp = createSharedComposable(() => useTimestamp({ interval: 1000 }))
|
||||
|
||||
export function useTimeAgo(referenceDate: MaybeRefOrGetter<Date | number | string>) {
|
||||
const { locale } = useI18n()
|
||||
|
||||
const formatter = computed(() => new Intl.RelativeTimeFormat(locale.value, { numeric: 'auto' }))
|
||||
|
||||
const now = useSharedTimestamp()
|
||||
const now = useTimestamp({ interval: 1000 })
|
||||
|
||||
const referenceTime = computed(() => new Date(toValue(referenceDate)).getTime())
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
import { useTimeAgo } from '@core/composables/locale-time-ago.composable.ts'
|
||||
import { mountComposable } from '@core-test/mount-composable.ts'
|
||||
import { nextTick } from 'vue'
|
||||
|
||||
const NOW = new Date('2026-01-01T12:00:00Z').getTime()
|
||||
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers({ now: NOW })
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
function mountTimeAgo(referenceDate: number) {
|
||||
return mountComposable(() => ({ timeAgo: useTimeAgo(referenceDate) })).wrapper
|
||||
}
|
||||
|
||||
it('formats the time elapsed since the reference date', () => {
|
||||
expect(mountTimeAgo(NOW - 30_000).vm.timeAgo).toBe('30 seconds ago')
|
||||
expect(mountTimeAgo(NOW - 2 * 60 * 60_000).vm.timeAgo).toBe('2 hours ago')
|
||||
})
|
||||
|
||||
it('updates as time goes by', async () => {
|
||||
const wrapper = mountTimeAgo(NOW - 30_000)
|
||||
|
||||
vi.advanceTimersByTime(60_000)
|
||||
await nextTick()
|
||||
|
||||
expect(wrapper.vm.timeAgo).toBe('1 minute ago')
|
||||
})
|
||||
|
||||
it('shares one timer between all its users, until the last one is unmounted', () => {
|
||||
const timerCount = vi.getTimerCount()
|
||||
|
||||
const first = mountTimeAgo(NOW)
|
||||
|
||||
expect(vi.getTimerCount()).toBe(timerCount + 1)
|
||||
|
||||
const second = mountTimeAgo(NOW)
|
||||
|
||||
expect(vi.getTimerCount()).toBe(timerCount + 1)
|
||||
|
||||
first.unmount()
|
||||
|
||||
expect(vi.getTimerCount()).toBe(timerCount + 1)
|
||||
|
||||
second.unmount()
|
||||
|
||||
expect(vi.getTimerCount()).toBe(timerCount)
|
||||
})
|
||||
@@ -1,33 +0,0 @@
|
||||
# Restricted Directive
|
||||
|
||||
Marks an action the user has no permission to run.
|
||||
|
||||
When its value is `true`, the element:
|
||||
|
||||
- keeps the keyboard focus, but is announced as disabled (`aria-disabled="true"`)
|
||||
- ignores clicks
|
||||
- shows a "Permission required" tooltip on hover and on keyboard focus, in place of any other tooltip it has
|
||||
|
||||
The directive adds no style. The component that uses it styles its restricted state.
|
||||
|
||||
## Usage
|
||||
|
||||
Use the directive inside a component, on the native element that runs the action.
|
||||
|
||||
Do not use it on a component. Give the component a `restricted` prop, and let it apply the directive to its own element:
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<button v-restricted="restricted" type="button">
|
||||
<slot />
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { vRestricted } from '@core/directives/restricted.directive.ts'
|
||||
|
||||
const { restricted } = defineProps<{
|
||||
restricted?: boolean
|
||||
}>()
|
||||
</script>
|
||||
```
|
||||
@@ -1,64 +0,0 @@
|
||||
import { parseTooltipOptions } from '@core/directives/tooltip.directive.ts'
|
||||
import i18n from '@core/i18n.ts'
|
||||
import { TOOLTIP_FOCUS_EVENTS, TOOLTIP_HOVER_EVENTS, useTooltipStore } from '@core/stores/tooltip.store.ts'
|
||||
import type { Directive } from 'vue'
|
||||
|
||||
const tooltipKeys = new WeakMap<HTMLElement, string>()
|
||||
|
||||
const blockClick = (event: Event) => {
|
||||
event.preventDefault()
|
||||
event.stopImmediatePropagation()
|
||||
}
|
||||
|
||||
const restrict = (target: HTMLElement) => {
|
||||
if (tooltipKeys.has(target)) {
|
||||
return
|
||||
}
|
||||
|
||||
target.setAttribute('aria-disabled', 'true')
|
||||
target.addEventListener('click', blockClick, { capture: true })
|
||||
|
||||
const tooltipKey = useTooltipStore().register({
|
||||
target,
|
||||
options: parseTooltipOptions(i18n.global.t('permission-required')),
|
||||
events: [TOOLTIP_HOVER_EVENTS, TOOLTIP_FOCUS_EVENTS],
|
||||
isPrioritized: true,
|
||||
})
|
||||
|
||||
tooltipKeys.set(target, tooltipKey)
|
||||
}
|
||||
|
||||
const unrestrict = (target: HTMLElement) => {
|
||||
const tooltipKey = tooltipKeys.get(target)
|
||||
|
||||
if (tooltipKey === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
target.removeAttribute('aria-disabled')
|
||||
target.removeEventListener('click', blockClick, { capture: true })
|
||||
useTooltipStore().unregister(tooltipKey)
|
||||
tooltipKeys.delete(target)
|
||||
}
|
||||
|
||||
const applyRestriction = (target: HTMLElement, isRestricted: boolean) => {
|
||||
if (isRestricted) {
|
||||
restrict(target)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
unrestrict(target)
|
||||
}
|
||||
|
||||
export const vRestricted: Directive<HTMLElement, boolean> = {
|
||||
mounted(target, binding) {
|
||||
applyRestriction(target, binding.value)
|
||||
},
|
||||
updated(target, binding) {
|
||||
applyRestriction(target, binding.value)
|
||||
},
|
||||
beforeUnmount(target) {
|
||||
unrestrict(target)
|
||||
},
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
import { vRestricted } from '@core/directives/restricted.directive.ts'
|
||||
import { vTooltip } from '@core/directives/tooltip.directive.ts'
|
||||
import { findTooltipContents } from '@core-test/find-tooltip-contents.ts'
|
||||
import { hover } from '@core-test/hover.ts'
|
||||
import { t } from '@core-test/i18n.ts'
|
||||
import { mountWithSetup } from '@core-test/mount-with-setup.ts'
|
||||
import { h, nextTick, ref, withDirectives } from 'vue'
|
||||
|
||||
function mountButton({ tooltip }: { tooltip?: string } = {}) {
|
||||
const isRestricted = ref(true)
|
||||
const onClick = vi.fn()
|
||||
|
||||
const wrapper = mountWithSetup(
|
||||
() => () => {
|
||||
const button = withDirectives(h('button', { onClick }), [[vRestricted, isRestricted.value]])
|
||||
|
||||
if (tooltip === undefined) {
|
||||
return button
|
||||
}
|
||||
|
||||
return withDirectives(button, [[vTooltip, tooltip]])
|
||||
},
|
||||
{ attachTo: document.body }
|
||||
)
|
||||
|
||||
return { button: wrapper.element as HTMLElement, isRestricted, onClick }
|
||||
}
|
||||
|
||||
function click(button: HTMLElement) {
|
||||
const event = new MouseEvent('click', { bubbles: true, cancelable: true })
|
||||
|
||||
button.dispatchEvent(event)
|
||||
|
||||
return event
|
||||
}
|
||||
|
||||
it('marks a restricted element as disabled for assistive technologies, without disabling it', () => {
|
||||
const { button } = mountButton()
|
||||
|
||||
expect(button.getAttribute('aria-disabled')).toBe('true')
|
||||
expect(button.hasAttribute('disabled')).toBe(false)
|
||||
})
|
||||
|
||||
it('blocks the click listeners of a restricted element', () => {
|
||||
const { button, onClick } = mountButton()
|
||||
|
||||
click(button)
|
||||
|
||||
expect(onClick).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('prevents the default action of a click on a restricted element', () => {
|
||||
const { button } = mountButton()
|
||||
|
||||
const blockedClick = click(button)
|
||||
|
||||
expect(blockedClick.defaultPrevented).toBe(true)
|
||||
})
|
||||
|
||||
it('restricts the element only while its value is true', async () => {
|
||||
const { button, isRestricted, onClick } = mountButton()
|
||||
|
||||
isRestricted.value = false
|
||||
await nextTick()
|
||||
const allowedClick = click(button)
|
||||
|
||||
expect(button.hasAttribute('aria-disabled')).toBe(false)
|
||||
expect(allowedClick.defaultPrevented).toBe(false)
|
||||
expect(onClick).toHaveBeenCalledTimes(1)
|
||||
|
||||
isRestricted.value = true
|
||||
await nextTick()
|
||||
click(button)
|
||||
|
||||
expect(button.getAttribute('aria-disabled')).toBe('true')
|
||||
expect(onClick).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('shows the permission tooltip while the restricted element is hovered', () => {
|
||||
const { button } = mountButton()
|
||||
|
||||
hover(button)
|
||||
|
||||
expect(findTooltipContents()).toEqual([t('permission-required')])
|
||||
|
||||
button.dispatchEvent(new MouseEvent('mouseleave'))
|
||||
|
||||
expect(findTooltipContents()).toEqual([])
|
||||
})
|
||||
|
||||
it('shows the permission tooltip while the restricted element is focused', () => {
|
||||
const { button } = mountButton()
|
||||
|
||||
button.focus()
|
||||
|
||||
expect(findTooltipContents()).toEqual([t('permission-required')])
|
||||
|
||||
button.blur()
|
||||
|
||||
expect(findTooltipContents()).toEqual([])
|
||||
})
|
||||
|
||||
it('hides the permission tooltip when the mouse leaves a restricted element focused by a click', () => {
|
||||
const { button } = mountButton()
|
||||
|
||||
hover(button)
|
||||
button.dispatchEvent(new FocusEvent('focusin'))
|
||||
button.dispatchEvent(new MouseEvent('mouseleave'))
|
||||
|
||||
expect(findTooltipContents()).toEqual([])
|
||||
})
|
||||
|
||||
it('shows the permission tooltip in place of the one the element already has', () => {
|
||||
const { button } = mountButton({ tooltip: 'Name' })
|
||||
|
||||
hover(button)
|
||||
|
||||
expect(findTooltipContents()).toEqual([t('permission-required')])
|
||||
})
|
||||
|
||||
it('shows the tooltip the element already has once it is no longer restricted', async () => {
|
||||
const { button, isRestricted } = mountButton({ tooltip: 'Name' })
|
||||
|
||||
hover(button)
|
||||
isRestricted.value = false
|
||||
await nextTick()
|
||||
|
||||
expect(findTooltipContents()).toEqual(['Name'])
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { TooltipOptions } from '@core/stores/tooltip.store.ts'
|
||||
import { TOOLTIP_FOCUS_EVENTS, TOOLTIP_HOVER_EVENTS, useTooltipStore } from '@core/stores/tooltip.store.ts'
|
||||
import type { TooltipEvents, TooltipOptions } from '@core/stores/tooltip.store.ts'
|
||||
import { useTooltipStore } from '@core/stores/tooltip.store.ts'
|
||||
import { isObject } from 'lodash-es'
|
||||
import type { Options } from 'placement.js'
|
||||
import type { Directive } from 'vue'
|
||||
@@ -15,7 +15,7 @@ type TooltipDirectiveOptions =
|
||||
vertical?: boolean
|
||||
}
|
||||
|
||||
export const parseTooltipOptions = (options: TooltipDirectiveOptions): TooltipOptions => {
|
||||
const parseOptions = (options: TooltipDirectiveOptions): TooltipOptions => {
|
||||
const {
|
||||
placement,
|
||||
content,
|
||||
@@ -31,41 +31,22 @@ export const parseTooltipOptions = (options: TooltipDirectiveOptions): TooltipOp
|
||||
}
|
||||
}
|
||||
|
||||
const tooltipKeys = new WeakMap<HTMLElement, string>()
|
||||
|
||||
const unregisterTooltip = (target: HTMLElement) => {
|
||||
const tooltipKey = tooltipKeys.get(target)
|
||||
|
||||
if (tooltipKey === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
useTooltipStore().unregister(tooltipKey)
|
||||
tooltipKeys.delete(target)
|
||||
}
|
||||
|
||||
export const vTooltip: Directive<HTMLElement, TooltipDirectiveOptions> = {
|
||||
mounted(target, binding) {
|
||||
unregisterTooltip(target)
|
||||
const store = useTooltipStore()
|
||||
|
||||
const tooltipKey = useTooltipStore().register({
|
||||
target,
|
||||
options: parseTooltipOptions(binding.value),
|
||||
events: [binding.modifiers.focus ? TOOLTIP_FOCUS_EVENTS : TOOLTIP_HOVER_EVENTS],
|
||||
})
|
||||
const events: TooltipEvents = binding.modifiers.focus
|
||||
? { on: 'focusin', off: 'focusout' }
|
||||
: { on: 'mouseenter', off: 'mouseleave' }
|
||||
|
||||
tooltipKeys.set(target, tooltipKey)
|
||||
store.register(target, parseOptions(binding.value), events)
|
||||
},
|
||||
updated(target, binding) {
|
||||
const tooltipKey = tooltipKeys.get(target)
|
||||
|
||||
if (tooltipKey === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
useTooltipStore().updateOptions(tooltipKey, parseTooltipOptions(binding.value))
|
||||
const store = useTooltipStore()
|
||||
store.updateOptions(target, parseOptions(binding.value))
|
||||
},
|
||||
beforeUnmount(target) {
|
||||
unregisterTooltip(target)
|
||||
const store = useTooltipStore()
|
||||
store.unregister(target)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
import { vTooltip } from '@core/directives/tooltip.directive.ts'
|
||||
import { findTooltipContents } from '@core-test/find-tooltip-contents.ts'
|
||||
import { hover } from '@core-test/hover.ts'
|
||||
import { mountWithSetup } from '@core-test/mount-with-setup.ts'
|
||||
import { defineComponent, h, nextTick, ref, type VNode, withDirectives } from 'vue'
|
||||
|
||||
function mountTarget(renderTarget: () => VNode | undefined) {
|
||||
return mountWithSetup(() => renderTarget)
|
||||
}
|
||||
|
||||
it('shows its content while the element is hovered', () => {
|
||||
const target = mountTarget(() => withDirectives(h('div'), [[vTooltip, 'Name']])).element
|
||||
|
||||
hover(target)
|
||||
|
||||
expect(findTooltipContents()).toEqual(['Name'])
|
||||
|
||||
target.dispatchEvent(new MouseEvent('mouseleave'))
|
||||
|
||||
expect(findTooltipContents()).toEqual([])
|
||||
})
|
||||
|
||||
it('shows its content while the element is focused, with the focus modifier', () => {
|
||||
const target = mountWithSetup(
|
||||
() => () => withDirectives(h('button'), [[vTooltip, 'Name', undefined, { focus: true }]]),
|
||||
{ attachTo: document.body }
|
||||
).element
|
||||
|
||||
hover(target)
|
||||
|
||||
expect(findTooltipContents()).toEqual([])
|
||||
|
||||
target.focus()
|
||||
|
||||
expect(findTooltipContents()).toEqual(['Name'])
|
||||
})
|
||||
|
||||
it('follows its value', async () => {
|
||||
const content = ref('Name')
|
||||
const target = mountTarget(() => withDirectives(h('div'), [[vTooltip, content.value]])).element
|
||||
|
||||
hover(target)
|
||||
content.value = 'New name'
|
||||
await nextTick()
|
||||
|
||||
expect(findTooltipContents()).toEqual(['New name'])
|
||||
})
|
||||
|
||||
it('removes its tooltip with the element', async () => {
|
||||
const isRendered = ref(true)
|
||||
|
||||
const wrapper = mountTarget(() => {
|
||||
if (!isRendered.value) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return withDirectives(h('div'), [[vTooltip, 'Name']])
|
||||
})
|
||||
|
||||
hover(wrapper.element)
|
||||
isRendered.value = false
|
||||
await nextTick()
|
||||
|
||||
expect(findTooltipContents()).toEqual([])
|
||||
})
|
||||
|
||||
it('keeps the tooltip of the parent when a component already sets one on its root element', () => {
|
||||
const Child = defineComponent({
|
||||
render: () => withDirectives(h('div'), [[vTooltip, 'Child']]),
|
||||
})
|
||||
|
||||
const target = mountTarget(() => withDirectives(h(Child), [[vTooltip, 'Parent']])).element
|
||||
|
||||
hover(target)
|
||||
|
||||
expect(findTooltipContents()).toEqual(['Parent'])
|
||||
})
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
faBook,
|
||||
faCalendar,
|
||||
faCamera,
|
||||
faCertificate,
|
||||
faCaretDown,
|
||||
faCaretUp,
|
||||
faCheck,
|
||||
@@ -73,7 +72,6 @@ import {
|
||||
faHeadset,
|
||||
faInfo,
|
||||
faInfoCircle,
|
||||
faKey,
|
||||
faKeyboard,
|
||||
faLayerGroup,
|
||||
faLink,
|
||||
@@ -142,7 +140,6 @@ export const faIcons = defineIconPack({
|
||||
building: { icon: faBuilding },
|
||||
camera: { icon: faCamera },
|
||||
calendar: { icon: faCalendar },
|
||||
certificate: { icon: faCertificate },
|
||||
'caret-down': { icon: faCaretDown },
|
||||
'caret-up': { icon: faCaretUp },
|
||||
check: { icon: faCheck },
|
||||
@@ -193,7 +190,6 @@ export const faIcons = defineIconPack({
|
||||
headset: { icon: faHeadset },
|
||||
info: { icon: faInfo },
|
||||
'info-circle': { icon: faInfoCircle },
|
||||
key: { icon: faKey },
|
||||
keyboard: { icon: faKeyboard },
|
||||
'layer-group': { icon: faLayerGroup },
|
||||
link: { icon: faLink },
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "مثال: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "فحص PIF",
|
||||
"schedule": "الجدول الزمني",
|
||||
"schedules": "الجداول الزمنية",
|
||||
"secret": "السر",
|
||||
"secure-boot": "الإقلاع الآمن",
|
||||
"see-details": "عرض التفاصيل",
|
||||
|
||||
@@ -1190,6 +1190,7 @@
|
||||
"s3-endpoint-sample": "Příklad: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Skenovat fyzická rozhraní",
|
||||
"schedule": "Plán",
|
||||
"schedules": "Plány",
|
||||
"secret": "Tajemství",
|
||||
"secure-boot": "Secure boot",
|
||||
"see-details": "Viz podrobnosti",
|
||||
|
||||
@@ -1117,6 +1117,7 @@
|
||||
"s3-endpoint-sample": "Eksempel: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Skan PIF'er",
|
||||
"schedule": "Tidsplan",
|
||||
"schedules": "Tidsplaner",
|
||||
"secret": "Hemmelighed",
|
||||
"secure-boot": "Secure boot",
|
||||
"see-details": "Se detaljer",
|
||||
|
||||
@@ -745,6 +745,7 @@
|
||||
"s3-backup-repository": "S3-Backupdepot",
|
||||
"scan-pifs": "PIFs scannen",
|
||||
"schedule": "Zeitplan",
|
||||
"schedules": "Zeitpläne",
|
||||
"secure-boot": "Secure Boot",
|
||||
"see-details": "Details anzeigen",
|
||||
"select-compression": "Kompression auswählen",
|
||||
|
||||
@@ -13,13 +13,10 @@
|
||||
"action:add": "Add",
|
||||
"action:add-filter": "Add filter",
|
||||
"action:add-group": "Add group",
|
||||
"action:add-groups": "Add groups",
|
||||
"action:add-host": "@:action:add @.lower:host",
|
||||
"action:add-host-internal-network-in-xo-5": "Add a host internal network in XO-5",
|
||||
"action:add-network-in-xo-5": "Add network in XO-5",
|
||||
"action:add-roles": "Add roles",
|
||||
"action:add-sort": "Add sort",
|
||||
"action:add-users": "Add users",
|
||||
"action:add-vifs-in-xo-5": "Add VIF in XO-5",
|
||||
"action:apply": "Apply",
|
||||
"action:attach": "Attach",
|
||||
@@ -66,14 +63,11 @@
|
||||
"action:delete-configuration": "Delete configuration",
|
||||
"action:delete-filter": "Delete filter",
|
||||
"action:delete-group": "Delete group",
|
||||
"action:delete-n-groups": "Delete 1 group | Delete {n} groups",
|
||||
"action:delete-n-jobs": "@:action:delete 1 job | @:action:delete {n} jobs",
|
||||
"action:delete-n-networks": "Delete 1 network | Delete {n} networks",
|
||||
"action:delete-n-roles": "Delete 1 role | Delete {n} roles",
|
||||
"action:delete-n-snapshots": "Delete 1 snapshot | Delete {n} snapshots",
|
||||
"action:delete-n-srs": "Delete 1 SR | Delete {n} SRs",
|
||||
"action:delete-n-traffic-rules": "Delete 1 traffic rule | Delete {n} traffic rules",
|
||||
"action:delete-n-users": "Delete 1 user | Delete {n} users",
|
||||
"action:delete-n-vdis": "Delete 1 VDI | Delete {n} VDIs",
|
||||
"action:delete-n-vifs": "Delete 1 VIF | Delete {n} VIFs",
|
||||
"action:delete-n-vms": "Delete 1 VM | Delete {n} VMs",
|
||||
@@ -223,14 +217,11 @@
|
||||
"action:unload": "Unload",
|
||||
"action:update": "Update",
|
||||
"action:use-query-builder": "Use query builder",
|
||||
"action:use-template": "Use this template",
|
||||
"action:visit-pool-dashboard": "Visit pool dashboard",
|
||||
"actions": "Actions",
|
||||
"active-mapping": "Active mapping",
|
||||
"adapter": "Adapter",
|
||||
"add-or": "+OR",
|
||||
"added": "Added",
|
||||
"admin": "Admin",
|
||||
"admin-login": "Admin login",
|
||||
"admin-password": "Admin password",
|
||||
"admin-password-confirm": "Confirm admin password",
|
||||
@@ -456,7 +447,6 @@
|
||||
"default-value": "Default ({value})",
|
||||
"deletable-vms": "Good to go",
|
||||
"deletion-blocked": "Deletion Blocked",
|
||||
"deny": "Deny",
|
||||
"deploy-xoa-available-on-desktop": "XOA deployment is available on your desktop interface",
|
||||
"deploy-xoa-custom-ntp-servers": "Custom NTP servers (separated by spaces)",
|
||||
"deploy-xoa-status:configuring": "Configuring XOA…",
|
||||
@@ -516,7 +506,6 @@
|
||||
"edit-vif:error-message": "An error occurred while editing the VIF. Please review your configuration settings and try again.",
|
||||
"editing-vif": "Editing VIF",
|
||||
"email": "Email",
|
||||
"email-address": "Email address",
|
||||
"email-already-added": "This email address has already been added",
|
||||
"email-mandatory": "Email address is mandatory",
|
||||
"empty": "Empty",
|
||||
@@ -569,7 +558,6 @@
|
||||
"first-of-month": "first of month",
|
||||
"first-of-week": "first of week",
|
||||
"first-of-year": "first of year",
|
||||
"first-name": "First name",
|
||||
"following-hosts-unreachable": "The following hosts are unreachable",
|
||||
"for-backup": "For backup",
|
||||
"for-replication": "For replication",
|
||||
@@ -581,12 +569,10 @@
|
||||
"form:error:field-minimum": "{field} must be {min} or more",
|
||||
"form:error:field-required": "{field} is required",
|
||||
"form:error:integer": "Must be an integer",
|
||||
"form:error:invalid-query": "Invalid query",
|
||||
"form:error:maximum": "Must be {max} or less",
|
||||
"form:error:min-items": "Must contain at least {n} item | Must contain at least {n} items",
|
||||
"form:error:minimum": "Must be {min} or more",
|
||||
"form:error:must-match": "Must match “{text}”",
|
||||
"form:error:password-mismatch": "Passwords do not match",
|
||||
"form:error:required": "This field is required",
|
||||
"form:n-errors-summary": "{n} field needs attention | {n} fields need attention",
|
||||
"form:warning:out-of-range": "Should be between {min} and {max}",
|
||||
@@ -609,11 +595,6 @@
|
||||
"gpu": "GPU",
|
||||
"gpus": "GPUs",
|
||||
"graphics-display": "Graphics & Display",
|
||||
"group": "Group",
|
||||
"group-details": "Group details",
|
||||
"group:delete-warning": "Deleting this group will permanently remove it and revoke all roles and permissions inherited by its members. This action cannot be undone. Proceed with caution. | Deleting these groups will permanently remove them and revoke all roles and permissions inherited by their members. This action cannot be undone. Proceed with caution.",
|
||||
"group:what-is-a-group-description": "A group is a collection of users that share the same roles. Assign roles to a group to automatically grant those permissions to all its members. When a user is added to a group, they inherit all roles assigned to that group; inherited roles cannot be removed individually from a user, only by changing the group's roles or removing the user from the group.",
|
||||
"group:what-is-a-group?": "What is a group?",
|
||||
"groups": "Groups",
|
||||
"guest-tools": "Guest tools",
|
||||
"guest-tools-out-of-date": "Guest tools out of date",
|
||||
@@ -704,8 +685,6 @@
|
||||
"iso-dvd": "ISO/DVD",
|
||||
"item": "Item",
|
||||
"job": "Job",
|
||||
"job-name": "Job name",
|
||||
"job:add:in-progress": "Add in progress…",
|
||||
"job:arg:allocated-space-required": "Allocated space is required",
|
||||
"job:arg:backup-repository-required": "Backup repository is required",
|
||||
"job:arg:bond-mode-required": "@:bond-mode-required",
|
||||
@@ -768,17 +747,11 @@
|
||||
"job:connect:in-progress": "Connect in progress…",
|
||||
"job:create:in-progress": "Create in progress…",
|
||||
"job:delete:in-progress": "Delete in progress…",
|
||||
"job:detach:in-progress": "Detach in progress…",
|
||||
"job:disable:in-progress": "Disable in progress…",
|
||||
"job:disconnect:in-progress": "Disconnect in progress…",
|
||||
"job:edit:in-progress": "Edit in progress…",
|
||||
"job:enable:in-progress": "Enable in progress…",
|
||||
"job:export:in-progress": "Export in progress…",
|
||||
"job:group-delete:missing-group": "No groups to delete",
|
||||
"job:group-delete:synchronized-group": "A synchronized group cannot be deleted",
|
||||
"job:group-users:missing-group": "No group selected",
|
||||
"job:group-users:missing-user": "No user selected",
|
||||
"job:group-users:synchronized-group": "The users of a synchronized group cannot be changed",
|
||||
"job:host-detach:bad-power-state": "@:host-not-running",
|
||||
"job:host-detach:in-progress": "Host detach in progress…",
|
||||
"job:host-detach:master-host": "Master host cannot be detached",
|
||||
@@ -850,13 +823,6 @@
|
||||
"job:plugin-test:not-loaded": "The plugin must be loaded to be tested",
|
||||
"job:plugin-test:not-testable": "This plugin cannot be tested",
|
||||
"job:pool-add-host:in-progress": "Adding host in progress…",
|
||||
"job:role-delete:missing-role": "No roles to delete",
|
||||
"job:role-delete:role-assigned": "A role assigned to users or groups cannot be deleted",
|
||||
"job:role-groups:missing-group": "@:job:group-users:missing-group",
|
||||
"job:role-groups:missing-role": "@:job:role-users:missing-role",
|
||||
"job:role-users:inherited-role": "A role inherited from a group cannot be detached from a user",
|
||||
"job:role-users:missing-role": "No role selected",
|
||||
"job:role-users:missing-user": "No user selected",
|
||||
"job:server-connect:missing-server": "No servers to connect",
|
||||
"job:server-disconnect:missing-server": "No servers to disconnect",
|
||||
"job:server-disconnect:server-disconnected": "One or several servers are already disconnected",
|
||||
@@ -867,8 +833,6 @@
|
||||
"job:traffic-rule-delete:missing-rule": "No traffic rule selected",
|
||||
"job:traffic-rule-edit-order:no-free-priority": "No free priority left on this network to apply this order",
|
||||
"job:traffic-rule-edit-order:not-enough-rules": "Requires at least {n} rules",
|
||||
"job:user-delete:missing-user": "No users to delete",
|
||||
"job:user-delete:self-deletion": "A user cannot delete itself",
|
||||
"job:v2v-start:in-progress": "Migration launch in progress…",
|
||||
"job:v2v-start:missing-vm": "No VMs to migrate",
|
||||
"job:vbd-connect:missing-vbd": "No VBDs to connect",
|
||||
@@ -973,7 +937,6 @@
|
||||
"last-n-backup-runs": "Last backup run | Last {n} backup runs",
|
||||
"last-n-days": "Last day | Last {n} days",
|
||||
"last-n-runs": "Last run | Last {n} runs",
|
||||
"last-name": "Last name",
|
||||
"last-revert": "Last revert",
|
||||
"last-run-number": "Last run #{n}",
|
||||
"last-snapshot": "Last snapshot",
|
||||
@@ -1102,7 +1065,6 @@
|
||||
"multi-pathing": "Multi-pathing",
|
||||
"multiple-schedules": "Multiple schedules",
|
||||
"multiple-schedules-advice": "We advise splitting a backup job with multiple schedules into multiple backup jobs with one schedule each.",
|
||||
"multiple-schedules-split-in-xo5": "Multiple schedules: split into one job per schedule in XO 5",
|
||||
"must-be-at-least-n": "Must be at least {n}.",
|
||||
"n-blocking": "1 blocking | {n} blocking",
|
||||
"n-bonded-networks": "1 bonded network | {n} bonded networks",
|
||||
@@ -1111,7 +1073,6 @@
|
||||
"n-gb": "{n} GB",
|
||||
"n-gb-left": "{n} GB left",
|
||||
"n-gb-required": "{n} GB required",
|
||||
"n-groups": "1 group | {n} groups",
|
||||
"n-hexadecimal-characters": "{n} hexadecimal characters.",
|
||||
"n-hosts": "1 host | {n} hosts",
|
||||
"n-hosts-awaiting-patch": "{n} host is awaiting this patch | {n} hosts are awaiting this patch",
|
||||
@@ -1130,11 +1091,9 @@
|
||||
"n-pools": "1 pool | {n} pools",
|
||||
"n-private-networks": "1 private network | {n} private networks",
|
||||
"n-ready": "1 ready | {n} ready",
|
||||
"n-roles": "1 role | {n} roles",
|
||||
"n-snapshots": "1 snapshot | {n} snapshots",
|
||||
"n-srs": "1 SR | {n} SRs",
|
||||
"n-traffic-rules": "1 traffic rule | {n} traffic rules",
|
||||
"n-users": "1 user | {n} users",
|
||||
"n-vbds": "1 VBD | {n} VBDs",
|
||||
"n-vcpus": "1 vCPU | {n} vCPUs",
|
||||
"n-vdis": "1 VDI | {n} VDIs",
|
||||
@@ -1189,9 +1148,6 @@
|
||||
"new-network:preferred-center-info": "The host to try first to elect as center of the network",
|
||||
"new-network:select-interface": "Select an interface",
|
||||
"new-traffic-rule:add": "Add new traffic rule",
|
||||
"new-traffic-rule:error-message": "An error occurred while creating the traffic rule. Please review your configuration settings and try again.",
|
||||
"new-user:error-already-exists": "A user with this username or email address already exists.",
|
||||
"new-user:error-message": "An error occurred while creating the user. Please review your settings and try again.",
|
||||
"new-vdi:accepted-formats": "Accepted formats: {formats}",
|
||||
"new-vdi:add": "Add new VDI",
|
||||
"new-vif": "New VIF",
|
||||
@@ -1246,7 +1202,6 @@
|
||||
"next-runs": "Next runs",
|
||||
"nfs": "NFS",
|
||||
"nic-type": "NIC type",
|
||||
"no": "No",
|
||||
"no-active-backup-jobs": "There are no active backup jobs on this site.",
|
||||
"no-alarm-detected": "No alarms detected",
|
||||
"no-alarm-triggered": "No alarm triggered",
|
||||
@@ -1263,7 +1218,6 @@
|
||||
"no-empty-network-to-fill": "No empty network to fill",
|
||||
"no-empty-sr-to-fill": "No empty SR to fill",
|
||||
"no-group-attached": "No group attached",
|
||||
"no-group-detected": "No groups detected",
|
||||
"no-host-attached": "No hosts attached",
|
||||
"no-host-detected": "No hosts detected",
|
||||
"no-job-vm": "This VM isn’t part of any running job.",
|
||||
@@ -1272,13 +1226,10 @@
|
||||
"no-pif-detected": "No PIFs detected",
|
||||
"no-plugin-detected": "No plugins detected",
|
||||
"no-pools-detected": "No pools detected",
|
||||
"no-privilege-attached": "No privilege attached",
|
||||
"no-remembered-connection": "No remembered connection",
|
||||
"no-replicated-vm": "This VM isn’t being replicated. Configure a replication job to enable it.",
|
||||
"no-result": "No results",
|
||||
"no-role-applied": "No role applied",
|
||||
"no-role-detected": "No roles detected",
|
||||
"no-role-template-detected": "No role templates detected",
|
||||
"no-run": "No run",
|
||||
"no-running-vm-detected": "No running VMs detected",
|
||||
"no-selected-vm-can-be-exported": "No selected VM can be exported",
|
||||
@@ -1289,7 +1240,6 @@
|
||||
"no-storage-repository-detected": "No storage repositories detected",
|
||||
"no-task": "No tasks",
|
||||
"no-task-detected": "No tasks detected",
|
||||
"no-user-attached": "No users attached",
|
||||
"no-user-detected": "No users detected",
|
||||
"no-vdi-attached": "No VDIs attached",
|
||||
"no-vdi-detected": "No VDIs detected",
|
||||
@@ -1360,7 +1310,6 @@
|
||||
"partial-deletion": "Partial deletion",
|
||||
"partially-connected": "Partially connected",
|
||||
"password": "Password",
|
||||
"password-confirmation": "Password confirmation",
|
||||
"password-invalid": "Password invalid",
|
||||
"password-required": "Password is required.",
|
||||
"patch-name": "Patch name",
|
||||
@@ -1376,8 +1325,6 @@
|
||||
"pbd-details": "Physical Block Device (PBD) details",
|
||||
"pending": "Pending",
|
||||
"per-vm-options": "Per-VM options",
|
||||
"permission": "Permission",
|
||||
"permission-required": "Permission required",
|
||||
"physical-interface-status": "Physical interface status",
|
||||
"physical-network": "Physical network",
|
||||
"pif": "PIF",
|
||||
@@ -1440,32 +1387,6 @@
|
||||
"priority": "Priority",
|
||||
"priority-within": "Priority within {name}",
|
||||
"private-network": "Private network | Private networks",
|
||||
"privilege": "Privilege",
|
||||
"privilege-number": "Privilege #{n}",
|
||||
"privilege:action": "Action",
|
||||
"privilege:applied-to": "Applied to",
|
||||
"privilege:create-new": "Create new privilege",
|
||||
"privilege:currently-applied-to": "Currently applied to",
|
||||
"privilege:details": "Privilege details",
|
||||
"privilege:dynamic-selection-info": "The privilege will apply to every object matching this query.",
|
||||
"privilege:edit": "Edit privilege",
|
||||
"privilege:effect": "Effect",
|
||||
"privilege:no-object": "No object",
|
||||
"privilege:none-yet": "No privileges yet",
|
||||
"privilege:one-privilege-per-action": "Each action will be a dedicated privilege",
|
||||
"privilege:resource": "Resource",
|
||||
"privilege:review-and-confirm": "Review & confirm",
|
||||
"privilege:scope": "Scope",
|
||||
"privilege:scope-preview": "Scope preview",
|
||||
"privilege:scope-type": "Scope type",
|
||||
"privilege:scope-type:all-objects": "All objects",
|
||||
"privilege:scope-type:dynamic-selection": "Dynamic selection",
|
||||
"privilege:scope-type:manual-selection": "Manual selection",
|
||||
"privilege:select-scope": "Select scope",
|
||||
"privilege:selector": "Selector",
|
||||
"privilege:what-is-a-privilege-description": "A privilege is a granular permission that controls access to a specific action or resource in your environment, such as starting a VM, editing a network, or viewing storage. Each privilege belongs to exactly one role. Assign privileges to a role to define precisely what users with that role are allowed to do.",
|
||||
"privilege:what-is-a-privilege?": "What is a privilege?",
|
||||
"privileges": "Privileges",
|
||||
"pro-support": "{name} pro support",
|
||||
"professional-support": "Professional support",
|
||||
"progress": "Progress",
|
||||
@@ -1478,7 +1399,6 @@
|
||||
"protection-status": "Protection status",
|
||||
"protocol": "Protocol",
|
||||
"protocol:port": "@:{'protocol'}:@:{'port'}",
|
||||
"provider": "Provider",
|
||||
"provider-solutions": "{provider} solutions",
|
||||
"providers": "Providers",
|
||||
"provisioning": "Provisioning",
|
||||
@@ -1573,19 +1493,6 @@
|
||||
"review": "Review",
|
||||
"review-and-confirm": "Review & confirm",
|
||||
"review-and-launch": "Review and launch",
|
||||
"role": "Role",
|
||||
"role-templates": "Role templates",
|
||||
"role:creating": "Creating the new role…",
|
||||
"role:delete-warning": "Deleting this role will permanently remove it along with all its privileges. This action cannot be undone. Proceed with caution. | Deleting these roles will permanently remove them along with all their privileges. This action cannot be undone. Proceed with caution.",
|
||||
"role:details": "Role details",
|
||||
"role:direct-users": "Direct",
|
||||
"role:name-info": "For example: VM Operator, Network Admin, or Read-only Viewer",
|
||||
"role:new": "New role",
|
||||
"role:new-from-template": "New role from template",
|
||||
"role:unable-to-create": "Unable to create the new role",
|
||||
"role:users-from-group": "From {group} group",
|
||||
"role:what-is-a-role-description": "A role is a set of privileges that can be assigned to users and groups. Assigning a role grants all of its privileges at once. A user holds the roles assigned to them directly, plus every role inherited from the groups they belong to.",
|
||||
"role:what-is-a-role?": "What is a role?",
|
||||
"roles": "Roles",
|
||||
"roles-applied": "Roles applied",
|
||||
"root-by-default": "\"root\" by default.",
|
||||
@@ -1600,6 +1507,7 @@
|
||||
"save-xo-config": "Save XO config",
|
||||
"scan-pifs": "Scan PIFs",
|
||||
"schedule": "Schedule",
|
||||
"schedules": "Schedules",
|
||||
"scope": "Scope",
|
||||
"scope-preview": "Scope preview",
|
||||
"scope-type": "Scope type",
|
||||
@@ -1611,14 +1519,11 @@
|
||||
"see-details": "See details",
|
||||
"select-at-least-one-backup-repository": "Select at least one backup repository.",
|
||||
"select-at-least-one-day": "Select at least one day of the month or of the week.",
|
||||
"select-at-least-one-group.": "Select at least one group.",
|
||||
"select-at-least-one-hour": "Select at least one hour.",
|
||||
"select-at-least-one-object": "Selection of at least one object is mandatory.",
|
||||
"select-at-least-one-option": "Select at least one option.",
|
||||
"select-at-least-one-role.": "Select at least one role.",
|
||||
"select-at-least-one-storage-repository": "Select at least one storage repository.",
|
||||
"select-at-least-one-storage-target": "Select at least one storage target.",
|
||||
"select-at-least-one-user.": "Select at least one user.",
|
||||
"select-compression": "Select a compression",
|
||||
"select-destination-host": "Select a destination host",
|
||||
"select-format": "Select format",
|
||||
@@ -1661,7 +1566,6 @@
|
||||
"snapshot-mode:with-memory-description": "Includes the VM's memory state. The VM will be briefly suspended during the snapshot.",
|
||||
"snapshot-revert-snapshot-before": "Take a snapshot of the VM before reverting",
|
||||
"snapshot-revert-warning": "This will restore the VM to the selected snapshot state. Any changes made since then (data, configuration, and disk state) will be lost. This action cannot be undone.",
|
||||
"snapshot-settings-disabled-offline-backup": "Snapshot settings are disabled because offline backup shuts down the VMs instead of taking a snapshot.",
|
||||
"snapshot-synchronisation": "Snapshot synchronisation",
|
||||
"snapshot-vdis": "Snapshot VDIs",
|
||||
"snapshots": "Snapshots",
|
||||
@@ -1885,15 +1789,7 @@
|
||||
"used-space-on-sr": "Used space on SR",
|
||||
"user": "User",
|
||||
"user-config": "User config",
|
||||
"user-details": "User details",
|
||||
"user-management": "User management",
|
||||
"user:create-new": "Create new user",
|
||||
"user:delete-warning": "Deleting this user will permanently remove their access and associated permissions. This action cannot be undone. Proceed with caution. | Deleting these users will permanently remove their access and associated permissions. This action cannot be undone. Proceed with caution.",
|
||||
"user:direct-roles": "Direct roles",
|
||||
"user:groups-assignment": "Groups assignment",
|
||||
"user:roles-assignment": "Roles assignment",
|
||||
"user:roles-from-group": "From {group} group",
|
||||
"user:roles-from-groups-info": "Roles assigned through assigned groups are automatically applied to this user. You can add additional roles below if needed.",
|
||||
"username": "Username",
|
||||
"username-required": "Username is required.",
|
||||
"users": "Users",
|
||||
@@ -2104,7 +2000,6 @@
|
||||
"xoa-ssh-account": "XOA SSH account",
|
||||
"xoa-ssh-password-confirm-different": "SSH password confirmation is different",
|
||||
"xva": "XVA",
|
||||
"yes": "Yes",
|
||||
"you-are-currently-on": "You are currently on: {0}",
|
||||
"your-default-network-is": "Your default network is {name}",
|
||||
"zstd": "ZSTD"
|
||||
|
||||
@@ -817,6 +817,7 @@
|
||||
"s3-backup-repository": "Repositorio S3 de salvaguardas",
|
||||
"scan-pifs": "Escanear PIFs",
|
||||
"schedule": "Planificación",
|
||||
"schedules": "Planificaciones",
|
||||
"secure-boot": "Arranque seguro",
|
||||
"see-details": "Ver detalles",
|
||||
"select-compression": "Elige modo de compression",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "مثال: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "اسکن PIFها",
|
||||
"schedule": "زمانبندی",
|
||||
"schedules": "زمانبندیها",
|
||||
"secret": "رمز",
|
||||
"secure-boot": "بوت امن",
|
||||
"see-details": "مشاهده جزئیات",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "Esimerkki: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Skannaa PIF:t",
|
||||
"schedule": "Aikataulu",
|
||||
"schedules": "Aikataulut",
|
||||
"secret": "Salaisuus",
|
||||
"secure-boot": "Suojattu käynnistys",
|
||||
"see-details": "Katso tiedot",
|
||||
|
||||
@@ -13,13 +13,10 @@
|
||||
"action:add": "Ajouter",
|
||||
"action:add-filter": "Ajouter un filtre",
|
||||
"action:add-group": "Ajouter un groupe",
|
||||
"action:add-groups": "Ajouter des groupes",
|
||||
"action:add-host": "@:action:add un @.lower:host",
|
||||
"action:add-host-internal-network-in-xo-5": "Ajouter un réseau interne à l'hôte dans XO-5",
|
||||
"action:add-network-in-xo-5": "Ajouter un réseau dans XO-5",
|
||||
"action:add-roles": "Ajouter des rôles",
|
||||
"action:add-sort": "Ajouter un tri",
|
||||
"action:add-users": "Ajouter des utilisateurs",
|
||||
"action:add-vifs-in-xo-5": "Ajouter un VIF dans XO-5",
|
||||
"action:apply": "Appliquer",
|
||||
"action:attach": "Attacher",
|
||||
@@ -66,14 +63,11 @@
|
||||
"action:delete-configuration": "Supprimer la configuration",
|
||||
"action:delete-filter": "Supprimer le filtre",
|
||||
"action:delete-group": "Supprimer le groupe",
|
||||
"action:delete-n-groups": "Supprimer 1 groupe | Supprimer {n} groupes",
|
||||
"action:delete-n-jobs": "@:action:delete 1 job | @:action:delete {n} jobs",
|
||||
"action:delete-n-networks": "Supprimer 1 réseau | Supprimer {n} réseaux",
|
||||
"action:delete-n-roles": "Supprimer 1 rôle | Supprimer {n} rôles",
|
||||
"action:delete-n-snapshots": "Supprimer 1 instantané | Supprimer {n} instantanés",
|
||||
"action:delete-n-srs": "Supprimer 1 SR | Supprimer {n} SRs",
|
||||
"action:delete-n-traffic-rules": "Supprimer 1 règle de trafic | Supprimer {n} règles de trafic",
|
||||
"action:delete-n-users": "Supprimer 1 utilisateur | Supprimer {n} utilisateurs",
|
||||
"action:delete-n-vdis": "Supprimer 1 VDI | Supprimer {n} VDIs",
|
||||
"action:delete-n-vifs": "Supprimer 1 VIF | Supprimer {n} VIFs",
|
||||
"action:delete-n-vms": "Supprimer 1 VM | Supprimer {n} VMs",
|
||||
@@ -223,14 +217,11 @@
|
||||
"action:unload": "Décharger",
|
||||
"action:update": "Mettre à jour",
|
||||
"action:use-query-builder": "Constructeur de requête",
|
||||
"action:use-template": "Utiliser ce modèle",
|
||||
"action:visit-pool-dashboard": "Visiter le tableau de bord du pool",
|
||||
"actions": "Actions",
|
||||
"active-mapping": "Correspondance active",
|
||||
"adapter": "Carte",
|
||||
"add-or": "+OU",
|
||||
"added": "Ajouté",
|
||||
"admin": "Administrateur",
|
||||
"admin-login": "Nom d'utilisateur administrateur",
|
||||
"admin-password": "Mot de passe administrateur",
|
||||
"admin-password-confirm": "Confirmer le mot de passe administrateur",
|
||||
@@ -456,7 +447,6 @@
|
||||
"default-value": "Par défaut ({value})",
|
||||
"deletable-vms": "Prêtes",
|
||||
"deletion-blocked": "Suppression Bloquée",
|
||||
"deny": "Refuser",
|
||||
"deploy-xoa-available-on-desktop": "Le déploiement de la XOA est disponible sur ordinateur",
|
||||
"deploy-xoa-custom-ntp-servers": "Serveurs NTP (séparés par des espaces)",
|
||||
"deploy-xoa-status:configuring": "Configuration de la XOA…",
|
||||
@@ -516,7 +506,6 @@
|
||||
"edit-vif:error-message": "Une erreur s'est produite lors de la modification du VIF. Veuillez vérifier vos paramètres et réessayer.",
|
||||
"editing-vif": "Modification du VIF",
|
||||
"email": "Email",
|
||||
"email-address": "Adresse e-mail",
|
||||
"email-already-added": "Cette adresse email a déjà été ajoutée",
|
||||
"email-mandatory": "L'adresse email est obligatoire",
|
||||
"empty": "Vide",
|
||||
@@ -569,7 +558,6 @@
|
||||
"first-of-month": "le premier du mois",
|
||||
"first-of-week": "le premier de la semaine",
|
||||
"first-of-year": "le premier de l’année",
|
||||
"first-name": "Prénom",
|
||||
"following-hosts-unreachable": "Les hôtes suivants sont inaccessibles",
|
||||
"for-backup": "Pour la sauvegarde",
|
||||
"for-replication": "Pour la réplication",
|
||||
@@ -581,12 +569,10 @@
|
||||
"form:error:field-minimum": "Le champ {field} doit être supérieur ou égal à {min}",
|
||||
"form:error:field-required": "Le champ {field} est requis",
|
||||
"form:error:integer": "Doit être un entier",
|
||||
"form:error:invalid-query": "Requête invalide",
|
||||
"form:error:maximum": "Doit être inférieur ou égal à {max}",
|
||||
"form:error:min-items": "Doit contenir au moins {n} élément | Doit contenir au moins {n} éléments",
|
||||
"form:error:minimum": "Doit être supérieur ou égal à {min}",
|
||||
"form:error:must-match": "Doit correspondre à « {text} »",
|
||||
"form:error:password-mismatch": "Les mots de passe ne correspondent pas",
|
||||
"form:error:required": "Ce champ est requis",
|
||||
"form:n-errors-summary": "{n} champ est à corriger | {n} champs sont à corriger",
|
||||
"form:warning:out-of-range": "Devrait être compris entre {min} et {max}",
|
||||
@@ -609,11 +595,6 @@
|
||||
"gpu": "GPU",
|
||||
"gpus": "GPUs",
|
||||
"graphics-display": "Graphique & Affichage",
|
||||
"group": "Groupe",
|
||||
"group-details": "Détails du groupe",
|
||||
"group:delete-warning": "Supprimer ce groupe le retirera définitivement et révoquera tous les rôles et permissions hérités par ses membres. Cette action est irréversible. Procédez avec prudence. | Supprimer ces groupes les retirera définitivement et révoquera tous les rôles et permissions hérités par leurs membres. Cette action est irréversible. Procédez avec prudence.",
|
||||
"group:what-is-a-group-description": "Un groupe est un ensemble d'utilisateurs qui partagent les mêmes rôles. Attribuez des rôles à un groupe pour accorder automatiquement ces permissions à tous ses membres. Lorsqu'un utilisateur est ajouté à un groupe, il hérite de tous les rôles attribués à ce groupe ; les rôles hérités ne peuvent pas être retirés individuellement d'un utilisateur, mais uniquement en modifiant les rôles du groupe ou en retirant l'utilisateur du groupe.",
|
||||
"group:what-is-a-group?": "Qu'est-ce qu'un groupe ?",
|
||||
"groups": "Groupes",
|
||||
"guest-tools": "Guest tools",
|
||||
"guest-tools-out-of-date": "Guest tools obsolètes",
|
||||
@@ -704,8 +685,6 @@
|
||||
"iso-dvd": "ISO/DVD",
|
||||
"item": "Élément",
|
||||
"job": "Job",
|
||||
"job-name": "Nom du job",
|
||||
"job:add:in-progress": "Ajout en cours…",
|
||||
"job:arg:allocated-space-required": "L'espace alloué est obligatoire",
|
||||
"job:arg:backup-repository-required": "Le dépôt de sauvegarde est obligatoire",
|
||||
"job:arg:bond-mode-required": "@:bond-mode-required",
|
||||
@@ -768,17 +747,11 @@
|
||||
"job:connect:in-progress": "Connexion en cours…",
|
||||
"job:create:in-progress": "Création en cours…",
|
||||
"job:delete:in-progress": "Suppression en cours…",
|
||||
"job:detach:in-progress": "Détachement en cours…",
|
||||
"job:disable:in-progress": "Désactivation en cours…",
|
||||
"job:disconnect:in-progress": "Déconnexion en cours…",
|
||||
"job:edit:in-progress": "Modification en cours…",
|
||||
"job:enable:in-progress": "Activation en cours…",
|
||||
"job:export:in-progress": "Export en cours…",
|
||||
"job:group-delete:missing-group": "Aucun groupe à supprimer",
|
||||
"job:group-delete:synchronized-group": "Un groupe synchronisé ne peut pas être supprimé",
|
||||
"job:group-users:missing-group": "Aucun groupe sélectionné",
|
||||
"job:group-users:missing-user": "Aucun utilisateur sélectionné",
|
||||
"job:group-users:synchronized-group": "Les utilisateurs d'un groupe synchronisé ne peuvent pas être modifiés",
|
||||
"job:host-detach:bad-power-state": "@:host-not-running",
|
||||
"job:host-detach:in-progress": "Détachement de l'hôte en cours…",
|
||||
"job:host-detach:master-host": "L'hôte primaire ne peut pas être détaché",
|
||||
@@ -850,13 +823,6 @@
|
||||
"job:plugin-test:not-loaded": "Le plugin doit être chargé pour être testé",
|
||||
"job:plugin-test:not-testable": "Ce plugin ne peut pas être testé",
|
||||
"job:pool-add-host:in-progress": "Ajout de l'hôte en cours…",
|
||||
"job:role-delete:missing-role": "Aucun rôle à supprimer",
|
||||
"job:role-delete:role-assigned": "Un rôle attribué à des utilisateurs ou à des groupes ne peut pas être supprimé",
|
||||
"job:role-groups:missing-group": "@:job:group-users:missing-group",
|
||||
"job:role-groups:missing-role": "@:job:role-users:missing-role",
|
||||
"job:role-users:inherited-role": "Un rôle hérité d'un groupe ne peut pas être détaché d'un utilisateur",
|
||||
"job:role-users:missing-role": "Aucun rôle sélectionné",
|
||||
"job:role-users:missing-user": "Aucun utilisateur sélectionné",
|
||||
"job:server-connect:missing-server": "Aucun serveur à connecter",
|
||||
"job:server-disconnect:missing-server": "Aucun serveur à déconnecter",
|
||||
"job:server-disconnect:server-disconnected": "Un ou plusieurs serveurs sont déjà déconnectés",
|
||||
@@ -867,8 +833,6 @@
|
||||
"job:traffic-rule-delete:missing-rule": "Aucune règle de trafic sélectionnée",
|
||||
"job:traffic-rule-edit-order:no-free-priority": "Plus aucune priorité libre sur ce réseau pour appliquer cet ordre",
|
||||
"job:traffic-rule-edit-order:not-enough-rules": "Nécessite au moins {n} règles",
|
||||
"job:user-delete:missing-user": "Aucun utilisateur à supprimer",
|
||||
"job:user-delete:self-deletion": "Un utilisateur ne peut pas se supprimer lui-même",
|
||||
"job:v2v-start:in-progress": "Lancement de la migration en cours…",
|
||||
"job:v2v-start:missing-vm": "Aucune VM à migrer",
|
||||
"job:vbd-connect:missing-vbd": "Aucun VBD à connecter",
|
||||
@@ -973,7 +937,6 @@
|
||||
"last-n-backup-runs": "Dernier run de sauvegarde | {n} dernières sauvegardes",
|
||||
"last-n-days": "Dernier jour | {n} derniers jours",
|
||||
"last-n-runs": "Dernier run | {n} derniers runs",
|
||||
"last-name": "Nom",
|
||||
"last-revert": "Dernière restauration",
|
||||
"last-run-number": "Dernier run #{n}",
|
||||
"last-snapshot": "Dernier instantané",
|
||||
@@ -1102,7 +1065,6 @@
|
||||
"multi-pathing": "Multi-pathing",
|
||||
"multiple-schedules": "Plusieurs planifications",
|
||||
"multiple-schedules-advice": "Nous vous conseillons de diviser un job de sauvegarde à plusieurs planifications en plusieurs jobs ayant chacun une seule planification.",
|
||||
"multiple-schedules-split-in-xo5": "Plusieurs planifications : diviser en un job par planification dans XO 5",
|
||||
"must-be-at-least-n": "Doit être au moins {n}.",
|
||||
"n-blocking": "0 bloquante | 1 bloquante | {n} bloquantes",
|
||||
"n-bonded-networks": "1 réseau lié | {n} réseaux liés",
|
||||
@@ -1111,7 +1073,6 @@
|
||||
"n-gb": "{n} Go",
|
||||
"n-gb-left": "{n} Go libres",
|
||||
"n-gb-required": "{n} Go requis",
|
||||
"n-groups": "0 groupe | 1 groupe | {n} groupes",
|
||||
"n-hexadecimal-characters": "{n} caractères hexadécimaux.",
|
||||
"n-hosts": "0 hôte | 1 hôte | {n} hôtes",
|
||||
"n-hosts-awaiting-patch": "{n} hôte attend ce patch | {n} hôtes attendent ce patch",
|
||||
@@ -1130,11 +1091,9 @@
|
||||
"n-pools": "1 pool | {n} pools",
|
||||
"n-private-networks": "1 réseau privé | {n} réseaux privés",
|
||||
"n-ready": "0 prête | 1 prête | {n} prêtes",
|
||||
"n-roles": "0 rôle | 1 rôle | {n} rôles",
|
||||
"n-snapshots": "0 instantané | 1 instantané | {n} instantanés",
|
||||
"n-srs": "0 SR | 1 SR | {n} SRs",
|
||||
"n-traffic-rules": "1 règle de trafic | {n} règles de trafic",
|
||||
"n-users": "0 utilisateur | 1 utilisateur | {n} utilisateurs",
|
||||
"n-vbds": "0 VBD | 1 VBD | {n} VBDs",
|
||||
"n-vcpus": "0 vCPU | 1 vCPU | {n} vCPUs",
|
||||
"n-vdis": "0 VDI | 1 VDI | {n} VDIs",
|
||||
@@ -1189,9 +1148,6 @@
|
||||
"new-network:preferred-center-info": "L’hôte à essayer en premier pour être élu centre du réseau",
|
||||
"new-network:select-interface": "Sélectionner une interface",
|
||||
"new-traffic-rule:add": "Ajouter une nouvelle règle de trafic",
|
||||
"new-traffic-rule:error-message": "Une erreur s'est produite lors de la création de la règle de trafic. Veuillez vérifier vos paramètres de configuration et réessayer.",
|
||||
"new-user:error-already-exists": "Un utilisateur avec ce nom d'utilisateur ou cette adresse e-mail existe déjà.",
|
||||
"new-user:error-message": "Une erreur s'est produite lors de la création de l'utilisateur. Veuillez vérifier vos paramètres et réessayer.",
|
||||
"new-vdi:accepted-formats": "Formats acceptés : {formats}",
|
||||
"new-vdi:add": "Ajouter un nouveau VDI",
|
||||
"new-vif": "Nouveau VIF",
|
||||
@@ -1246,7 +1202,6 @@
|
||||
"next-runs": "Prochaines exécutions",
|
||||
"nfs": "NFS",
|
||||
"nic-type": "Type de carte réseau (NIC)",
|
||||
"no": "Non",
|
||||
"no-active-backup-jobs": "Il n'y a aucune tâche de sauvegarde active sur ce site.",
|
||||
"no-alarm-detected": "Aucune alarme détectée",
|
||||
"no-alarm-triggered": "Aucune alarme déclenchée",
|
||||
@@ -1263,7 +1218,6 @@
|
||||
"no-empty-network-to-fill": "Aucun réseau vide à remplir",
|
||||
"no-empty-sr-to-fill": "Aucun SR vide à remplir",
|
||||
"no-group-attached": "Pas de groupe attaché",
|
||||
"no-group-detected": "Aucun groupe détecté",
|
||||
"no-host-attached": "Aucun hôte attaché",
|
||||
"no-host-detected": "Aucun hôte détecté",
|
||||
"no-job-vm": "Cette VM ne fait partie d'aucun job actif.",
|
||||
@@ -1272,13 +1226,10 @@
|
||||
"no-pif-detected": "Aucun PIF détecté",
|
||||
"no-plugin-detected": "Aucun plugin détecté",
|
||||
"no-pools-detected": "Aucun pool détecté",
|
||||
"no-privilege-attached": "Aucun privilège attaché",
|
||||
"no-remembered-connection": "Aucune connexion mémorisée",
|
||||
"no-replicated-vm": "Cette VM n'est pas répliquée. Configurez une tâche de réplication pour l'activer.",
|
||||
"no-result": "Aucun résultat",
|
||||
"no-role-applied": "Pas de rôle appliqué",
|
||||
"no-role-detected": "Aucun rôle détecté",
|
||||
"no-role-template-detected": "Aucun modèle de rôle détecté",
|
||||
"no-run": "Aucun run",
|
||||
"no-running-vm-detected": "Aucune VM en cours d'exécution détectée",
|
||||
"no-selected-vm-can-be-exported": "Aucune VM sélectionnée ne peut être exportée",
|
||||
@@ -1289,7 +1240,6 @@
|
||||
"no-storage-repository-detected": "Aucun dépôt de stockage détecté",
|
||||
"no-task": "Aucune tâche",
|
||||
"no-task-detected": "Aucune tâche détectée",
|
||||
"no-user-attached": "Aucun utilisateur attaché",
|
||||
"no-user-detected": "Aucun utilisateur détecté",
|
||||
"no-vdi-attached": "Aucun VDI attaché",
|
||||
"no-vdi-detected": "Aucun VDI détecté",
|
||||
@@ -1360,7 +1310,6 @@
|
||||
"partial-deletion": "Suppression partielle",
|
||||
"partially-connected": "Partiellement connecté",
|
||||
"password": "Mot de passe",
|
||||
"password-confirmation": "Confirmation du mot de passe",
|
||||
"password-invalid": "Mot de passe incorrect",
|
||||
"password-required": "Le mot de passe est requis.",
|
||||
"patch-name": "Nom du patch",
|
||||
@@ -1376,8 +1325,6 @@
|
||||
"pbd-details": "Détails du périphérique de bloc physique (PBD)",
|
||||
"pending": "En cours",
|
||||
"per-vm-options": "Options par VM",
|
||||
"permission": "Permission",
|
||||
"permission-required": "Permission requise",
|
||||
"physical-interface-status": "Statut de l'interface physique",
|
||||
"physical-network": "Réseau physique",
|
||||
"pif": "PIF",
|
||||
@@ -1440,32 +1387,6 @@
|
||||
"priority": "Priorité",
|
||||
"priority-within": "Priorité dans {name}",
|
||||
"private-network": "Réseau privé | Réseaux privés",
|
||||
"privilege": "Privilège",
|
||||
"privilege-number": "Privilège #{n}",
|
||||
"privilege:action": "Action",
|
||||
"privilege:applied-to": "Appliqué à",
|
||||
"privilege:create-new": "Créer un nouveau privilège",
|
||||
"privilege:currently-applied-to": "Appliqué actuellement à",
|
||||
"privilege:details": "Détails du privilège",
|
||||
"privilege:dynamic-selection-info": "Le privilège s'appliquera à tous les objets correspondant à cette requête.",
|
||||
"privilege:edit": "Modifier le privilège",
|
||||
"privilege:effect": "Effet",
|
||||
"privilege:no-object": "Aucun objet",
|
||||
"privilege:none-yet": "Aucun privilège pour le moment",
|
||||
"privilege:one-privilege-per-action": "Chaque action fera l'objet d'un privilège dédié",
|
||||
"privilege:resource": "Ressource",
|
||||
"privilege:review-and-confirm": "Vérifier et confirmer",
|
||||
"privilege:scope": "Portée",
|
||||
"privilege:scope-preview": "Aperçu de la portée",
|
||||
"privilege:scope-type": "Type de portée",
|
||||
"privilege:scope-type:all-objects": "Tous les objets",
|
||||
"privilege:scope-type:dynamic-selection": "Sélection dynamique",
|
||||
"privilege:scope-type:manual-selection": "Sélection manuelle",
|
||||
"privilege:select-scope": "Sélectionner la portée",
|
||||
"privilege:selector": "Sélecteur",
|
||||
"privilege:what-is-a-privilege-description": "Un privilège est une permission fine qui contrôle l'accès à une action ou une ressource précise de votre environnement, comme démarrer une VM, modifier un réseau ou consulter le stockage. Chaque privilège appartient à un seul rôle. Attribuez des privilèges à un rôle pour définir précisément ce que les utilisateurs de ce rôle peuvent faire.",
|
||||
"privilege:what-is-a-privilege?": "Qu'est-ce qu'un privilège ?",
|
||||
"privileges": "Privilèges",
|
||||
"pro-support": "Support pro {name}",
|
||||
"professional-support": "Support professionnel",
|
||||
"progress": "Progression",
|
||||
@@ -1478,7 +1399,6 @@
|
||||
"protection-status": "Statut de la protection",
|
||||
"protocol": "Protocole",
|
||||
"protocol:port": "@:{'protocol'}:@:{'port'}",
|
||||
"provider": "Fournisseur",
|
||||
"provider-solutions": "Solutions {provider}",
|
||||
"providers": "Fournisseurs",
|
||||
"provisioning": "Provisionnement",
|
||||
@@ -1573,19 +1493,6 @@
|
||||
"review": "Revue",
|
||||
"review-and-confirm": "Vérifier et confirmer",
|
||||
"review-and-launch": "Revue et lancement",
|
||||
"role": "Rôle",
|
||||
"role-templates": "Modèles de rôle",
|
||||
"role:creating": "Création du nouveau rôle en cours…",
|
||||
"role:delete-warning": "Supprimer ce rôle le retirera définitivement, ainsi que tous ses privilèges. Cette action est irréversible. Procédez avec prudence. | Supprimer ces rôles les retirera définitivement, ainsi que tous leurs privilèges. Cette action est irréversible. Procédez avec prudence.",
|
||||
"role:details": "Détails du rôle",
|
||||
"role:direct-users": "Direct",
|
||||
"role:name-info": "Par exemple : Opérateur VM, Administrateur réseau ou Lecteur seul",
|
||||
"role:new": "Nouveau rôle",
|
||||
"role:new-from-template": "Nouveau rôle à partir d'un modèle",
|
||||
"role:unable-to-create": "Impossible de créer le nouveau rôle",
|
||||
"role:users-from-group": "Du groupe {group}",
|
||||
"role:what-is-a-role-description": "Un rôle est un ensemble de privilèges attribuable à des utilisateurs et à des groupes. Attribuer un rôle accorde tous ses privilèges d'un coup. Un utilisateur détient les rôles qui lui sont attribués directement, ainsi que tous ceux hérités des groupes auxquels il appartient.",
|
||||
"role:what-is-a-role?": "Qu'est-ce qu'un rôle ?",
|
||||
"roles": "Rôles",
|
||||
"roles-applied": "Rôles appliqués",
|
||||
"root-by-default": "\"root\" par défaut.",
|
||||
@@ -1600,6 +1507,7 @@
|
||||
"save-xo-config": "Sauvegarder la config XO",
|
||||
"scan-pifs": "Scan PIFs",
|
||||
"schedule": "Planification",
|
||||
"schedules": "Planifications",
|
||||
"scope": "Périmètre",
|
||||
"scope-preview": "Aperçu du périmètre",
|
||||
"scope-type": "Type de périmètre",
|
||||
@@ -1611,14 +1519,11 @@
|
||||
"see-details": "Voir les détails",
|
||||
"select-at-least-one-backup-repository": "Sélectionnez au moins un backup repository.",
|
||||
"select-at-least-one-day": "Sélectionnez au moins un jour du mois ou de la semaine.",
|
||||
"select-at-least-one-group.": "Sélectionnez au moins un groupe.",
|
||||
"select-at-least-one-hour": "Sélectionnez au moins une heure.",
|
||||
"select-at-least-one-object": "La sélection d’au moins un objet est obligatoire.",
|
||||
"select-at-least-one-option": "Sélectionnez au moins une option.",
|
||||
"select-at-least-one-role.": "Sélectionnez au moins un rôle.",
|
||||
"select-at-least-one-storage-repository": "Sélectionnez au moins un storage repository.",
|
||||
"select-at-least-one-storage-target": "Sélectionnez au moins une cible de stockage.",
|
||||
"select-at-least-one-user.": "Sélectionnez au moins un utilisateur.",
|
||||
"select-compression": "Sélectionnez une compression",
|
||||
"select-destination-host": "Sélectionnez un hôte de destination",
|
||||
"select-format": "Sélectionner le format",
|
||||
@@ -1661,7 +1566,6 @@
|
||||
"snapshot-mode:with-memory-description": "Inclut l'état de la mémoire de la VM. La VM sera brièvement suspendue pendant le snapshot.",
|
||||
"snapshot-revert-snapshot-before": "Créer un instantané de la VM avant la restauration",
|
||||
"snapshot-revert-warning": "La VM sera restaurée à l'état de l'instantané sélectionné. Tous les changements effectués depuis (données, configuration et état des disques) seront perdus. Cette action est irréversible.",
|
||||
"snapshot-settings-disabled-offline-backup": "Les paramètres de snapshot sont désactivés car la sauvegarde hors ligne éteint les VMs au lieu de faire un snapshot.",
|
||||
"snapshot-synchronisation": "Synchronisation des snapshots",
|
||||
"snapshot-vdis": "VDIs snapshot",
|
||||
"snapshots": "Instantanés",
|
||||
@@ -1885,15 +1789,7 @@
|
||||
"used-space-on-sr": "Espace utilisé sur le SR",
|
||||
"user": "Utilisateur",
|
||||
"user-config": "Configuration utilisateur",
|
||||
"user-details": "Détails de l'utilisateur",
|
||||
"user-management": "Gestion des utilisateurs",
|
||||
"user:create-new": "Créer un nouvel utilisateur",
|
||||
"user:delete-warning": "Supprimer cet utilisateur retirera définitivement son accès et les permissions associées. Cette action est irréversible. Procédez avec prudence. | Supprimer ces utilisateurs retirera définitivement leurs accès et les permissions associées. Cette action est irréversible. Procédez avec prudence.",
|
||||
"user:direct-roles": "Rôles directs",
|
||||
"user:groups-assignment": "Affectation des groupes",
|
||||
"user:roles-assignment": "Affectation des rôles",
|
||||
"user:roles-from-group": "Du groupe {group}",
|
||||
"user:roles-from-groups-info": "Les rôles des groupes affectés sont automatiquement appliqués à cet utilisateur. Vous pouvez ajouter des rôles supplémentaires ci-dessous si besoin.",
|
||||
"username": "Nom d'utilisateur",
|
||||
"username-required": "Le nom d'utilisateur est requis.",
|
||||
"users": "Utilisateurs",
|
||||
@@ -2104,7 +2000,6 @@
|
||||
"xoa-ssh-account": "Compte SSH de la XOA",
|
||||
"xoa-ssh-password-confirm-different": "La confirmation du mot de passe SSH est différente",
|
||||
"xva": "XVA",
|
||||
"yes": "Oui",
|
||||
"you-are-currently-on": "Vous êtes actuellement sur : {0}",
|
||||
"your-default-network-is": "Votre réseau par défaut est {name}",
|
||||
"zstd": "ZSTD"
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "Esempio: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Scansiona PIF",
|
||||
"schedule": "Pianificazione",
|
||||
"schedules": "Pianificazioni",
|
||||
"secret": "Segreto",
|
||||
"secure-boot": "Secure boot",
|
||||
"see-details": "Vedi i dettagli",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "例: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "PIF をスキャン",
|
||||
"schedule": "スケジュール",
|
||||
"schedules": "スケジュール",
|
||||
"secret": "シークレット",
|
||||
"secure-boot": "セキュアブート",
|
||||
"see-details": "詳細を表示",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "예: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "PIF 검색",
|
||||
"schedule": "일정",
|
||||
"schedules": "일정",
|
||||
"secret": "시크릿",
|
||||
"secure-boot": "보안 부팅",
|
||||
"see-details": "상세 보기",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "Eksempel: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Skann PIF-er",
|
||||
"schedule": "Tidsplan",
|
||||
"schedules": "Tidsplaner",
|
||||
"secret": "Hemmelighet",
|
||||
"secure-boot": "Sikker oppstart",
|
||||
"see-details": "Se detaljer",
|
||||
|
||||
@@ -1190,6 +1190,7 @@
|
||||
"s3-endpoint-sample": "Voorbeeld: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Scan PIF's",
|
||||
"schedule": "Planning",
|
||||
"schedules": "Schema's",
|
||||
"secret": "Secret",
|
||||
"secure-boot": "Beveiligd opstarten",
|
||||
"see-details": "Zie details",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "Przykład: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Skanuj PIF",
|
||||
"schedule": "Harmonogram",
|
||||
"schedules": "Harmonogramy",
|
||||
"secret": "Sekret",
|
||||
"secure-boot": "Secure boot",
|
||||
"see-details": "Zobacz szczegóły",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "Exemplo: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Escanear PIFs",
|
||||
"schedule": "Agendamento",
|
||||
"schedules": "Agendamentos",
|
||||
"secret": "Segredo",
|
||||
"secure-boot": "Secure boot",
|
||||
"see-details": "Veja os detalhes",
|
||||
|
||||
@@ -726,6 +726,7 @@
|
||||
"s3-backup-repository": "Repositório de cópias de segurança do S3",
|
||||
"scan-pifs": "Digitalizar PIFs",
|
||||
"schedule": "Calendário",
|
||||
"schedules": "Calendários",
|
||||
"secure-boot": "Arranque seguro",
|
||||
"see-details": "Veja os detalhes",
|
||||
"select-compression": "Selecione um tipo de compressão",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "Пример: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Сканировать PIFs",
|
||||
"schedule": "Расписание",
|
||||
"schedules": "Расписания",
|
||||
"secret": "Секрет",
|
||||
"secure-boot": "Безопасная загрузка",
|
||||
"see-details": "Подробнее",
|
||||
|
||||
@@ -1017,6 +1017,7 @@
|
||||
"s3-backup-repository": "S3 repozitár záloh",
|
||||
"scan-pifs": "Skenovať PIFs",
|
||||
"schedule": "Plán",
|
||||
"schedules": "Plány",
|
||||
"secret": "Tajomstvo",
|
||||
"secure-boot": "Secure boot",
|
||||
"see-details": "Zobraziť podrobnosti",
|
||||
|
||||
@@ -940,6 +940,7 @@
|
||||
"s3-backup-repository": "S3 säkerhetskopieringsförvar",
|
||||
"scan-pifs": "Skanna PIF",
|
||||
"schedule": "Schema",
|
||||
"schedules": "Schema",
|
||||
"secure-boot": "Säker boot",
|
||||
"see-details": "Se detaljer",
|
||||
"select-compression": "Välj komprimering",
|
||||
|
||||
@@ -984,6 +984,7 @@
|
||||
"s3-backup-repository": "S3 yedek deposu",
|
||||
"scan-pifs": "PIF'leri tara",
|
||||
"schedule": "Zamanlama",
|
||||
"schedules": "Zamanlamalar",
|
||||
"secure-boot": "Güvenli önyükleme",
|
||||
"see-details": "Ayrıntıları gör",
|
||||
"select-compression": "Sıkıştırma seçin",
|
||||
|
||||
@@ -1049,6 +1049,7 @@
|
||||
"s3-endpoint-sample": "Приклад: s3.us-west-1.amazonaws.com",
|
||||
"scan-pifs": "Сканувати PIFs",
|
||||
"schedule": "Розклад",
|
||||
"schedules": "Розклади",
|
||||
"secret": "Секрет",
|
||||
"secure-boot": "Безпечне завантаження",
|
||||
"see-details": "Переглянути деталі",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user