fix(xo-server/vm.create): work around a race condition (#2755)
Fixes #2747
This commit is contained in:
parent
80c1e39b53
commit
f5511449af
@ -160,12 +160,11 @@ export async function create (params) {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const vifId of vm.VIFs) {
|
for (const vif of xapiVm.$VIFs) {
|
||||||
const vif = this.getObject(vifId, 'VIF')
|
|
||||||
await this.allocIpAddresses(
|
await this.allocIpAddresses(
|
||||||
vifId,
|
vif.$id,
|
||||||
concat(vif.allowedIpv4Addresses, vif.allowedIpv6Addresses)
|
concat(vif.ipv4_allowed, vif.ipv6_allowed)
|
||||||
).catch(() => xapi.deleteVif(vif._xapiId))
|
).catch(() => xapi.deleteVif(vif))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.bootAfterCreate) {
|
if (params.bootAfterCreate) {
|
||||||
|
Loading…
Reference in New Issue
Block a user