pve-network.git
5 weeks agod/compat: bump level to 11 and fix lintian warnings master
Thomas Lamprecht [Wed, 10 Jul 2019 15:53:17 +0000 (17:53 +0200)]
d/compat: bump level to 11 and fix lintian warnings

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agobuildsys: use dpkg-dev makefile helpers for pkg info
Thomas Lamprecht [Wed, 10 Jul 2019 15:52:49 +0000 (17:52 +0200)]
buildsys: use dpkg-dev makefile helpers for pkg info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agobump version to 0.2-1
Thomas Lamprecht [Tue, 18 Jun 2019 08:20:23 +0000 (10:20 +0200)]
bump version to 0.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agobuildsys: clean also old build directories when running make clean
Thomas Lamprecht [Tue, 18 Jun 2019 08:21:18 +0000 (10:21 +0200)]
buildsys: clean also old build directories when running make clean

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 weeks agorename $network to $sdn everywhere
Alexandre Derumier [Mon, 17 Jun 2019 09:26:36 +0000 (11:26 +0200)]
rename $network to $sdn everywhere

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
8 weeks agoapi: add missing additional properties=0 on network reload/revert
Alexandre Derumier [Mon, 17 Jun 2019 09:26:35 +0000 (11:26 +0200)]
api: add missing additional properties=0 on network reload/revert

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
8 weeks agoadd pve-network-id jsonschema
Alexandre Derumier [Mon, 17 Jun 2019 09:26:34 +0000 (11:26 +0200)]
add pve-network-id jsonschema

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agod/control: depend on defined ${perl:Depends}
Thomas Lamprecht [Wed, 12 Jun 2019 05:04:16 +0000 (07:04 +0200)]
d/control: depend on defined ${perl:Depends}

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agorename PVE::Network::Network to PVE::Network::SDN
Alexandre Derumier [Fri, 7 Jun 2019 04:52:13 +0000 (06:52 +0200)]
rename PVE::Network::Network to PVE::Network::SDN

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agoremove vnet bridge delete hook
Alexandre Derumier [Fri, 7 Jun 2019 04:52:12 +0000 (06:52 +0200)]
remove vnet bridge delete hook

We can check that in local reload when we'll generate config

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agovxlan interface : use vxlan$vnetid
Alexandre Derumier [Thu, 6 Jun 2019 12:16:56 +0000 (14:16 +0200)]
vxlan interface : use vxlan$vnetid

vxlan number can be huge (16millions), don't use tag for interface name.
(my last ifupdown2 patch ifdown/ifup vxlan interface on reload)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agovlan plug: code cleanup
Thomas Lamprecht [Thu, 6 Jun 2019 06:28:41 +0000 (08:28 +0200)]
vlan plug: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agocleanup status sub
Alexandre Derumier [Thu, 6 Jun 2019 06:20:14 +0000 (08:20 +0200)]
cleanup status sub

don't mix stderr and stdout of the ifquery command, as it can break
JSON encoding afterweards

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agovxlanmulticast : fix mtu
Alexandre Derumier [Thu, 6 Jun 2019 06:20:13 +0000 (08:20 +0200)]
vxlanmulticast : fix mtu

vxlan mtu must be 50bytes lower than physdev mtu

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agoplugins: generate config: don't check vlan range
Alexandre Derumier [Tue, 4 Jun 2019 05:03:43 +0000 (07:03 +0200)]
plugins: generate config: don't check vlan range

we already have done it on create/modify hooks

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agogenerateconfig test: remove verify merge config
Alexandre Derumier [Tue, 4 Jun 2019 05:03:42 +0000 (07:03 +0200)]
generateconfig test: remove verify merge config

we can check conflict with ifquery now

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agogenerateconfig: use uplink$id if interface don't exist
Alexandre Derumier [Tue, 4 Jun 2019 05:03:41 +0000 (07:03 +0200)]
generateconfig: use uplink$id if interface don't exist

don't die, generate config, and we'll check error
with ifquery as interface don't exist

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agovxlan: use vxlan<id> interface name
Alexandre Derumier [Tue, 4 Jun 2019 05:03:40 +0000 (07:03 +0200)]
vxlan: use vxlan<id> interface name

we can't change online vxlan tag,
better to map interface name to vxlan tag.
(ifreload with delete old interface, and create a new with correct vxlan)

also vxlan-id are unique

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 months agod/control: fix priority-extra-is-replaced-by-priority-optional
Thomas Lamprecht [Tue, 4 Jun 2019 04:38:11 +0000 (06:38 +0200)]
d/control: fix priority-extra-is-replaced-by-priority-optional

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agofollowup code cleanup
Thomas Lamprecht [Tue, 4 Jun 2019 04:35:12 +0000 (06:35 +0200)]
followup code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoimport run_command
Thomas Lamprecht [Tue, 4 Jun 2019 04:35:00 +0000 (06:35 +0200)]
import run_command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoadd test statuscheck.pl
Alexandre Derumier [Mon, 3 Jun 2019 15:57:39 +0000 (17:57 +0200)]
add test statuscheck.pl

