feat(backups,xo-server,xo-web): make NBD concurrency configurable

This commit is contained in:
Florent Beauchamp 2023-12-07 15:05:45 +00:00 committed by Julien Fontanet
parent fc1357db93
commit 847ad63c09
6 changed files with 38 additions and 2 deletions

View File

@ -34,6 +34,7 @@ export async function exportIncrementalVm(
fullVdisRequired = new Set(),
disableBaseTags = false,
nbdConcurrency = 1,
preferNbd,
} = {}
) {
@ -82,6 +83,7 @@ export async function exportIncrementalVm(
baseRef: baseVdi?.$ref,
cancelToken,
format: 'vhd',
nbdConcurrency,
preferNbd,
})
})

View File

@ -42,6 +42,7 @@ export const IncrementalXapi = class IncrementalXapiVmBackupRunner extends Abstr
const deltaExport = await exportIncrementalVm(exportedVm, baseVm, {
fullVdisRequired,
preferNbd: this._settings.preferNbd,
nbdConcurrency: this._settings.nbdConcurrency,
})
// since NBD is network based, if one disk use nbd , all the disk use them
// except the suspended VDI

View File

@ -14,6 +14,7 @@
- [REST API] _Mirror Backup_ jobs are available at `/backup/jobs/mirror`
- [Plugin/auth-saml] Add _Force re-authentication_ setting [Forum#67764](https://xcp-ng.org/forum/post/67764) (PR [#7232](https://github.com/vatesfr/xen-orchestra/pull/7232))
- [HTTP] `http.useForwardedHeaders` setting can be enabled when XO is behind a reverse proxy to fetch clients IP addresses from `X-Forwarded-*` headers [Forum#67625](https://xcp-ng.org/forum/post/67625) (PR [#7233](https://github.com/vatesfr/xen-orchestra/pull/7233))
- [Backup]Use multiple link to speedup NBD backup (PR [#7216](https://github.com/vatesfr/xen-orchestra/pull/7216))
### Bug fixes

View File

@ -22,6 +22,15 @@ const SCHEMA_SETTINGS = {
minimum: 0,
optional: true,
},
preferNbd: {
type: 'boolean',
optional: true,
},
nbdConcurrency: {
type: 'number',
minimum: 1,
optional: true,
},
},
additionalProperties: true,
},
@ -279,8 +288,8 @@ importVmBackup.params = {
},
useDifferentialRestore: {
type: 'boolean',
optional: true
}
optional: true,
},
}
export function checkBackup({ id, settings, sr }) {

View File

@ -586,6 +586,7 @@ const messages = {
editJobNotFound: "The job you're trying to edit wasn't found",
preferNbd: 'Use NBD protocol to transfer disk if available',
preferNbdInformation: 'A network accessible by XO or the proxy must have NBD enabled',
nbdConcurrency: 'Number of NBD connexion per disk',
// ------ New Remote -----
newRemote: 'New file system remote',

View File

@ -188,6 +188,7 @@ const getInitialState = ({ preSelectedVmIds, setHomeVmIdsSelection, suggestedExc
deltaMode: false,
drMode: false,
name: '',
nbdConcurrency: 1,
preferNbd: false,
remotes: [],
schedules: {},
@ -629,6 +630,11 @@ const New = decorate([
preferNbd,
})
},
setNbdConcurrency({ setGlobalSettings }, nbdConcurrency) {
setGlobalSettings({
nbdConcurrency,
})
},
},
computed: {
compressionId: generateId,
@ -637,6 +643,7 @@ const New = decorate([
inputFullIntervalId: generateId,
inputMaxExportRate: generateId,
inputPreferNbd: generateId,
inputNbdConcurrency: generateId,
inputTimeoutId: generateId,
// In order to keep the user preference, the offline backup is kept in the DB
@ -748,6 +755,7 @@ const New = decorate([
concurrency,
fullInterval,
maxExportRate,
nbdConcurrency = 1,
offlineBackup,
offlineSnapshot,
preferNbd,
@ -1040,6 +1048,20 @@ const New = decorate([
/>
</FormGroup>
)}
{state.isDelta && (
<FormGroup>
<label htmlFor={state.inputNbdConcurrency}>
<strong>{_('nbdConcurrency')}</strong>
</label>
<Number
id={state.inputNbdConcurrency}
min={1}
onChange={effects.setNbdConcurrency}
value={nbdConcurrency}
disabled={!state.inputPreferNbd}
/>
</FormGroup>
)}
<FormGroup>
<label htmlFor={state.inputMaxExportRate}>
<strong>{_('speedLimit')}</strong>