fix(xo-web/home/vm): bulk intra pool migration: fix map VDI -> SR (#5578)

See xoa-support#3355
See xoa-support#3248
This commit is contained in:
Rajaa.BARHTAOUI 2021-02-18 11:04:47 +01:00 committed by GitHub
parent 90cafa126f
commit 258ae64568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -23,6 +23,7 @@
- [Host] Restart toolstack: fix `ECONNREFUSED` error (PR [#5553](https://github.com/vatesfr/xen-orchestra/pull/5553))
- [VM migration] Intra-pool: don't automatically select migration network if no default migration network is defined on the pool (PR [#5564](https://github.com/vatesfr/xen-orchestra/pull/5564))
- [New SR] Fix `lun.LUNid.trim is not a function` error [#5497](https://github.com/vatesfr/xen-orchestra/issues/5497) (PR [#5581](https://github.com/vatesfr/xen-orchestra/pull/5581))
- [Home/vm] Bulk intra pool migration: fix VM VDIs on a shared SR wrongly migrated to the default SR (PR [#3987](https://github.com/vatesfr/xen-orchestra/pull/3987))
### Packages to release

View File

@ -121,16 +121,16 @@ export default class MigrateVmsModalBody extends BaseComponent {
const { doNotMigrateVdi, doNotMigrateVmVdis, migrationNetworkId, networkId, smartVifMapping, srId } = this.state
// Map VM --> ( Map VDI --> SR )
// 2021-02-16: Fill the map (VDI -> SR) with *all* the VDIs to avoid unexpectedly migrating them to the wrong SRs:
// - Intra-pool: a VDI will only be migrated to the selected SR if the VDI was on a local SR.
// - Inter-pool: all VDIs will be migrated to the selected SR.
const mapVmsMapVdisSrs = {}
forEach(vbdsByVm, (vbds, vm) => {
if (doNotMigrateVmVdis[vm]) {
return
}
const mapVdisSrs = {}
forEach(vbds, vbd => {
const vdi = vbd.VDI
if (!vbd.is_cd_drive && vdi) {
mapVdisSrs[vdi] = doNotMigrateVdi[vdi] ? this._getObject(vdi).SR : srId
mapVdisSrs[vdi] = doNotMigrateVmVdis[vm] || doNotMigrateVdi[vdi] ? this._getObject(vdi).$SR : srId
}
})
mapVmsMapVdisSrs[vm] = mapVdisSrs