Skip to content

Commit 3b94a2d

Browse files
Merge pull request #204 from enovance/fc/vlan
Implement issue #86: Allow configuring an interface on a tagged VLAN
2 parents 30bce59 + 4f7117a commit 3b94a2d

File tree

2 files changed

+42
-30
lines changed

2 files changed

+42
-30
lines changed

build/init.common

+10-2
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ get_network_configuration() {
503503
other="dhcp"
504504
for entry in $IP; do
505505
iface_name=$(echo $entry | cut -d ":" -f 1)
506-
iface_config=$(echo $entry | cut -d ":" -f 2)
506+
iface_config=$(echo $entry | cut -d ":" -f 2-)
507507
if [ "$iface_name" = "$searched_iface" ] || [ "$iface_name" = "all" ]; then
508508
echo -n $iface_config
509509
return
@@ -554,6 +554,14 @@ while true; do
554554
lldptool set-lldp -i $iface adminstatus=rxtx &>/dev/null
555555
# Let's run all the dhclients in parallel
556556
config=$(get_network_configuration $iface)
557+
# Check if $config contains vlan parameters
558+
if [[ ${config} =~ .@. ]]; then
559+
vlan=$(echo ${config} | cut -d@ -f 2)
560+
config=$(echo ${config} | cut -d@ -f 1)
561+
vlan_iface=${iface}.${vlan}
562+
ip link add link ${iface} name ${vlan_iface} type vlan id ${vlan}
563+
iface=${vlan_iface}
564+
fi
557565
case "$config" in
558566
"dhcp")
559567
DHCP_IFACES_COUNT=$(($DHCP_IFACES_COUNT + 1))
@@ -563,7 +571,7 @@ while true; do
563571
fi
564572
dhclient -d -pf /var/run/dhclient-$iface.pid $iface >> /$iface.log 2>&1 &
565573
count=$DHCP_GRACE_TIME
566-
while [ $count -gt 0 ] && ! ifconfig $iface|grep -q 'inet addr'; do
574+
while [ $count -gt 0 ] && ! ip addr show $iface|grep -q 'inet'; do
567575
sleep 1
568576
count=$(($count - 1))
569577
done

docs/eDeployUserGuide.rst

+32-28
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ chef. eDeploy only aims at providing a bootable operating system with
143143
all the required packages installed and the low-level setup done.
144144

145145
Once the configuration of the server is done, eDeploy will extract on
146-
its local disk an operating system, defined by the matching role, downloaded from an image server by using RSYNC or HTTP connexion.
146+
its local disk an operating system, defined by the matching role, downloaded from an image server by using RSYNC or HTTP connexion.
147147

148148
.. image:: images/image02.jpg
149149
:scale: 125%
@@ -725,12 +725,16 @@ To get an USB bootable setup, you need :
725725
to 'Defining the boot configuration' for complete description) shall
726726
be defined at build time while PXE booting can do it dynamically
727727

728-
- If a DHCP server exists you can get an automatic network address used
728+
- If a DHCP server exists you can get an automatic network address used
729729
during the deployment only
730730

731731
- If no DHCP server exists, use the IP= command to put a static address
732732
to one of your interface to contact the edeploy server like :
733-
IP=eth0:192.168.1.254/24,other=none
733+
IP=eth0:192.168.1.254/24,other:none
734+
735+
- It's also possible to ask to bind an interface to a specific vlan adding the
736+
'@' character followed by the VLAN id:
737+
IP=eth0:192.168.1.254/24@101,other:none
734738

735739
The USB bootstrap is built by using the 'img' role available in eDeploy.
736740
All required parameters shall be provided during the built process. A
@@ -751,7 +755,7 @@ If no PXE boot is available on the infrastructure, it is possible to use
751755
an USB based solution to start the eDeploy deployment tool on the server
752756
to be installed.
753757

754-
**Note**: This solution is not scalable and could be difficult to setup.
758+
**Note**: This solution is not scalable and could be difficult to setup.
755759
If multiple hosts shall be deploied, a single USB key shall be used
756760
generating a sequential deploiement (1 server at a time).
757761

@@ -1043,7 +1047,7 @@ It is mandatory that `/var/lib/debootstrap/install` directory is
10431047
available over an HTTP access so eDeploy client can retrieve the images.
10441048
Operating system images shall be available via
10451049
http://HSERV:HPORT/install url.
1046-
1050+
10471051
Creating Hardware profiles and assign them to roles
10481052
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10491053

@@ -1064,7 +1068,7 @@ ma tch all the rules written in this file. The default 'vm-debian.spec'
10641068
file looks like this :
10651069

