fix(vm.deltaCopy): correctly destroy VDIs (#589)
This commit is contained in:
parent
76357fb918
commit
e3d436a019
@ -110,7 +110,7 @@
|
|||||||
"tmp": "^0.0.31",
|
"tmp": "^0.0.31",
|
||||||
"uuid": "^3.0.1",
|
"uuid": "^3.0.1",
|
||||||
"ws": "^3.0.0",
|
"ws": "^3.0.0",
|
||||||
"xen-api": "^0.13.7",
|
"xen-api": "^0.14.0",
|
||||||
"xml2js": "~0.4.17",
|
"xml2js": "~0.4.17",
|
||||||
"xo-acl-resolver": "^0.2.3",
|
"xo-acl-resolver": "^0.2.3",
|
||||||
"xo-collection": "^0.4.1",
|
"xo-collection": "^0.4.1",
|
||||||
|
@ -653,6 +653,8 @@ export default class Xapi extends XapiBase {
|
|||||||
await this.call('VM.hard_shutdown', vm.$ref)
|
await this.call('VM.hard_shutdown', vm.$ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await this.barrier('VM', vm.$ref)
|
||||||
|
|
||||||
if (deleteDisks) {
|
if (deleteDisks) {
|
||||||
// Compute the VDIs list without duplicates.
|
// Compute the VDIs list without duplicates.
|
||||||
const vdis = {}
|
const vdis = {}
|
||||||
@ -999,29 +1001,29 @@ export default class Xapi extends XapiBase {
|
|||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
// Create VBDs.
|
// Create VBDs.
|
||||||
Promise.all(mapToArray(
|
asyncMap(
|
||||||
delta.vbds,
|
delta.vbds,
|
||||||
vbd => this._createVbd(vm, newVdis[vbd.VDI], vbd)
|
vbd => this._createVbd(vm, newVdis[vbd.VDI], vbd)
|
||||||
)),
|
),
|
||||||
|
|
||||||
// Import VDI contents.
|
// Import VDI contents.
|
||||||
Promise.all(mapToArray(
|
asyncMap(
|
||||||
newVdis,
|
newVdis,
|
||||||
async (vdi, id) => {
|
async (vdi, id) => {
|
||||||
for (const stream of ensureArray(streams[`${id}.vhd`])) {
|
for (const stream of ensureArray(streams[`${id}.vhd`])) {
|
||||||
await this._importVdiContent(vdi, stream, VDI_FORMAT_VHD)
|
await this._importVdiContent(vdi, stream, VDI_FORMAT_VHD)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)),
|
),
|
||||||
|
|
||||||
// Wait for VDI export tasks (if any) termination.
|
// Wait for VDI export tasks (if any) termination.
|
||||||
Promise.all(mapToArray(
|
asyncMap(
|
||||||
streams,
|
streams,
|
||||||
stream => stream.task
|
stream => stream.task
|
||||||
)),
|
),
|
||||||
|
|
||||||
// Create VIFs.
|
// Create VIFs.
|
||||||
Promise.all(mapToArray(delta.vifs, vif => {
|
asyncMap(delta.vifs, vif => {
|
||||||
const network =
|
const network =
|
||||||
(vif.$network$uuid && this.getObject(vif.$network$uuid, null)) ||
|
(vif.$network$uuid && this.getObject(vif.$network$uuid, null)) ||
|
||||||
networksOnPoolMasterByDevice[vif.device] ||
|
networksOnPoolMasterByDevice[vif.device] ||
|
||||||
@ -1034,7 +1036,7 @@ export default class Xapi extends XapiBase {
|
|||||||
vif
|
vif
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
])
|
])
|
||||||
|
|
||||||
if (deleteBase && baseVm) {
|
if (deleteBase && baseVm) {
|
||||||
@ -1867,6 +1869,7 @@ export default class Xapi extends XapiBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
body.task,
|
||||||
body.checksumVerified,
|
body.checksumVerified,
|
||||||
this.putResource(body, '/import_raw_vdi/', {
|
this.putResource(body, '/import_raw_vdi/', {
|
||||||
host: pbd.host,
|
host: pbd.host,
|
||||||
|
@ -7093,9 +7093,9 @@ xdg-basedir@^3.0.0:
|
|||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4"
|
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4"
|
||||||
|
|
||||||
xen-api@^0.13.7:
|
xen-api@^0.14.0:
|
||||||
version "0.13.7"
|
version "0.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/xen-api/-/xen-api-0.13.7.tgz#75da4d60e15820501186c816ed993182c4019627"
|
resolved "https://registry.yarnpkg.com/xen-api/-/xen-api-0.14.0.tgz#93bfb9f35daca1092237f1a0dfb211005a8e7916"
|
||||||
dependencies:
|
dependencies:
|
||||||
babel-polyfill "^6.23.0"
|
babel-polyfill "^6.23.0"
|
||||||
blocked "^1.2.1"
|
blocked "^1.2.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user