From 1d3f868206e4c909029ab2e7ae3f6cf71e8a0b51 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 17 Jun 2019 23:41:07 -0400 Subject: [PATCH] Unify network devices and addresses in config The old way of doing this was a little cumbersome, with an upper YAML tree split between "devices" (name and MTU) and addresses. This commit unifies these under the root "networking" section to make this section clearer. --- node-daemon/pvcd.sample.yaml | 52 +++++++++++++++++------------------- node-daemon/pvcd/Daemon.py | 18 ++++++------- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/node-daemon/pvcd.sample.yaml b/node-daemon/pvcd.sample.yaml index cb51485f..d8ffb835 100644 --- a/node-daemon/pvcd.sample.yaml +++ b/node-daemon/pvcd.sample.yaml @@ -124,31 +124,27 @@ pvc: # networking: PVC networking configuration # OPTIONAL if enable_networking: False networking: - # devices: Interface devices configuration - devices: - # upstream: Upstream physical interface device - upstream: - # name: Upstream interface name - name: ens4 - # mtu: Upstream interface MTU; use 9000 for jumbo frames (requires switch support) - mtu: 1500 - # cluster: Cluster (VNIC) physical interface device - cluster: - # name: Cluster (VNIC) interface name - name: ens4 - # mtu: Cluster (VNIC) interface MTU; use 9000 for jumbo frames (requires switch support) - mtu: 1500 - # storage: Storage (Ceph OSD) physical interface device - storage: - # name: Storace (Ceph OSD) interface name - name: ens4 - # mtu: Storage (Ceph OSD) interface MTU; use 9000 for jumbo frames (requires switch support) - mtu: 1500 - # addresses: Special network addresses; by-id denotes "address octet equals host number", e.g. .3 for host3 - addresses: - # upstream: Network address for upstream network, options: None, by-id, / - upstream: None - # cluster: Network address for cluster network, options: by-id, / - cluster: by-id - # storage: Network address for storage network, options: by-id, / - storage: by-id + # upstream: Upstream physical interface device + upstream: + # name: Upstream interface name + name: ens4 + # mtu: Upstream interface MTU; use 9000 for jumbo frames (requires switch support) + mtu: 1500 + # address: Network address for upstream network, options: None, by-id, / + address: None + # cluster: Cluster (VNIC) physical interface device + cluster: + # name: Cluster (VNIC) interface name + name: ens4 + # mtu: Cluster (VNIC) interface MTU; use 9000 for jumbo frames (requires switch support) + mtu: 1500 + # address: Network address for cluster network, options: by-id, / + address: by-id + # storage: Storage (Ceph OSD) physical interface device + storage: + # name: Storace (Ceph OSD) interface name + name: ens4 + # mtu: Storage (Ceph OSD) interface MTU; use 9000 for jumbo frames (requires switch support) + mtu: 1500 + # address: Network address for storage network, options: by-id, / + address: by-id diff --git a/node-daemon/pvcd/Daemon.py b/node-daemon/pvcd/Daemon.py index 31569799..ef38fe74 100644 --- a/node-daemon/pvcd/Daemon.py +++ b/node-daemon/pvcd/Daemon.py @@ -179,15 +179,15 @@ def readConfig(pvcd_config_file, myhostname): 'pdns_postgresql_dbname': o_config['pvc']['coordinator']['dns']['database']['name'], 'pdns_postgresql_user': o_config['pvc']['coordinator']['dns']['database']['user'], 'pdns_postgresql_password': o_config['pvc']['coordinator']['dns']['database']['pass'], - 'vni_dev': o_config['pvc']['system']['configuration']['networking']['devices']['cluster']['name'], - 'vni_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['cluster']['mtu'], - 'vni_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['cluster'], - 'storage_dev': o_config['pvc']['system']['configuration']['networking']['devices']['storage']['name'], - 'storage_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['storage']['mtu'], - 'storage_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['storage'], - 'upstream_dev': o_config['pvc']['system']['configuration']['networking']['devices']['upstream']['name'], - 'upstream_mtu': o_config['pvc']['system']['configuration']['networking']['devices']['upstream']['mtu'], - 'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['addresses']['upstream'], + 'vni_dev': o_config['pvc']['system']['configuration']['networking']['cluster']['name'], + 'vni_mtu': o_config['pvc']['system']['configuration']['networking']['cluster']['mtu'], + 'vni_dev_ip': o_config['pvc']['system']['configuration']['networking']['cluster']['address'], + 'storage_dev': o_config['pvc']['system']['configuration']['networking']['storage']['name'], + 'storage_mtu': o_config['pvc']['system']['configuration']['networking']['storage']['mtu'], + 'storage_dev_ip': o_config['pvc']['system']['configuration']['networking']['storage']['address'], + 'upstream_dev': o_config['pvc']['system']['configuration']['networking']['upstream']['name'], + 'upstream_mtu': o_config['pvc']['system']['configuration']['networking']['upstream']['mtu'], + 'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['upstream']['address'], } except Exception as e: print('ERROR: {}!'.format(e))