diff --git a/@xen-orchestra/xapi/sr.js b/@xen-orchestra/xapi/sr.js index b473914a7e7..2b640daf85a 100644 --- a/@xen-orchestra/xapi/sr.js +++ b/@xen-orchestra/xapi/sr.js @@ -4,7 +4,7 @@ const { asyncMap, asyncMapSettled } = require('@xen-orchestra/async-map') const { decorateClass } = require('@vates/decorate-with') const { defer } = require('golike-defer') const { incorrectState } = require('xo-common/api-errors') -const { VDI_FORMAT_RAW } = require('./index.js') +const { VDI_FORMAT_VHD } = require('./index.js') const peekFooterFromStream = require('vhd-lib/peekFooterFromVhdStream') const AggregateError = require('./_AggregateError.js') @@ -155,7 +155,7 @@ class Sr { const footer = await peekFooterFromStream(stream) const vdiRef = await this.VDI_create({ ...vdiCreateOpts, name_label, SR: ref, virtual_size: footer.currentSize }) $defer.onFailure.call(this, 'callAsync', 'VDI.destroy', vdiRef) - await this.VDI_importContent(vdiRef, stream, { format: VDI_FORMAT_RAW }) + await this.VDI_importContent(vdiRef, stream, { format: VDI_FORMAT_VHD }) return vdiRef } } diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 2a401681036..115d1d78fd0 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -12,6 +12,7 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” - [Home/VM] Show error when deleting VMs failed (PR [#6323](https://github.com/vatesfr/xen-orchestra/pull/6323)) +- [REST API] Fix broken VDI after VHD import [#6327](https://github.com/vatesfr/xen-orchestra/issues/6327) (PR [#6326](https://github.com/vatesfr/xen-orchestra/pull/6326)) ### Packages to release