From 8a74210049ffed1f62a4e146501a01c5145c7d28 Mon Sep 17 00:00:00 2001 From: Pierre Donias Date: Thu, 1 Jun 2017 12:57:14 +0200 Subject: [PATCH] fix(Xapi#createTemporaryVdiOnHost): properly get available SR (#562) --- src/xapi/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xapi/index.js b/src/xapi/index.js index ee612948b..91693e73c 100644 --- a/src/xapi/index.js +++ b/src/xapi/index.js @@ -2166,16 +2166,16 @@ export default class Xapi extends XapiBase { // Create VDI on an adequate local SR async createTemporaryVdiOnHost (stream, hostId, name_label, name_description) { - const sr = find( + const pbd = find( this.getObject(hostId).$PBDs, pbd => canSrHaveNewVdiOfSize(pbd.$SR, stream.length) ) - if (sr == null) { + if (pbd == null) { throw new Error('no SR available') } - return this.createTemporaryVdiOnSr(stream, sr, name_label, name_description) + return this.createTemporaryVdiOnSr(stream, pbd.SR, name_label, name_description) } async findAvailableSharedSr (minSize) {