fix(Xapi#resizeVdi): XS 7.3 support (#636)

Fixes vatesfr/xo-web#2542

According to the documentation, no SR backends were supporting `resize_online`.
This commit is contained in:
Julien Fontanet 2017-12-29 10:20:04 +01:00 committed by GitHub
parent ba6393165d
commit 892139908b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1690,17 +1690,10 @@ export default class Xapi extends XapiBase {
await this.call('VDI.destroy', vdi.$ref)
}
async _resizeVdi (vdi, size) {
_resizeVdi (vdi, size) {
debug(`Resizing VDI ${vdi.name_label} from ${vdi.virtual_size} to ${size}`)
try {
await this.call('VDI.resize_online', vdi.$ref, String(size))
} catch (error) {
if (error.code !== 'SR_OPERATION_NOT_SUPPORTED') {
throw error
}
await this.call('VDI.resize', vdi.$ref, String(size))
}
return this.call('VDI.resize', vdi.$ref, size)
}
_getVmCdDrive (vm) {