Compare commits

...

2 Commits

Author SHA1 Message Date
Florent BEAUCHAMP
6176948ddf changelog 2023-06-15 17:45:32 +02:00
Florent BEAUCHAMP
f07442a953 fix(Vm/Import): better error message if SR is missing
also used in healthcheck
2023-06-15 16:29:52 +02:00
2 changed files with 17 additions and 1 deletions

View File

@@ -47,12 +47,26 @@ exports.ImportVmBackup = class ImportVmBackup {
const xapi = this._xapi
const srRef = await xapi.call('SR.get_by_uuid', this._srUuid)
const vmRef = isFull
let vmRef
try {
vmRef = isFull
? await xapi.VM_import(backup, srRef)
: await importIncrementalVm(backup, await xapi.getRecord('SR', srRef), {
...this._importIncrementalVmSettings,
detectBase: false,
})
}
catch(err){
if(err.code === 'SR_HAS_NO_PBDS'){
const error = new Error('SR used for VM import is missing (not connected or removed)')
error.cause = err
error.code = err.code
throw error
}
throw err
}
await Promise.all([
xapi.call('VM.add_tags', vmRef, 'restored from backup'),

View File

@@ -17,6 +17,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Home/Host] Fix "isHostTimeConsistentWithXoaTime.then is not a function" (PR [#6896](https://github.com/vatesfr/xen-orchestra/pull/6896))
- [Vm/Restore] Better error message when importing a Vm to a disabled Sr (PR [#6901](https://github.com/vatesfr/xen-orchestra/pull/6901))
### Packages to release
@@ -36,6 +37,7 @@
- @vates/nbd-client patch
- @vates/task minor
- @xen-orchestra/backups patch
- xo-server-auth-oidc minor
- xo-web minor