10661070
.. code:: bash
1067-
1071+
10681072
[
10691073
('disk', '$disk', 'size', 'gt(4)'),
10701074
('network', '$eth', 'ipv4', 'network(192.168.122.0/24)'),
@@ -1312,18 +1316,18 @@ They respect the same filesystem as the operating system. (ie.
13121316
Installation scenario:
13131317

13141318
1. Server sends hw.py to eDeploy and get back a configure script
1315-
1319+
13161320
2. Server runs the configure script
13171321

13181322
- create partition table
13191323
- create filesystem
13201324
- create `/post_rysnc/{etc/sysconfig/network,boot/grub,etc/fstab}`
1321-
1325+
13221326
3. Server syncs with eDeploy to retrieve the OS tree that matches its
13231327
role
13241328

13251329
4. `/post_rsync` files overwrite the OS tree configuration files
1326-
1330+
13271331
5. Bootloader is reinstalled
13281332

13291333
6. Server is rebooted
@@ -1556,7 +1560,7 @@ All the other variables, ip,netmask,gateway were only described in the
15561560
CMDB and were assigned by the eDeploy server at the hardware matching
15571561
time.
15581562

1559-
1563+
15601564
Setup the state file
15611565
~~~~~~~~~~~~~~~~~~~~
15621566

@@ -1566,7 +1570,7 @@ and the number of time it will provision them.
15661570
The file itself is an array of tuple. Each tuple represent the profile
15671571
eDeploy can provision and the number of time it is allowed to provision
15681572
it.
1569-
1573+
15701574
For example ('vm-debian', '3') means eDeploy can provision three VMs
15711575
with the profile 'vm-debian'.  Another example would be ('vm-centos',
15721576
'*'). which means eDeploy can provision an unlimited number of VMs with
@@ -1960,7 +1964,7 @@ this
19601964
administrator needs to make sure that running application won't break
19611965
(incompatibility, etc…) when a server is downgraded. This is not eDeploy
19621966
responsibility to take care of that sort of issues
1963-
1967+
19641968
Developing on eDeploy
19651969
=====================
19661970

@@ -2123,7 +2127,7 @@ slot Raw disk slot's id ('disk', '1I:1:1', 'slot', '
21232127
disk Detect disks Sample output
21242128
size Size of the disk ('disk', 'sda', 'size', '899') Medium
21252129
vendor Vendor of the disk ('disk', 'sda', 'vendor', 'HP') Medium
2126-
model Model of the disk ('disk', 'sda', 'model', 'LOGICAL VOLUME') High
2130+
model Model of the disk ('disk', 'sda', 'model', 'LOGICAL VOLUME') High
21272131
rev Firmware revision of the disk ('disk', 'sda', 'rev', '3.42') Medium
21282132
WCE Write Cache Enabled ('disk', 'sda', 'WCE', '1') Low
21292133
RCD Read Cache Disabled ('disk', 'sda', 'RCD, '1') Low
@@ -2147,10 +2151,10 @@ vendor Vendor name ('system', 'product', 'vendor', 'HP')
21472151
\* : if provided by the hardware manufacturer
21482152

21492153
========== ================================ ======================================= ==============
2150-
ipmi Detect IPMI interfaces Sample output Discrim. Level
2154+
ipmi Detect IPMI interfaces Sample output Discrim. Level
21512155
========== ================================ ======================================= ==============
2152-
ipmi The IPMI channel number ('system', 'ipmi', 'channel', 2) Low
2153-
ipmi-fake Fake IPMI interface for testing ('system', 'ipmi-fake', 'channel', '0') Low
2156+
ipmi The IPMI channel number ('system', 'ipmi', 'channel', 2) Low
2157+
ipmi-fake Fake IPMI interface for testing ('system', 'ipmi-fake', 'channel', '0') Low
21542158
========== ================================ ======================================= ==============
21552159

21562160
Firmware
@@ -2161,7 +2165,7 @@ host. These information are not always provided by the hardware
21612165
manufacturer.
21622166
21632167
========= ========================= =================================================== ===============
2164-
bios Detect BIOS informations Sample output Discrim. Level
2168+
bios Detect BIOS informations Sample output Discrim. Level
21652169
========= ========================= =================================================== ===============
21662170
version Version of the BIOS ('firmware', 'bios', 'version', 'G1ET73WW (2.09 )') Medium
21672171
date Date of the BIOS release ('firmware', 'bios', 'date', '10/19/2012') Medium
@@ -2174,12 +2178,12 @@ Network
21742178
================ ================================== ========================================================================= ===========
21752179
network NIC informations   sample output Discrim. Level
21762180
================ ================================== ========================================================================= ===========
2177-
serial Mac address ('network', 'eth0', 'serial', 'd8:9d:67:1b:07:e4') Unique
2178-
vendor NIC's vendor ('network', 'eth0', 'vendor', 'Broadcom Corporation') Low
2181+
serial Mac address ('network', 'eth0', 'serial', 'd8:9d:67:1b:07:e4') Unique
2182+
vendor NIC's vendor ('network', 'eth0', 'vendor', 'Broadcom Corporation') Low
21792183
product NIC's description ('network', 'eth0', 'product', 'NetXtreme BCM5719 Gigabit Ethernet PCIe') Medium
21802184
size Link capability in bits/sec ('network', 'eth0', 'size', '1000000000') Low
21812185
ipv4 IPv4 address ('network', 'eth0', 'ipv4', '10.66.6.136') High
2182-
ipv4-netmask IPv4 netmask ('network', 'eth0', 'ipv4-netmask', '255.255.255.0') Low
2186+
ipv4-netmask IPv4 netmask ('network', 'eth0', 'ipv4-netmask', '255.255.255.0') Low
21832187
ipv4-cidr IPv4 cidr ('network', 'eth0', 'ipv4-cidr', '24') Low
21842188
ipv4-network IPv4 network address ('network', 'eth0', 'ipv4-network', '10.66.6.0') Medium
21852189
link Physical Link Status ('network', 'eth0', 'link', 'yes') Medium
@@ -2204,7 +2208,7 @@ cores CPU's number of cores ('cpu', 'physical_0', 'cores',
22042208
enabled_cores CPU's number of enabled cores ('cpu', 'physical_0',' enabled_cores', '2') Medium
22052209
threads CPU's number of threads ('cpu', 'physical_0', 'threads', '4') Medium
22062210
product CPU's identification string ('cpu', 'physical_0', 'product', 'Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz') High
2207-
vendor CPU's vendor ('cpu', 'physical_0', 'vendor', 'Intel Corp.') Low
2211+
vendor CPU's vendor ('cpu', 'physical_0', 'vendor', 'Intel Corp.') Low
22082212
frequency CPU's internal frequency in Hz ('cpu', 'physical_0', 'frequency', '1200000000') Low
22092213
clock CPU's clock in Hz ('cpu', 'physical_0', 'clock', '100000000') Low
22102214
============== =============================== ============================================================================= ==============
@@ -2231,11 +2235,11 @@ memory Detect Memory informations Sample output
22312235
=========== ========================================= ======================================================================================== ==============
22322236
total Amount of memory on the host (in Bytes)   ('memory', 'total', 'size', '17179869184') High
22332237
size Bank size (in Bytes)   ('memory', 'bank:0', 'size', '4294967296') Medium
2234-
clock Memory clock speed (in Hz)   ('memory', 'bank:0', 'clock', '667000000') Low
2238+
clock Memory clock speed (in Hz)   ('memory', 'bank:0', 'clock', '667000000') Low
22352239
description Memory's description   ('memory', 'bank:0', 'description', 'FB-DIMM DDR2 FB-DIMM Synchronous 667 MHz (1.5 ns)') Medium
22362240
vendor Memory's vendor   ('memory', 'bank:0', 'vendor', 'Nanya Technology') Medium
22372241
serial Memory's serial number ('memory', 'bank:0', 'serial', 'C7590943') Unique\*
2238-
slot Physical Slot of this Bank   ('memory', 'bank:0', 'slot', 'DIMM1') High
2242+
slot Physical Slot of this Bank   ('memory', 'bank:0', 'slot', 'DIMM1') High
22392243
banks Number of memory banks   ('memory', 'banks', 'count', 8) Medium
22402244
=========== ========================================= ======================================================================================== ==============
22412245

@@ -2248,7 +2252,7 @@ Per card
22482252
^^^^^^^^
22492253

22502254
============ ============================== =========================================================== =========================
2251-
infiniband Detect Infiniband informations  sample output Discrim. Level
2255+
infiniband Detect Infiniband informations  sample output Discrim. Level
22522256
============ ============================== =========================================================== =========================
22532257
card_type IB card's type ('infiniband', 'card0', 'card_type', 'mlx4_0') Medium
22542258
device_type IB card's device type ('infiniband', 'card0', 'device_type', 'MT4099') Medium
@@ -2263,13 +2267,13 @@ Per port
22632267
^^^^^^^^
22642268

22652269
=============== ============================== ================================================================== ===============
2266-
infiniband Detect Infiniband informations  sample output Discrim. Level
2270+
infiniband Detect Infiniband informations  sample output Discrim. Level
22672271
=============== ============================== ================================================================== ===============
22682272
state Interface state ('infiniband', 'card0_port1', 'state', 'Down') High
22692273
physical_state Physical state of the link ('infiniband', 'card0_port1', 'physical_state', 'Down') High
22702274
rate Speed in Gbit/sec ('infiniband', 'card0_port1', 'rate', '40') High
2271-
base_lid ('infiniband', 'card0_port1', 'base_lid', '0' Low
2272-
lmc ('infiniband', 'card0_port1', 'lmc', '0') Low
2273-
sm_lid ('infiniband', 'card0_port1', 'sm_lid', '0') Low
2275+
base_lid ('infiniband', 'card0_port1', 'base_lid', '0' Low
2276+
lmc ('infiniband', 'card0_port1', 'lmc', '0') Low
2277+
sm_lid ('infiniband', 'card0_port1', 'sm_lid', '0') Low
22742278
port_guid ('infiniband', 'card0_port1', 'port_guid', '0x0002c90300ea7181') Unique
22752279
=============== ============================== ================================================================== ===============

0 commit comments

Comments
 (0)