Skip to content

Commit

Permalink
fix(xo-web/home/VM): do not migrate_send during VM migration if not…
Browse files Browse the repository at this point in the history
… needed
  • Loading branch information
MathieuRA committed Feb 6, 2024
1 parent 9ce5b01 commit d98ee96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [REST API] Fix empty object's tasks list
- [REST API] Fix incorrect `href` in `/:collection/:object/tasks`
- [VM/Migration] Fix VDIs that were not migrated to the destination SR (PR [#7360](https://github.com/vatesfr/xen-orchestra/pull/7360))
- [Home/VM] VMs migration from the home view will no longer execute a `migrate_send` unless it is necessary [Forum#8279](https://xcp-ng.org/forum/topic/8279/getting-errors-when-migrating-4-out-5-vmguest/)(PR [#7360](https://github.com/vatesfr/xen-orchestra/pull/7360))

### Packages to release

Expand All @@ -36,5 +37,6 @@
- @xen-orchestra/immutable-backups patch
- @xen-orchestra/xva patch
- xo-server patch
- xo-web patch

<!--packages-end-->
14 changes: 7 additions & 7 deletions packages/xo-web/src/common/xo/migrate-vms-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ export default class MigrateVmsModalBody extends BaseComponent {
)
}

componentDidMount() {
this._selectHost(this.props.host)
}

get value() {
const { host } = this.state
const vms = filter(this.props.vms, vm => vm.$container !== host.id)
Expand All @@ -124,10 +120,14 @@ export default class MigrateVmsModalBody extends BaseComponent {
forEach(vbds, vbd => {
const vdi = vbd.VDI
if (!vbd.is_cd_drive && vdi) {
mapVdisSrs[vdi] = doNotMigrateVmVdis[vm] || doNotMigrateVdi[vdi] ? this._getObject(vdi).$SR : srId
if (!doNotMigrateVmVdis[vm] && !doNotMigrateVdi[vdi]) {
mapVdisSrs[vdi] = srId
}
}
})
mapVmsMapVdisSrs[vm] = mapVdisSrs
if (!isEmpty(mapVdisSrs)) {
mapVmsMapVdisSrs[vm] = mapVdisSrs
}
})

const defaultNetwork =
Expand Down Expand Up @@ -212,7 +212,7 @@ export default class MigrateVmsModalBody extends BaseComponent {
networkId: defaultMigrationNetworkId,
noVdisMigration,
smartVifMapping: true,
srId: defaultSrConnectedToHost ? defaultSrId : undefined,
srId: !noVdisMigration && defaultSrConnectedToHost ? defaultSrId : undefined,
})
}

Expand Down

0 comments on commit d98ee96

Please sign in to comment.