bpg / terraform-provider-proxmox

Terraform Provider for Proxmox
https://registry.terraform.io/providers/bpg/proxmox
Mozilla Public License 2.0
757 stars 125 forks source link

Software Defined Network (SDN) #817

Open RihanArfan opened 8 months ago

RihanArfan commented 8 months ago

Proxmox has released their software defined network in 8.1. It'd be amazing if we can manage these through Terraform.

Msabljic commented 7 months ago

Maybe to make this not a huge task just focus on zone, vnet and subnet configuration stack!

bencurio commented 7 months ago

The pvesh command is quite usable from CLI:

Create Zone:

# ⚠️ Never use VxLAN over WAN! (It's unencrypted)
$ pvesh create /cluster/sdn/zones --type vxlan --zone promlan --peers 10.22.55.30,10.22.55.40 --ipam pve

$ pvesh get /cluster/sdn/zones/promlan --output-format yaml
---
digest: 5146d6cac2576423a9d42e3c096e3bec08a0d86a
peers: 10.22.55.30,10.22.55.40
type: vxlan
zone: promlan

Create VNet:

$ pvesh create /cluster/sdn/vnets --vnet promlan --zone promlan --tag 1

$ pvesh get /cluster/sdn/vnets/promlan --output-format yaml
---
digest: 943543359f9943dcdc26fc3c9d957a085700680b
tag: 1
type: vnet
vnet: promlan
zone: promlan

Create Subnet:

$ pvesh create /cluster/sdn/vnets/promlan/subnets --subnet 10.88.88.0/24 --type subnet --dhcp-range "start-address=10.88.88.100,end-address=10.88.88.200"

$ pvesh get /cluster/sdn/vnets/promlan/subnets --output-format yaml
---
- cidr: 10.88.88.0/24
  dhcp-range:
  - end-address: 10.88.88.254
    start-address: 10.88.88.2
  digest: 688e0800b83937ac39db62a9ecd602213a1597a3
  id: promlan-10.88.88.0-24
  mask: '24'
  network: 10.88.88.0
  subnet: promlan-10.88.88.0-24
  type: subnet
  vnet: promlan
  zone: promlan

Apply configuration

$ pvesh set /cluster/sdn
info: executing /usr/bin/dpkg -l ifupdown2
proxmox-1: reloading network config
info: executing /usr/bin/dpkg -l ifupdown2
proxmox-2: reloading network config
info: executing /usr/bin/dpkg -l ifupdown2
UPID:proxmox-1:00003755:0006151B:65C37D39:reloadnetworkall::root@pam:

Related API Docs: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/cluster/sdn

bitchecker commented 1 month ago

Hi, any news on this? I was just opening a Feature Request for this.

bpg commented 1 month ago

No progress on this yet.