fix(xapi/VBD_create): don't fail if the VBD could not be plugged
Otherwise, the creation method would have failed but the VBD would still exist, violating the principle of least surprise.
This commit is contained in:
parent
3ef6adfd02
commit
d353dc622c
@ -6,6 +6,8 @@ const { Ref } = require('xen-api')
|
||||
|
||||
const isVmRunning = require('./_isVmRunning.js')
|
||||
|
||||
const { warn } = require('@xen-orchestra/log').createLogger('xo:xapi:vbd')
|
||||
|
||||
const noop = Function.prototype
|
||||
|
||||
module.exports = class Vbd {
|
||||
@ -66,7 +68,7 @@ module.exports = class Vbd {
|
||||
})
|
||||
|
||||
if (isVmRunning(powerState)) {
|
||||
await this.callAsync('VBD.plug', vbdRef)
|
||||
this.callAsync('VBD.plug', vbdRef).catch(warn)
|
||||
}
|
||||
|
||||
return vbdRef
|
||||
|
Loading…
Reference in New Issue
Block a user