From 6945fe5afdc12574fe00ad440319b7873f818e84 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 15 Jan 2015 18:30:48 +0000 Subject: 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 --- etc/os-net-config/samples/bond_mapped.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 etc/os-net-config/samples/bond_mapped.yaml (limited to 'etc/os-net-config/samples/bond_mapped.yaml') 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 -- cgit 1.2.3-korg