[pve-devel] [PATCH v3 pve-manager 4/4] add sdn gui

Alexandre DERUMIER aderumier at odiso.com
Wed Nov 27 09:16:15 CET 2019


>>You added quite a lot already, nice! The origin of the DC -> SDN section seems 
>>to be the permission one, at least judging from the icons :P 

Yes, I'm totally lacking of ideas for icons ;)


If I try to create a zone I get: 
> create sdn zone object failed: error with cfs lock 'file-sdn_zones_cfg_new': unable to open file '/etc/pve/sdn/zones.cfg.new.tmp.863023' - No such file or directory 

>>We need to setup the (empty) /etc/pve/sdn directory to "fix" that, there's 
>>a method in cluster somewhere where all those get created on pmxcfs start. 

I'll look at this, thanks.


>>Also lacking permissions are not shown, i.e., I forgot to build access-control 
>>with the new SDN.* permissions and while I could create a zone, I just saw 
>>an empty list (the developer view then made me notice the 500 errors I got) 
>>but that's probably irrelevant and bikeshedding at this point.. 

I'll verify if It's not missing some api permissions.


>>I'm a bit reluctant to add the Webinterface integration now as is, I'd first 
>>also make it optional (i.e., hidden if pve-network is not installed - I can 
>>see if I can implement this). Then I'd be great to have some (or at least one 
>>^^) HowTo's, written for people with limited experience with this, to get them 
>>to a simple/basic but functional setup, using this interface. I know, I know, 
>>a lot to ask :) But I think this will really help people to use it. 

Yes, the GUI is really a POC, it's still need some cleanup.

I'll like to display changes between .new && current config for example.
Also it's missing the integration on vm/ct to choose the vnet on nic interface, disabling tag value in vm/ct form if a vnet if choose,...
(and maybe integration in qemu/ct script for tap|veth plug/unplug)

It's also missing the uplink-id value in local network interfaces form.

I think indeed, it could be great to hide the gui (maybe with a special permission ?).
I known 3-4 users to test it.


And of course write documentation, network schemas for each implementation (vlan, qinq, evpn, ...)
and for evpn, I'll write some debug documentation.



They are some parts of code I'll like to cleanup (ideas are welcome), like:

PVE/Network/SDN/Zones.pm

175 sub status {

 189         # fixme : use some kind of versioning info?
 190         my $cluster_vnet_timestamp = (stat($cluster_vnet_file))[9];
 191         my $cluster_zone_timestamp = (stat($cluster_zone_file))[9];
 192         my $local_sdn_timestamp = (stat($local_sdn_file))[9];
 193 
 194         if ($local_sdn_timestamp < $cluster_vnet_timestamp || $local_sdn_timestamp < $cluster_zone_timestamp) {
 195             $err_config = "local sdn network configuration is too old, please reload";
 196             warn $err_config;
 197         }
 198     }


PVE/API2/Network/SDN.pm
  68 my $create_reload_network_worker = sub {
  69     my ($nodename) = @_;
  70 
  71     #fixme: how to proxy to final node ?
  72     my $upid = PVE::Tools::run_command(['pvesh', 'set', "/nodes/$nodename/network"]);
  73     #my $upid = PVE::API2::Network->reload_network_config(node => $nodename});
  74     my $res = PVE::Tools::upid_decode($upid);
  75 
  76     return $res->{pid};
  77 };


Thanks Again for the review

Alexandre

----- Mail original -----
De: "Thomas Lamprecht" <t.lamprecht at proxmox.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>, "aderumier" <aderumier at odiso.com>
Envoyé: Mardi 26 Novembre 2019 17:54:25
Objet: Re: [pve-devel] [PATCH v3 pve-manager 4/4] add sdn gui

