@@ -20,6 +20,8 @@
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [New network] Fix bonded network not linked to the slave hosts [#4529](https://github.com/vatesfr/xen-orchestra/issues/4529) (PR [#4756](https://github.com/vatesfr/xen-orchestra/pull/4756))
|
||||
|
||||
### Released packages
|
||||
|
||||
> Packages will be released in the order they are here, therefore, they should
|
||||
|
||||
@@ -46,7 +46,6 @@ export async function createBonded({
|
||||
description,
|
||||
pifs,
|
||||
mtu = 1500,
|
||||
mac,
|
||||
bondMode,
|
||||
}) {
|
||||
return this.getXapi(pool).createBondedNetwork({
|
||||
@@ -54,7 +53,6 @@ export async function createBonded({
|
||||
description,
|
||||
pifIds: mapToArray(pifs, pif => this.getObject(pif, 'PIF')._xapiId),
|
||||
mtu: +mtu,
|
||||
mac,
|
||||
bondMode,
|
||||
})
|
||||
}
|
||||
@@ -70,7 +68,6 @@ createBonded.params = {
|
||||
},
|
||||
},
|
||||
mtu: { type: ['integer', 'string'], optional: true },
|
||||
mac: { type: 'string', optional: true },
|
||||
// RegExp since schema-inspector does not provide a param check based on an enumeration
|
||||
bondMode: {
|
||||
type: 'string',
|
||||
|
||||
@@ -2139,18 +2139,25 @@ export default class Xapi extends XapiBase {
|
||||
}
|
||||
|
||||
@deferrable
|
||||
async createBondedNetwork($defer, { bondMode, mac = '', pifIds, ...params }) {
|
||||
async createBondedNetwork(
|
||||
$defer,
|
||||
{ bondMode, pifIds: masterPifIds, ...params }
|
||||
) {
|
||||
const network = await this.createNetwork(params)
|
||||
$defer.onFailure(() => this.deleteNetwork(network))
|
||||
// TODO: test and confirm:
|
||||
// Bond.create is called here with PIFs from one host but XAPI should then replicate the
|
||||
// bond on each host in the same pool with the corresponding PIFs (ie same interface names?).
|
||||
await this.call(
|
||||
'Bond.create',
|
||||
network.$ref,
|
||||
map(pifIds, pifId => this.getObject(pifId).$ref),
|
||||
mac,
|
||||
bondMode
|
||||
|
||||
const pifsByHost = {}
|
||||
masterPifIds.forEach(pifId => {
|
||||
this.getObject(pifId).$network.$PIFs.forEach(pif => {
|
||||
if (pifsByHost[pif.host] === undefined) {
|
||||
pifsByHost[pif.host] = []
|
||||
}
|
||||
pifsByHost[pif.host].push(pif.$ref)
|
||||
})
|
||||
})
|
||||
|
||||
await asyncMap(pifsByHost, pifs =>
|
||||
this.call('Bond.create', network.$ref, pifs, '', bondMode)
|
||||
)
|
||||
|
||||
return network
|
||||
|
||||
Reference in New Issue
Block a user