fix(xo-server): VM_import() returns ref, not record
Introduced by 70b0983
This commit is contained in:
parent
8b0b2d7c31
commit
48c3a65cc6
@ -965,7 +965,9 @@ async function _importGlusterVM(xapi, template, lvmsrId) {
|
|||||||
namespace: 'xosan',
|
namespace: 'xosan',
|
||||||
version: template.version,
|
version: template.version,
|
||||||
})
|
})
|
||||||
const newVM = await xapi.VM_import(templateStream, this.getObject(lvmsrId, 'SR')._xapiRef)
|
const newVM = await xapi._getOrWaitObject(
|
||||||
|
await xapi.VM_import(templateStream, this.getObject(lvmsrId, 'SR')._xapiRef)
|
||||||
|
)
|
||||||
await xapi.editVm(newVM, {
|
await xapi.editVm(newVM, {
|
||||||
autoPoweron: true,
|
autoPoweron: true,
|
||||||
name_label: 'XOSAN imported VM',
|
name_label: 'XOSAN imported VM',
|
||||||
|
@ -271,13 +271,15 @@ export default class Proxy {
|
|||||||
[namespace]: { xva },
|
[namespace]: { xva },
|
||||||
} = await app.getResourceCatalog()
|
} = await app.getResourceCatalog()
|
||||||
const xapi = app.getXapi(srId)
|
const xapi = app.getXapi(srId)
|
||||||
const vm = await xapi.VM_import(
|
const vm = await xapi.getOrWaitObject(
|
||||||
await app.requestResource({
|
await xapi.VM_import(
|
||||||
id: xva.id,
|
await app.requestResource({
|
||||||
namespace,
|
id: xva.id,
|
||||||
version: xva.version,
|
namespace,
|
||||||
}),
|
version: xva.version,
|
||||||
srId && app.getObject(srId, 'SR')._xapiRef
|
}),
|
||||||
|
srId && app.getObject(srId, 'SR')._xapiRef
|
||||||
|
)
|
||||||
)
|
)
|
||||||
$defer.onFailure(() => xapi.VM_destroy(vm.$ref))
|
$defer.onFailure(() => xapi.VM_destroy(vm.$ref))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user