could be reuse later in pvestatd to broadcast status.

2 months agoadd ifquery compare status
Alexandre Derumier [Mon, 3 Jun 2019 15:57:38 +0000 (17:57 +0200)]
add ifquery compare status

2 months agocreate api: test if $scfg vnet exist
Alexandre Derumier [Mon, 3 Jun 2019 15:57:37 +0000 (17:57 +0200)]
create api: test if $scfg vnet exist

3 months agoapi: add apply and revert cluster network configuration
Alexandre Derumier [Mon, 6 May 2019 12:47:14 +0000 (14:47 +0200)]
api: add apply and revert cluster network configuration

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agowrite configuration to networks.cfg.new
Alexandre Derumier [Mon, 6 May 2019 12:47:13 +0000 (14:47 +0200)]
write configuration to networks.cfg.new

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agovlan, vxlan plugin : add on_delete_hook
Alexandre Derumier [Mon, 6 May 2019 12:47:12 +0000 (14:47 +0200)]
vlan, vxlan plugin : add on_delete_hook

verify that a vnet is not using this transport

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agovxlanmultuicast: on_update_hook: check vnet tag in allowed vxlan
Alexandre Derumier [Fri, 3 May 2019 09:00:20 +0000 (11:00 +0200)]
vxlanmultuicast: on_update_hook: check vnet tag in allowed vxlan

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agovlan: on_update_hook: check vnet tag in allowed vlan
Alexandre Derumier [Fri, 3 May 2019 09:00:19 +0000 (11:00 +0200)]
vlan: on_update_hook: check vnet tag in allowed vlan

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agoapi2: update_hook: also verify transport associated to vnet
Alexandre Derumier [Fri, 3 May 2019 09:00:18 +0000 (11:00 +0200)]
api2: update_hook: also verify transport associated to vnet

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agovnet: update_hook: verify if tag already exist in another vnet
Alexandre Derumier [Fri, 3 May 2019 09:00:17 +0000 (11:00 +0200)]
vnet: update_hook: verify if tag already exist in another vnet

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agovnet: rename read_local_vm_config to read_cluster_vm_config
Alexandre Derumier [Fri, 3 May 2019 09:00:16 +0000 (11:00 +0200)]
vnet: rename read_local_vm_config to read_cluster_vm_config

and remove "next if !$d->{node}"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agovnet: dynamic require of qemuserver && lxc
Alexandre Derumier [Fri, 3 May 2019 09:00:15 +0000 (11:00 +0200)]
vnet: dynamic require of qemuserver && lxc

like for firewall, to avoid dependency loop

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
3 months agovxlanmulticast: add mtu to vxlan interface too.
Alexandre Derumier [Fri, 3 May 2019 09:00:14 +0000 (11:00 +0200)]
vxlanmulticast: add mtu to vxlan interface too.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agovnetplugin: on_delete_hook : verify if vnet exist in vm && ct
Alexandre Derumier [Thu, 4 Apr 2019 14:12:45 +0000 (16:12 +0200)]
vnetplugin: on_delete_hook : verify if vnet exist in vm && ct

4 months agorename vnet "name" option to "alias"
Alexandre Derumier [Thu, 4 Apr 2019 14:12:44 +0000 (16:12 +0200)]
rename vnet "name" option to "alias"

and use it with ifupdown2 alias.

4 months agoadd on_update_hook
Alexandre Derumier [Thu, 4 Apr 2019 08:18:35 +0000 (10:18 +0200)]
add on_update_hook

do nothing for now

4 months agoadd on_delete_hook
Alexandre Derumier [Thu, 4 Apr 2019 08:18:34 +0000 (10:18 +0200)]
add on_delete_hook

empty for now

4 months agovlanplugin : make uplink-id non optional
Alexandre Derumier [Thu, 4 Apr 2019 08:18:33 +0000 (10:18 +0200)]
vlanplugin : make uplink-id non optional

4 months agovxlanmulticast plugin : make uplink-id && multicast addres non optional
Alexandre Derumier [Thu, 4 Apr 2019 08:18:32 +0000 (10:18 +0200)]
vxlanmulticast plugin : make uplink-id && multicast addres non optional

4 months agovnetplugin: make tag && transportzone non optional
Alexandre Derumier [Thu, 4 Apr 2019 08:18:31 +0000 (10:18 +0200)]
vnetplugin: make tag && transportzone non optional

4 months agoadd missing Network.pm
Alexandre Derumier [Thu, 4 Apr 2019 07:14:22 +0000 (09:14 +0200)]
add missing Network.pm

forgot to add them in last patches

4 months agofix generateconfig.pl test
Alexandre Derumier [Wed, 3 Apr 2019 15:27:29 +0000 (17:27 +0200)]
fix generateconfig.pl test

4 months agomerge Transport && Vnet to PVE::Network::Network
Alexandre Derumier [Wed, 3 Apr 2019 13:36:07 +0000 (15:36 +0200)]
merge Transport && Vnet to PVE::Network::Network

config is now merged in /etc/pve/networks.cfg
Vnet is a Plugin

