Skip to content

Commit

Permalink
feat(@xen-orchestra/xapi): add storage name_label to task description
Browse files Browse the repository at this point in the history
Add SR name to the task description.
  • Loading branch information
ggunullu committed Aug 25, 2023
1 parent 403d2c8 commit fab56e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions @xen-orchestra/xapi/vdi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,24 @@ 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.')
}
let vdi, sr
try {
vdi = await this.getRecord('VDI', ref)
sr = await this.getRecord('SR', vdi.SR)
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 ${await this.getField('VDI', ref, '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 @@ -17,6 +17,7 @@
- [Incremental Replication] Fix `TypeError: Cannot read properties of undefined (reading 'uuid') at #isAlreadyOnHealthCheckSr` [Forum#7492](https://xcp-ng.org/forum/topic/7492) (PR [#6969](https://github.com/vatesfr/xen-orchestra/pull/6969))
- [File Restore] Increase timeout from one to ten minutes when restoring through XO Proxy
- [Home/VMs] Filtering with a UUID will no longer show other VMs on the same host/pool
- [Import] Show the SR name when importing a disk

### Packages to release

Expand All @@ -36,6 +37,7 @@

- @xen-orchestra/backups patch
- @xen-orchestra/mixins minor
- @xen-orchestra/xapi minor
- xen-api patch
- xo-server patch
- xo-server-auth-ldap patch
Expand Down

0 comments on commit fab56e2

Please sign in to comment.