Commit f99b3b96 authored by Dietmar Maurer's avatar Dietmar Maurer

add support to change bond_xmit_hash_policy on linux bond devices

parent 2f414196
......@@ -81,6 +81,12 @@ my $confdesc = {
optional => 1,
type => 'string', enum => $bond_mode_enum,
},
bond_xmit_hash_policy => {
description => "Selects the transmit hash policy to use for slave selection in balance-xor and 802.3ad modes.",
optional => 1,
type => 'string',
enum => ['layer2', 'layer2+3', 'layer3+4' ],
},
gateway => {
description => 'Default gateway address.',
type => 'string', format => 'ipv4',
......
......@@ -20,7 +20,7 @@ Ext.define('PVE.form.BondModeSelector', {
['active-backup', 'active-backup'],
['balance-xor', 'balance-xor'],
['broadcast', 'broadcast'],
['802.3ad', 'LACP (layer2)'],
['802.3ad', 'LACP (802.3ad)'],
['balance-tlb', 'balance-tlb'],
['balance-alb', 'balance-alb']
];
......@@ -29,3 +29,20 @@ Ext.define('PVE.form.BondModeSelector', {
me.callParent();
}
});
Ext.define('PVE.form.BondPolicySelector', {
extend: 'PVE.form.KVComboBox',
alias: ['widget.bondPolicySelector'],
initComponent: function() {
var me = this;
me.data = [
['layer2', 'layer2'],
['layer2+3', 'layer2+3'],
['layer3+4', 'layer3+4']
];
me.callParent();
}
});
......@@ -90,13 +90,35 @@ Ext.define('PVE.node.NetworkEdit', {
fieldLabel: gettext('Slaves'),
name: 'slaves'
});
var policySelector = Ext.createWidget('bondPolicySelector', {
fieldLabel: gettext('Hash policy'),
name: 'bond_xmit_hash_policy',
deleteEmpty: !me.create,
disabled: true
});
column2.push({
xtype: 'bondModeSelector',
fieldLabel: gettext('Mode'),
name: 'bond_mode',
value: me.create ? 'balance-rr' : undefined,
listeners: {
change: function(f, value) {
if (value === 'balance-xor' ||
value === '802.3ad') {
policySelector.setDisabled(false);
} else {
policySelector.setDisabled(true);
policySelector.setValue('');
}
}
},
allowBlank: false
});
column2.push(policySelector);
} else if (me.iftype === 'OVSBond') {
column2.push({
xtype: me.create ? 'PVE.form.BridgeSelector' : 'displayfield',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment