fix(xo-server/migrateVm): take VDIs of snapshot into account (#3298)
See #2557
This commit is contained in:
parent
1db9ca9e31
commit
4a0b29e1f2
@ -456,7 +456,7 @@ export async function migrate ({
|
||||
if (mapVdisSrs) {
|
||||
mapVdisSrsXapi = {}
|
||||
forEach(mapVdisSrs, (srId, vdiId) => {
|
||||
const vdiXapiId = this.getObject(vdiId, 'VDI')._xapiId
|
||||
const vdiXapiId = this.getObject(vdiId, ['VDI', 'VDI-snapshot'])._xapiId
|
||||
mapVdisSrsXapi[vdiXapiId] = this.getObject(srId, 'SR')._xapiId
|
||||
return permissions.push([srId, 'administrate'])
|
||||
})
|
||||
|
@ -19,6 +19,7 @@ import {
|
||||
every,
|
||||
find,
|
||||
filter,
|
||||
flatMap,
|
||||
flatten,
|
||||
groupBy,
|
||||
includes,
|
||||
@ -1149,7 +1150,8 @@ export default class Xapi extends XapiBase {
|
||||
// VDIs/SRs mapping
|
||||
const vdis = {}
|
||||
const defaultSr = host.$pool.$default_SR
|
||||
for (const vbd of vm.$VBDs) {
|
||||
const vbds = flatMap(vm.$snapshots, '$VBDs').concat(vm.$VBDs)
|
||||
for (const vbd of vbds) {
|
||||
const vdi = vbd.$VDI
|
||||
if (vbd.type === 'Disk') {
|
||||
vdis[vdi.$ref] =
|
||||
|
Loading…
Reference in New Issue
Block a user