4 months agoapi2: add networkconfig
Alexandre Derumier [Tue, 2 Apr 2019 22:19:11 +0000 (00:19 +0200)]
api2: add networkconfig

/cluster/network/vnet
/cluster/network/transport

4 months agomove transport plugins to Network/Transport/
Alexandre Derumier [Tue, 2 Apr 2019 22:19:10 +0000 (00:19 +0200)]
move transport plugins to Network/Transport/

4 months agoadd vnet api
Alexandre Derumier [Tue, 2 Apr 2019 22:19:09 +0000 (00:19 +0200)]
add vnet api

also for now, use classic sectionconfig format

vnet: vnet1
        ipv4 10.0.0.1
        ipv6 2a03:2880:f003:c07:face:b00c::2
        mtu 1500
        tag 2

vnet: vnet2
        ipv6 2a03:2880:f003:c07:face:b00c::2
        name network2
        tag 3
        transportzone vlanzone1

4 months agoadd network transport api
Alexandre Derumier [Tue, 2 Apr 2019 10:09:10 +0000 (12:09 +0200)]
add network transport api

4 months agovlanplugin : fix vlan-aware option
Alexandre Derumier [Tue, 2 Apr 2019 10:09:09 +0000 (12:09 +0200)]
vlanplugin : fix vlan-aware option

4 months agoremove $interfaces arg from generate_network_config
Alexandre Derumier [Thu, 28 Mar 2019 23:23:52 +0000 (00:23 +0100)]
remove $interfaces arg from generate_network_config

and remove verification of existing vlan interface in VlanPlugin.
(we do all verifications later reusing INotify read/write interfaces)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agogenerateconfig: print config before test
Alexandre Derumier [Thu, 28 Mar 2019 23:23:51 +0000 (00:23 +0100)]
generateconfig: print config before test

easier to debug if verification fail after

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agovlanplugin: define vlan interface and fix vlan-protocol
Alexandre Derumier [Thu, 28 Mar 2019 23:23:50 +0000 (00:23 +0100)]
vlanplugin: define vlan interface and fix vlan-protocol

vlan-protocol is on vlan interface, better to always define it

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agofix copyright data
Dietmar Maurer [Thu, 28 Mar 2019 11:21:01 +0000 (12:21 +0100)]
fix copyright data

4 months agoget version from changelog
Dietmar Maurer [Thu, 28 Mar 2019 11:14:16 +0000 (12:14 +0100)]
get version from changelog

4 months agoPVE/Network/Makefile: fix installation path
Dietmar Maurer [Thu, 28 Mar 2019 11:12:24 +0000 (12:12 +0100)]
PVE/Network/Makefile: fix installation path

4 months agoset package version to 0.1-1
Dietmar Maurer [Thu, 28 Mar 2019 10:55:20 +0000 (11:55 +0100)]
set package version to 0.1-1

This is experimental code.

4 months agoadd a sample test to generate config
Alexandre Derumier [Wed, 27 Mar 2019 17:24:10 +0000 (18:24 +0100)]
add a sample test to generate config

generate /etc/network/interfaces.d/vnet

reloading is not yet implemented

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agoadd vnet
Alexandre Derumier [Wed, 27 Mar 2019 17:24:09 +0000 (18:24 +0100)]
add vnet

This allow to define bridges with a tag (can be vxlan or vlan tag),
and use configuration from transportzone

/etc/pve/network/vnet.cfg

vnet1:
      tag 2
      transportzone vlanzone1
      name network1
      ipv4 10.0.0.1
      ipv6 2a03:2880:f003:c07:face:b00c::2
      mtu 1500

vnet2:
      transportzone vlanzone1
      tag 3
      name network2
      ipv6 2a03:2880:f003:c07:face:b00c::2

vnet3:
      transportzone vxlanmulticastzone1
      tag 100000
      name network3
      mtu 1400

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agoadd vxlan multicast plugin
Alexandre Derumier [Wed, 27 Mar 2019 17:24:08 +0000 (18:24 +0100)]
add vxlan multicast plugin

/etc/pve/network/transports.cfg

vxlanmulticast: vxlanmulticastzone1
                uplink-id 1
                multicast-address 225.20.21.1
                vxlan-allowed 4-5

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agoadd vlan plugin
Alexandre Derumier [Wed, 27 Mar 2019 17:24:07 +0000 (18:24 +0100)]
add vlan plugin

/etc/pve/network/transports.cfg

vlan: vlanzone1
      uplink-id 1
      vlan-aware 1
      vlan-allowed 2-4,6,10
      vlan-protocol 802.1ad

vlan: vlanzone2
      uplink-id 2
      vlan-aware 1

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agoadd transport plugin infrastructure
Alexandre Derumier [Wed, 27 Mar 2019 17:24:06 +0000 (18:24 +0100)]
add transport plugin infrastructure

used to generate network configuration for differents kind of plugins (vlan,vxlan....)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 months agoinitial package commit
Alexandre Derumier [Wed, 27 Mar 2019 17:24:05 +0000 (18:24 +0100)]
initial package commit

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>