fix(Xapi#importVdiContent): find first attached PBD (#279)
This commit is contained in:
parent
4778274c97
commit
ee1105b6dd
@ -2164,14 +2164,17 @@ export default class Xapi extends XapiBase {
|
|||||||
vdi: vdi.$ref
|
vdi: vdi.$ref
|
||||||
}
|
}
|
||||||
|
|
||||||
const host = vdi.$SR.$PBDs[0].$host
|
const pbd = find(vdi.$SR.$PBDs, 'currently_attached')
|
||||||
|
if (!pbd) {
|
||||||
|
throw new Error('no valid PBDs found')
|
||||||
|
}
|
||||||
|
|
||||||
const task = this._watchTask(taskRef)
|
const task = this._watchTask(taskRef)
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
stream.checksumVerified,
|
stream.checksumVerified,
|
||||||
task,
|
task,
|
||||||
put(stream, {
|
put(stream, {
|
||||||
hostname: host.address,
|
hostname: pbd.$host.address,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
path: '/import_raw_vdi/',
|
path: '/import_raw_vdi/',
|
||||||
query
|
query
|
||||||
|
Loading…
Reference in New Issue
Block a user