diff --git a/@xen-orchestra/xapi/vdi.mjs b/@xen-orchestra/xapi/vdi.mjs index 8eed7f4f998..e8378b78a3e 100644 --- a/@xen-orchestra/xapi/vdi.mjs +++ b/@xen-orchestra/xapi/vdi.mjs @@ -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 } diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 3a9ee88223c..69262ad7429 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -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 @@ -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