On 11/26/19 3:20 PM, Alexandre Derumier wrote: 
> --- 
> www/manager6/Makefile | 17 +++ 
> www/manager6/Makefile.rej | 9 ++ 
> www/manager6/StateProvider.js | 4 +- 
> www/manager6/Utils.js | 70 +++++++++ 
> www/manager6/Workspace.js | 1 + 
> www/manager6/dc/Config.js | 33 +++++ 
> www/manager6/dc/PoolEdit.js | 13 +- 
> www/manager6/form/SDNControllerSelector.js | 52 +++++++ 
> www/manager6/form/SDNZoneSelector.js | 52 +++++++ 
> www/manager6/sdn/Browser.js | 49 +++++++ 
> www/manager6/sdn/ControllerView.js | 146 +++++++++++++++++++ 
> www/manager6/sdn/Status.js | 36 +++++ 
> www/manager6/sdn/StatusView.js | 98 +++++++++++++ 
> www/manager6/sdn/VnetEdit.js | 143 ++++++++++++++++++ 
> www/manager6/sdn/VnetView.js | 159 +++++++++++++++++++++ 
> www/manager6/sdn/ZoneContentView.js | 105 ++++++++++++++ 
> www/manager6/sdn/ZoneView.js | 158 ++++++++++++++++++++ 
> www/manager6/sdn/controllers/Base.js | 73 ++++++++++ 
> www/manager6/sdn/controllers/EvpnEdit.js | 55 +++++++ 
> www/manager6/sdn/zones/Base.js | 73 ++++++++++ 
> www/manager6/sdn/zones/EvpnEdit.js | 64 +++++++++ 
> www/manager6/sdn/zones/QinQEdit.js | 63 ++++++++ 
> www/manager6/sdn/zones/VlanEdit.js | 49 +++++++ 
> www/manager6/sdn/zones/VxlanEdit.js | 106 ++++++++++++++ 
> www/manager6/tree/ResourceTree.js | 4 + 
> 25 files changed, 1630 insertions(+), 2 deletions(-) 
> create mode 100644 www/manager6/Makefile.rej 
> create mode 100644 www/manager6/form/SDNControllerSelector.js 
> create mode 100644 www/manager6/form/SDNZoneSelector.js 
> create mode 100644 www/manager6/sdn/Browser.js 
> create mode 100644 www/manager6/sdn/ControllerView.js 
> create mode 100644 www/manager6/sdn/Status.js 
> create mode 100644 www/manager6/sdn/StatusView.js 
> create mode 100644 www/manager6/sdn/VnetEdit.js 
> create mode 100644 www/manager6/sdn/VnetView.js 
> create mode 100644 www/manager6/sdn/ZoneContentView.js 
> create mode 100644 www/manager6/sdn/ZoneView.js 
> create mode 100644 www/manager6/sdn/controllers/Base.js 
> create mode 100644 www/manager6/sdn/controllers/EvpnEdit.js 
> create mode 100644 www/manager6/sdn/zones/Base.js 
> create mode 100644 www/manager6/sdn/zones/EvpnEdit.js 
> create mode 100644 www/manager6/sdn/zones/QinQEdit.js 
> create mode 100644 www/manager6/sdn/zones/VlanEdit.js 
> create mode 100644 www/manager6/sdn/zones/VxlanEdit.js 
> 


You added quite a lot already, nice! The origin of the DC -> SDN section seems 
to be the permission one, at least judging from the icons :P 

If I try to create a zone I get: 
> create sdn zone object failed: error with cfs lock 'file-sdn_zones_cfg_new': unable to open file '/etc/pve/sdn/zones.cfg.new.tmp.863023' - No such file or directory 

We need to setup the (empty) /etc/pve/sdn directory to "fix" that, there's 
a method in cluster somewhere where all those get created on pmxcfs start. 

Also lacking permissions are not shown, i.e., I forgot to build access-control 
with the new SDN.* permissions and while I could create a zone, I just saw 
an empty list (the developer view then made me notice the 500 errors I got) 
but that's probably irrelevant and bikeshedding at this point.. 

I'm a bit reluctant to add the Webinterface integration now as is, I'd first 
also make it optional (i.e., hidden if pve-network is not installed - I can 
see if I can implement this). Then I'd be great to have some (or at least one 
^^) HowTo's, written for people with limited experience with this, to get them 
to a simple/basic but functional setup, using this interface. I know, I know, 
a lot to ask :) But I think this will really help people to use it. 




More information about the pve-devel mailing list