feat(xo-server/proxy.upgradeAppliance): support proxies with unknown VM
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
> Users must be able to say: “Nice enhancement, I'm eager to test it”
|
> Users must be able to say: “Nice enhancement, I'm eager to test it”
|
||||||
|
|
||||||
- [API] `proxy.register` accepts `vmUuid` parameter which can be used when not connected to the XAPI containing the XO Proxy VM
|
- [API] `proxy.register` accepts `vmUuid` parameter which can be used when not connected to the XAPI containing the XO Proxy VM
|
||||||
|
- [Proxy] Can now upgrade proxies in VMs not connected to XO
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,28 @@ export default class Proxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.updateProxyAppliance(id, { upgrade: true })
|
let isVmKnown = false
|
||||||
|
|
||||||
|
const { vmUuid } = await this._getProxy(id)
|
||||||
|
if (vmUuid !== undefined) {
|
||||||
|
try {
|
||||||
|
this.getObject(vmUuid, 'VM')
|
||||||
|
|
||||||
|
isVmKnown = true
|
||||||
|
} catch (error) {
|
||||||
|
if (!noSuchObject.is(error)) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isVmKnown) {
|
||||||
|
// use the standard upgrade (via VM reboot)
|
||||||
|
await this.updateProxyAppliance(id, { upgrade: true })
|
||||||
|
} else {
|
||||||
|
// use the (limited) API upgrade instead
|
||||||
|
await this.callProxyMethod(id, 'appliance.updater.upgrade')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateProxyAppliance(id, { httpProxy, upgrade = false }) {
|
async updateProxyAppliance(id, { httpProxy, upgrade = false }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user