fix(xapi/SR_importVdi): import as VDH, not raw

Fixes #6327
This commit is contained in:
Julien Fontanet 2022-07-21 15:04:02 +02:00
parent 6c08afaa0e
commit 2fbeaa618a
2 changed files with 3 additions and 2 deletions

View File

@ -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
}
}

View File

@ -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