summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2015-01-15 18:30:48 +0000
committerSteven Hardy <shardy@redhat.com>2015-02-24 09:20:41 +0000
commit6945fe5afdc12574fe00ad440319b7873f818e84 (patch)
tree69a85a7e8e933cda10afae4435ea2ebb6af8f918 /etc
parente9791d7db9bae2a19367ec69c8b0083c6aa089a4 (diff)
Add mapping option to influence nicN mapping order
Currently there's a fixed mapping between abstracted interface names (nic1, nic2 etc) and the underlying biosdevname for the device. In many cases, this mapping based on system enumeration is sufficient, but in some cases, particularly when you perform detailed pre-deployment discovery of interfaces, you may wish to alter the mapping independently of the config (e.g if the config is in a heat template, and the discovery data is provided at runtime). So this adds a -m option to os-net-config, which enables a mapping file to be provided, such that specific interfaces may be mapped to their abstract names based on knowledge of the devices or the networks they are connected to. The mapping file has the following format, where em1 and em2 are device names as detected by the OS (e.g biosdevname): interface_mapping: nic1: em2 nic2: em1 Or you can use the device MAC instead: interface_mapping: nic1: 12:34:56:78:9a:bc nic2: 12:34:56:de:f0:12 Change-Id: I93e6d3ed733244834bb3c2126c91db705b4d9167
Diffstat (limited to 'etc')
-rw-r--r--etc/os-net-config/samples/bond_mapped.yaml23
-rw-r--r--etc/os-net-config/samples/mapping.yaml8
2 files changed, 31 insertions, 0 deletions
diff --git a/etc/os-net-config/samples/bond_mapped.yaml b/etc/os-net-config/samples/bond_mapped.yaml
new file mode 100644
index 0000000..9a118c9
--- /dev/null
+++ b/etc/os-net-config/samples/bond_mapped.yaml
@@ -0,0 +1,23 @@
+# Example showing use of the optional nicN abstraction
+# for device naming, which defaults to an ordered
+# translation to biodev names based on which interfaces
+# are active on the system.
+# Optionally the default mapping may be overriden by
+# a mapping file via the -m option.
+network_config:
+ -
+ type: ovs_bridge
+ name: br-ctlplane
+ use_dhcp: true
+ members:
+ -
+ type: ovs_bond
+ name: bond1
+ use_dhcp: true
+ members:
+ -
+ type: interface
+ name: nic1
+ -
+ type: interface
+ name: nic2
diff --git a/etc/os-net-config/samples/mapping.yaml b/etc/os-net-config/samples/mapping.yaml
new file mode 100644
index 0000000..5faec22
--- /dev/null
+++ b/etc/os-net-config/samples/mapping.yaml
@@ -0,0 +1,8 @@
+# This can be used with the -m option to override the
+# default mapping of the nicN aliases in configs
+# The mapping can specify either a device name or a mac address
+interface_mapping:
+ nic1: em3
+ nic2: em1
+ nic3: 12:34:56:de:f0:12
+ nic4: 12:34:56:78:9a:bc