Skip to content

Commit

Permalink
feat(xapi/VDI_importContent): add SR name_label to task name_label (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ggunullu committed Sep 28, 2023
1 parent c7d5b4b commit 2e1abad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions @xen-orchestra/xapi/vdi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,23 @@ class Vdi {
if (stream.length === undefined) {
throw new Error('Trying to import a VDI without a length field. Please report this error to Xen Orchestra.')
}

const vdi = await this.getRecord('VDI', ref)
const sr = await this.getRecord('SR', vdi.SR)

try {
await this.putResource(cancelToken, stream, '/import_raw_vdi/', {
query: {
format,
vdi: ref,
},
task: await this.task_create(`Importing content into VDI ${await this.getField('VDI', ref, 'name_label')}`),
task: await this.task_create(`Importing content into VDI ${vdi.name_label} on SR ${sr.name_label}`),
})
} catch (error) {
// augment the error with as much relevant info as possible
const [poolMaster, vdi] = await Promise.all([
this.getRecord('host', this.pool.master),
this.getRecord('VDI', ref),
])
const poolMaster = await this.getRecord('host', this.pool.master)
error.pool_master = poolMaster
error.SR = await this.getRecord('SR', vdi.SR)
error.SR = sr
error.VDI = vdi
throw error
}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Backup/Mirror] Fix backup report not being sent (PR [#7049](https://github.com/vatesfr/xen-orchestra/pull/7049))
- [New VM] Only add MBR to cloud-init drive on Windows VMs to avoid booting issues (e.g. with Talos) (PR [#7050](https://github.com/vatesfr/xen-orchestra/pull/7050))
- [VDI Import] Add the SR name to the corresponding XAPI task (PR [#6979](https://github.com/vatesfr/xen-orchestra/pull/6979))

### Packages to release

Expand All @@ -30,6 +31,7 @@
<!--packages-start-->

- @xen-orchestra/xapi minor
- xo-server-backup-reports patch
- xo-server patch
- xo-web patch
Expand Down

0 comments on commit 2e1abad

Please sign in to comment.