public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI
@ 2022-10-17 13:56 Daniel Tschlatscher
  2022-10-17 13:56 ` [pve-devel] [PATCH manager 2/2] gui: reorder with advanced section Daniel Tschlatscher
  2022-10-19  5:49 ` [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Tschlatscher @ 2022-10-17 13:56 UTC (permalink / raw)
  To: pve-devel

The option to set the mtu parameter for lxc containers already exists
in the backend. It only had to be exposed in the web UI as well.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
---
 www/manager6/lxc/Network.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index 7b6437c5..d6a35a49 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -138,6 +138,14 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
 		name: 'firewall',
 		value: cdata.firewall,
 	    },
+	    {
+		xtype: 'proxmoxintegerfield',
+		fieldLabel: gettext('MTU'),
+		name: 'mtu',
+		value: cdata.mtu,
+		minValue: 64,
+		maxValue: 65535,
+	    },
 	];
 
 	let dhcp4 = cdata.ip === 'dhcp';
@@ -519,6 +527,11 @@ Ext.define('PVE.lxc.NetworkView', {
 			}
 		    },
 		},
+		{
+		    header: gettext('MTU'),
+		    width: 80,
+		    dataIndex: 'mtu',
+		},
 	    ],
 	    listeners: {
 		activate: me.load,
@@ -543,6 +556,7 @@ Ext.define('PVE.lxc.NetworkView', {
 	    'gw6',
 	    'tag',
 	    'firewall',
+	    'mtu',
 	],
     });
 });
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH manager 2/2] gui: reorder with advanced section
  2022-10-17 13:56 [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI Daniel Tschlatscher
@ 2022-10-17 13:56 ` Daniel Tschlatscher
  2022-10-19  5:49 ` [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Tschlatscher @ 2022-10-17 13:56 UTC (permalink / raw)
  To: pve-devel

The new MTU field and the rate limit field are now in the advanced
section of the NetworkInputPanel to parallel the layout of the
NetworkEdit for VMs.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
---

While the layout now is the same as in the VM NetworkEdit, I just feel
like the advanced column does not create such a nice UI flow here.
Therefore, I included this as an optional patch, as it still has some
merit, but may be dropped if deemed unnecessary.

 www/manager6/lxc/Network.js | 42 +++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index d6a35a49..e9c32334 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -122,30 +122,12 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
 		name: 'tag',
 		value: cdata.tag,
 	    },
-	    {
-		xtype: 'numberfield',
-		name: 'rate',
-		fieldLabel: gettext('Rate limit') + ' (MB/s)',
-		minValue: 0,
-		maxValue: 10*1024,
-		value: cdata.rate,
-		emptyText: 'unlimited',
-		allowBlank: true,
-	    },
 	    {
 		xtype: 'proxmoxcheckbox',
 		fieldLabel: gettext('Firewall'),
 		name: 'firewall',
 		value: cdata.firewall,
 	    },
-	    {
-		xtype: 'proxmoxintegerfield',
-		fieldLabel: gettext('MTU'),
-		name: 'mtu',
-		value: cdata.mtu,
-		minValue: 64,
-		maxValue: 65535,
-	    },
 	];
 
 	let dhcp4 = cdata.ip === 'dhcp';
@@ -290,6 +272,30 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
 	    },
 	];
 
+	me.advancedColumn1 = [
+	    {
+		xtype: 'proxmoxintegerfield',
+		fieldLabel: gettext('MTU'),
+		name: 'mtu',
+		value: cdata.mtu,
+		minValue: 64,
+		maxValue: 65535,
+	    },
+	];
+
+	me.advancedColumn2 = [
+	    {
+		xtype: 'numberfield',
+		name: 'rate',
+		fieldLabel: gettext('Rate limit') + ' (MB/s)',
+		minValue: 0,
+		maxValue: 10*1024,
+		value: cdata.rate,
+		emptyText: 'unlimited',
+		allowBlank: true,
+	    },
+	];
+
 	me.callParent();
     },
 });
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI
  2022-10-17 13:56 [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI Daniel Tschlatscher
  2022-10-17 13:56 ` [pve-devel] [PATCH manager 2/2] gui: reorder with advanced section Daniel Tschlatscher
@ 2022-10-19  5:49 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2022-10-19  5:49 UTC (permalink / raw)
  To: Proxmox VE development discussion, Daniel Tschlatscher

the implementation looks mostly OK and works, but some comments on limits and
also a workflow nit that require a v2

high level: The CT implementation currently doesn't checks limits like
qemu-server does, like setting (most of the time) bogus values <576 (see below)
and guaranteed not working values like > $bridge_mtu.

So I'd also add the overall limit of 2^16-1 there as upper limit in the schema
and also assert <= $bridge_mtu on CT-start/veth-hotplug and possibly also on
config change (to early catch it for stopped CTs already, as IMO its better to
push the user towards setting the bridge MTU earlier than the ones of its
connected ports.

work flow nit: why bother adding this to the non advanced section only to move
it immediately? I'd directly add it to advancedColumn1, if you want to move out
rate limit field before or after is 

Am 17/10/2022 um 15:56 schrieb Daniel Tschlatscher:> The option to set the mtu parameter for lxc containers already exists
> in the backend. It only had to be exposed in the web UI as well.
> 
> Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
> ---
>  www/manager6/lxc/Network.js | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
> index 7b6437c5..d6a35a49 100644
> --- a/www/manager6/lxc/Network.js
> +++ b/www/manager6/lxc/Network.js
> @@ -138,6 +138,14 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
>  		name: 'firewall',
>  		value: cdata.firewall,
>  	    },
> +	    {
> +		xtype: 'proxmoxintegerfield',
> +		fieldLabel: gettext('MTU'),

wouldn't gettext that, this is a technical abbreviation that is known widely
enough to be language agnostic.

> +		name: 'mtu',
> +		value: cdata.mtu,
needs an emptyText with the default behavior if not set, something like:
"Same as Bridge" 

> +		minValue: 64,

IP requires that hosts must be able to process IP datagrams of at least 576
bytes (for IPv4) or 1280 bytes (for IPv6).

And while yes, one may use something different than IP for sending ethernet
link stuff it seems rather unlikely in practice, so maybe go for 576 as min, if
someone complains we can still lower that and then have an actual known use
case.

The backend can stay at 64 for now, as there we would need to wait for the next
major release with a check for < 576 added to the pve7to8 upgrade helper
script, as long as the frontend is restrictive from the beginning I think there
won't be many cases that run into this check though.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-19  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 13:56 [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI Daniel Tschlatscher
2022-10-17 13:56 ` [pve-devel] [PATCH manager 2/2] gui: reorder with advanced section Daniel Tschlatscher
2022-10-19  5:49 ` [pve-devel] [PATCH manager 1/2] fix #3719: gui: expose MTU option for containers in web UI Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal