Skip to content

Commit 9e4be5e

Browse files
committed
Merge pull request #199 from sharady/tagged-vlan-v2
Update network_db for VLAN info needed for Upgrade
2 parents 220f806 + 7ee6a5a commit 9e4be5e

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

xapi/design/management-interface-on-vlan.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ status: proposed
77
revision_history:
88
- revision_number: 1
99
description: Initial version
10+
- revision_number: 2
11+
description: Addition of `networkd_db` update for Upgrade
1012
---
1113

1214
This document describes design details for the
@@ -17,7 +19,8 @@ XAPI and XCP-Networkd
1719

1820
### Creating a VLAN
1921

20-
Steps for a user to create a VLAN via CLI.
22+
Creating a VLAN is already there, Lisiting the steps to create a VLAN which is used later in the document.
23+
Steps:
2124

2225
1. Check the PIFs created on a Host for physical devices `eth0`, `eth1`.
2326
`xe pif-list params=uuid physical=true host-uuid=UUID` this will list `pif-UUID`
@@ -29,15 +32,19 @@ Steps for a user to create a VLAN via CLI.
2932
It returns a new VLAN PIF `new-pif-UUID`
3033
4. Plug the VLAN PIF.
3134
`xe pif-plug uuid=new-pif-UUID`
32-
We can configure IP on this new PIF via `pif-reconfigure-ip` call with possible `DHCP` or `STATIC` mode.
35+
5. Configure IP on the VLAN PIF.
36+
`xe pif-reconfigure-ip uuid=new-pif-UUID mode= IP= netmask= gateway= DNS= `
37+
This will configure IP on the PIF, here `mode` is must and other parametrs are needed on selecting mode=static
38+
3339
Similarly, creating a vlan pif can be achieved by corresponding XenAPI calls.
3440

3541
Recognise VLAN config from management.conf
3642
----------------------------------------------
3743

3844
For a newly installed host, If host installer was asked to put the management interface on given VLAN.
3945
We will expect a new entry `VLAN=ID` under `/etc/firstboot.d/data/management.conf`.
40-
Current contents of management.conf:
46+
47+
Listing current contents of management.conf which will be used later in the document.
4148
`LABEL`=`eth0` -> Represents Pyhsical device on which Management Interface must reside.
4249
`MODE`=`dhcp`||`static` -> Represents IP configuration mode for the Management Interface. There can be other parameters like IP, NETMASK, GATEWAY and DNS when we have `static` mode.
4350
`VLAN`=`ID` -> New entry for specifying VLAN TAG going to be configured on device `LABEL`.
@@ -58,7 +65,7 @@ Steps to be followed:
5865

5966
### XCP-Networkd need to recognise VLAN config during startup
6067

61-
XCP-Networkd on startup get the initial network setup from the `management.conf` and `xensource-inventory` file to update the network.db for management interface info.
68+
XCP-Networkd during first boot and boot after pool eject gets the initial network setup from the `management.conf` and `xensource-inventory` file to update the network.db for management interface info.
6269
XCP-Networkd must honour the new VLAN config.
6370

6471
Steps to be followed:
@@ -69,6 +76,17 @@ Steps to be followed:
6976
4. `bridge_name` is taken as `MANAGEMENT_INTERFACE` from xensource-inventory, further `bridge_config` and `interface_config` are build based on MODE.
7077
5. Call `Bridge.make_config()` and `Interface.make_config()` are performed with respective `bridge_config` and `interface_config`.
7178

79+
Updating networkd_db program
80+
----------------------------
81+
82+
`networkd_db` provides the management interface info to the host installer during upgrade.
83+
It reads `/var/lib/xcp/networkd.db` file to output the Management Interface information. Here we need to update the networkd_db to handle the VLAN information.
84+
85+
Steps to be followed:
86+
87+
1. Update the bridge info to provide `port.interfaces` for the management VLAN as well.
88+
2, Update the iface info to provide `ipv4_conf` or `ipv6_conf` with `dhcp` or `static` mode.
89+
7290
Additional VLAN parameter for Emergency Network Reset
7391
-----------------------------------------------------
7492

@@ -84,6 +102,8 @@ Steps to be followed:
84102
2. Write the `bridge=xapi0` into xensource-inventory file, This should work as Xapi check avialable bridges while creating networks.
85103
3. Write the `VLAN=vlanID` into `management.conf` and `/tmp/network-reset`.
86104
4. Modify `check_network_reset` under xapi.ml to perform steps `Creating a VLAN` and perform `management_reconfigure` on vlan pif.
105+
Step `Creating a VLAN` must have created the VLAN record in Xapi DB similar to firstboot script.
106+
5. If no VLANID is specified then retain the current one, This utility must take the management interface info from `networkd_db` program and handle the VLAN config.
87107

88108
### VLAN parameter addition to xsconsole Emergency Network Reset
89109

@@ -125,9 +145,14 @@ Steps to be followed:
125145
New API for Pool Management Reconfigure
126146
---------------------------------------
127147

148+
Currently there is no Pool Level API to reconfigure management_interface for all of the Hosts in a Pool at once.
149+
API `Pool.management_reconfigure` will be needed in order to reconfigure `manamegemnt_interface` on all hosts in a Pool to the same Network either VLAN or Physical.
150+
151+
128152
### Current behaviour to change the Management Interface on Host
129153

130-
Currently call `Host.management_reconfigure` with VLAN pif-uuid can change the management_interface on specified VLAN.
154+
Currently call `Host.management_reconfigure` with VLAN pif-uuid can change the management_interface to specified VLAN.
155+
Listing the steps to understand the workflow of `management_interface` reconfigure. We will be using `Host.management_reconfigure` call inside the new API.
131156

132157
Steps performed during management_reconfigure:
133158

@@ -140,16 +165,19 @@ Steps performed during management_reconfigure:
140165

141166
### Management Reconfigure on Pool from Physical Network to VLAN Network or from VLAN Network to Other VLAN Network or from VLAN Network to Physical Network
142167

168+
Listing steps to be performed manually on each Host or Pool as a prerequisite to use the New API.
143169
We need to make sure that new network which is going to be a management interface has PIFs configured on each Host.
144170
In case of pyhsical network we will assume pifs are configured on each host, In case of vlan network we need to create vlan pifs on each Host.
145171
We would assume that VLAN is available on the switch/network.
146172

147-
Steps to be performed before calling new API:
173+
Manual steps to be performed before calling new API:
148174

149175
1. Create a vlan network on pool via `network.create`, In case of pyhsical NICs network must be present.
150176
2. Create a vlan pif on each host via `VLAN.create` using above network ref, physical PIF ref and vlanID, Not needed in case of pyhsical network.
151-
3. Plug the vlan pif on each host via `PIF.plug` using above vlan pif. This might be needed in case pyhsical network.
152-
4. Perform `PIF.reconfigure_ip` for each new Network PIF on each Host.
177+
Or An Alternate call `pool.create_VLAN` providing `device` and above `network` will create vlan PIFs for all hosts in a pool.
178+
3. Perform `PIF.reconfigure_ip` for each new Network PIF on each Host.
179+
180+
If User wishes to change the management interface manually on each Host in a Pool, We should allow it, There will be a guideline for that:
153181

154182
User can individually change management interface on each host calling `Host.management_reconfigure` using pifs on physical devices or vlan pifs.
155183
This must be perfomed on slaves first and lastly on Master, As changing management_interface on master will disconnect slaves from master then further calls `Host.management_reconfigure` cannot be performed till master recover slaves via call `pool.recover_slaves`.
@@ -159,10 +187,10 @@ This must be perfomed on slaves first and lastly on Master, As changing manageme
159187
- `Pool.management_reconfigure`
160188
- Parameter: network reference `network`.
161189
- Calling this function configures `management_interface` on each host of a pool.
162-
- For the `network` provided it will check pifs are attached on each Host,
163-
In case of VLAN network it will check vlan pifs on provided network are attached on each Host of Pool.
164-
- Check IP is configured on pif attached to each Host.
165-
- If PIFs are not attached or IP is not configured on PIFs this call must fail gracefully, Asking user to configure them.
190+
- For the `network` provided it will check pifs are present on each Host,
191+
In case of VLAN network it will check vlan pifs on provided network are present on each Host of Pool.
192+
- Check IP is configured on above pifs on each Host.
193+
- If PIFs are not present or IP is not configured on PIFs this call must fail gracefully, Asking user to configure them.
166194
- Call `Host.management_reconfigure` on each slave then lastly on master.
167195
- Call `pool.recover_slaves` on master inorder to recover slaves which might have lost the connection to master.
168196

0 commit comments

Comments
 (0)