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) {
|
if (mapVdisSrs) {
|
||||||
mapVdisSrsXapi = {}
|
mapVdisSrsXapi = {}
|
||||||
forEach(mapVdisSrs, (srId, vdiId) => {
|
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
|
mapVdisSrsXapi[vdiXapiId] = this.getObject(srId, 'SR')._xapiId
|
||||||
return permissions.push([srId, 'administrate'])
|
return permissions.push([srId, 'administrate'])
|
||||||
})
|
})
|
||||||
|
@ -19,6 +19,7 @@ import {
|
|||||||
every,
|
every,
|
||||||
find,
|
find,
|
||||||
filter,
|
filter,
|
||||||
|
flatMap,
|
||||||
flatten,
|
flatten,
|
||||||
groupBy,
|
groupBy,
|
||||||
includes,
|
includes,
|
||||||
@ -1149,7 +1150,8 @@ export default class Xapi extends XapiBase {
|
|||||||
// VDIs/SRs mapping
|
// VDIs/SRs mapping
|
||||||
const vdis = {}
|
const vdis = {}
|
||||||
const defaultSr = host.$pool.$default_SR
|
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
|
const vdi = vbd.$VDI
|
||||||
if (vbd.type === 'Disk') {
|
if (vbd.type === 'Disk') {
|
||||||
vdis[vdi.$ref] =
|
vdis[vdi.$ref] =
|
||||||
|
Loading…
Reference in New Issue
Block a user