fix(Xapi#importVm): remove VM's VDIs on failure

This commit is contained in:
Julien Fontanet 2016-09-14 14:05:13 +02:00
parent a002958448
commit 603a444905

View File

@ -905,7 +905,7 @@ export default class Xapi extends XapiBase {
is_a_template: false is_a_template: false
}) })
) )
$onFailure(() => this._deleteVm(vm)) $onFailure(() => this._deleteVm(vm, true))
await Promise.all([ await Promise.all([
this._setObjectProperties(vm, { this._setObjectProperties(vm, {
@ -1149,7 +1149,7 @@ export default class Xapi extends XapiBase {
VCPUs_max: nCpus VCPUs_max: nCpus
}) })
) )
$onFailure(() => this._deleteVm(vm)) $onFailure(() => this._deleteVm(vm, true))
// Disable start and change the VM name label during import. // Disable start and change the VM name label during import.
await Promise.all([ await Promise.all([
this.addForbiddenOperationToVm(vm.$id, 'start', 'OVA import in progress...'), this.addForbiddenOperationToVm(vm.$id, 'start', 'OVA import in progress...'),