Compare commits

...

4 Commits

Author SHA1 Message Date
b-Nollet
f9e894ea73 minimum MTU value for network creation 2024-02-21 12:28:02 +01:00
Pizzosaure
608bee442f Changelog entry added 2024-02-21 11:20:32 +01:00
Pizzosaure
d9011bd467 front modifications 2024-02-21 11:20:32 +01:00
b-Nollet
398f3da58a feat(xo-server): change MTU 2024-02-21 11:20:21 +01:00
3 changed files with 25 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
- Disable search engine indexing via a `robots.txt`
- [Stats] Support format used by XAPI 23.31
- [Pool/Network] Ability to edit MTU [#7039](https://github.com/vatesfr/xen-orchestra/issues/7039) (PR [#7393](https://github.com/vatesfr/xen-orchestra/pull/7393))
### Bug fixes
@@ -17,6 +18,7 @@
- [Settings/XO Config] Sort backups from newest to oldest
- [Plugins/audit] Don't log `tag.getAllConfigured` calls
- [Remotes] Correctly clear error when the remote is tested with success
- [Pool/Network] Don't allow MTU values that are too small to work (<68)
### Packages to release
@@ -40,6 +42,6 @@
- vhd-lib patch
- xo-server minor
- xo-server-audit patch
- xo-web patch
- xo-web minor
<!--packages-end-->

View File

@@ -1,5 +1,7 @@
import xapiObjectToXo from '../xapi-object-to-xo.mjs'
const RFC_MINIMUM_MTU = 68 // see RFC 791
export function getBondModes() {
return ['balance-slb', 'active-backup', 'lacp']
}
@@ -26,7 +28,7 @@ create.params = {
nbd: { type: 'boolean', optional: true },
description: { type: 'string', minLength: 0, optional: true },
pif: { type: 'string', optional: true },
mtu: { type: 'integer', optional: true },
mtu: { type: 'integer', optional: true, minimum: RFC_MINIMUM_MTU },
vlan: { type: 'integer', optional: true },
}
@@ -56,7 +58,7 @@ createBonded.params = {
type: 'string',
},
},
mtu: { type: 'integer', optional: true },
mtu: { type: 'integer', optional: true, minimum: RFC_MINIMUM_MTU },
bondMode: { enum: getBondModes() },
}
@@ -72,6 +74,7 @@ export async function set({
automatic,
defaultIsLocked,
mtu,
name_description: nameDescription,
name_label: nameLabel,
nbd,
@@ -81,6 +84,7 @@ export async function set({
await Promise.all([
automatic !== undefined && network.update_other_config('automatic', automatic ? 'true' : null),
defaultIsLocked !== undefined && network.set_default_locking_mode(defaultIsLocked ? 'disabled' : 'unlocked'),
mtu !== undefined && network.set_MTU(mtu),
nameDescription !== undefined && network.set_name_description(nameDescription),
nameLabel !== undefined && network.set_name_label(nameLabel),
nbd !== undefined &&
@@ -103,6 +107,11 @@ set.params = {
id: {
type: 'string',
},
mtu: {
type: 'integer',
minimum: RFC_MINIMUM_MTU,
optional: true,
},
name_description: {
type: 'string',
minLength: 0,

View File

@@ -84,6 +84,16 @@ class Description extends Component {
// -----------------------------------------------------------------------------
class Mtu extends Component {
_editMtu = value => editNetwork(this.props.network, { mtu: value })
render() {
const { network } = this.props
return <Number value={network.MTU} onChange={this._editMtu} />
}
}
@connectStore(() => ({
defaultPif: _createGetDefaultPif(),
}))
@@ -330,7 +340,7 @@ const NETWORKS_COLUMNS = [
},
{
name: _('poolNetworkMTU'),
itemRenderer: network => network.MTU,
itemRenderer: network => <Mtu network={network} />,
},
{