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',
|
||||
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, {
|
||||
autoPoweron: true,
|
||||
name_label: 'XOSAN imported VM',
|
||||
|
@ -271,13 +271,15 @@ export default class Proxy {
|
||||
[namespace]: { xva },
|
||||
} = await app.getResourceCatalog()
|
||||
const xapi = app.getXapi(srId)
|
||||
const vm = await xapi.VM_import(
|
||||
await app.requestResource({
|
||||
id: xva.id,
|
||||
namespace,
|
||||
version: xva.version,
|
||||
}),
|
||||
srId && app.getObject(srId, 'SR')._xapiRef
|
||||
const vm = await xapi.getOrWaitObject(
|
||||
await xapi.VM_import(
|
||||
await app.requestResource({
|
||||
id: xva.id,
|
||||
namespace,
|
||||
version: xva.version,
|
||||
}),
|
||||
srId && app.getObject(srId, 'SR')._xapiRef
|
||||
)
|
||||
)
|
||||
$defer.onFailure(() => xapi.VM_destroy(vm.$ref))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user