-add subs for local network config generation
-add code and api for transport/vnet local status



Here a sample of command with pvesh to manage the sdn.


#create a transportzone
pvesh create /cluster/sdn/ --sdn myzone --type vlan --uplink-id 1

#create a vnet in the transportzone
pvesh create /cluster/sdn/ --sdn myvnet --type vnet --transportzone myzone 
--tag 10


#apply changes from /etc/pve/sdn.cfg.new to /etc/pve/sdn.cfg
pvesh set /cluster/sdn




#generate local /etc/network/interfaces.d/sdn  and reload  (need to be called 
on each node)
 pvesh set /nodes/<node>/network


display transporzone status on all cluster nodes
#pvesh get /cluster/resources    
┌────────────────────────────────────┬─────────┬───────┬───────────┬─────────┬───────┬────────┬─────────────┬────────────┬────────────┬───────────────┬──────┬───────────┬──────────────┬────────────────┐
│ id                                 │ type    │   cpu │ disk      │ hastate │ 
level │ maxcpu │     maxdisk │     maxmem │ mem        │ node          │ pool │ 
status    │ storage      │         uptime │
│ sdn/node1/transportzone10          │ sdn     │       │           │         │  
     │        │             │            │            │ kvmformation1 │      │ 
error     │              │                │
├────────────────────────────────────┼─────────┼───────┼───────────┼─────────┼───────┼────────┼─────────────┼────────────┼────────────┼───────────────┼──────┼───────────┼──────────────┼────────────────┤
│ sdn/node1/zone1                    │ sdn     │       │           │         │  
     │        │             │            │            │ node1         │      │ 
available │              │                │
├────────────────────────────────────┼─────────┼───────┼───────────┼─────────┼───────┼────────┼─────────────┼────────────┼────────────┼───────────────┼──────┼───────────┼──────────────┼────────────────┤
│ sdn/node1/zone4                    │ sdn     │       │           │         │  
     │        │             │            │            │ node1         │      │ 
available │              │                │
├────────────────────────────────────┼─────────┼───────┼───────────┼─────────┼───────┼────────┼─────────────┼────────────┼────────────┼───────────────┼──────┼───────────┼──────────────┼────────────────┤




#list all transport zones of a node

pvesh get /nodes/<node>/sdn/
    ┌─────────────────┬───────────┐
    │ sdn             │ status    │
    ├─────────────────┼───────────┤
    │ transportzone10 │ error     │
    ├─────────────────┼───────────┤
    │ zone1           │ available │
    ├─────────────────┼───────────┤
    │ zone4           │ available │
    └─────────────────┴───────────┘


#list all vnet status from a node transportzone

pveset get /nodes/<node>/sdn/<transportzone>/content
    
    ┌─────────┬────────┐
    │ vnet    │ status │
    ├─────────┼────────┤
    │ vnet100 │ error  │
    ├─────────┼────────┤
    │ vnet101 │ error  │
    └─────────┴────────┘


Alexandre Derumier (4):
  add generate_etc_network_config && write_etc_network_config subs
  add new status sub and move code from test
  api2: add local endpoint for listing content of a transportzone
  api2: add local endpoint for listing transportzones status

 PVE/API2/Network/Makefile       |   2 +
 PVE/API2/Network/SDN/Content.pm |  80 +++++++++++++++++++
 PVE/API2/Network/SDN/Makefile   |   8 ++
 PVE/API2/Network/SDN/Status.pm  | 110 +++++++++++++++++++++++++++
 PVE/Network/SDN.pm              | 131 +++++++++++++++++++++++++++++++-
 test/generateconfig.pl          |  81 +-------------------
 test/statuscheck.pl             |  37 +--------
 7 files changed, 334 insertions(+), 115 deletions(-)
 create mode 100644 PVE/API2/Network/SDN/Content.pm
 create mode 100644 PVE/API2/Network/SDN/Makefile
 create mode 100644 PVE/API2/Network/SDN/Status.pm

-- 
2.20.1

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to