[Openstack] [Fuel] changing assigned VLANs after install

Alexander Liemieshko aliemieshko at mirantis.com
Mon Jul 27 15:39:16 UTC 2015


Hello, the guide below details how you can change assigned VLANs after
install:


Changing VLAN on (post-deployment environment) on Fuel 6.1 (Ubuntu)

Note: Before performing any operations, you should schedule the maintenance
window, perform backups of all databases

Preparation: in the worst case your new VLANs, you are going to use to run
OpenStack networks through, may be already reserved as tenant VLANs in
Neutron. Please re-configure Neutron and re-create affected tenant networks
 first in order to free up the needed VLANs to host machines.

1. Modify DB nailgun(on master node) :

(first of all you have to create backup DB nailgun)

dockerctl shell postgres

su - postgres

pg_dump nailgun > nailgun_back.sql


Vlan_range for Neutorn L2 Configuration:

Note: For example, we are changing: vlan_range='[1700, 1730]' ,

vlan_start='104' for Storage, vlan_start='103' for Management

dockerctl shell postgres

su - postgres

psql -d nailgun

nailgun=# select * from neutron_config ;

id | vlan_range | gre_id_range | base_mac | internal_cidr |
internal_gateway | ...

...

3 | [1000, 1030] | [2, 65535] | fa:16:3e:00:00:00 | 192.168.111.0/24 |
192.168.111.1 | vlan | ovs

(1 row)

nailgun=# update neutron_config set vlan_range='[1700, 1730]' where id=3;

UPDATE 1

nailgun=# select * from neutron_config;

id | vlan_range | gre_id_range | base_mac | internal_cidr |
internal_gateway | ...

...

3 | [1700, 1730] | [2, 65535] | fa:16:3e:00:00:00 | 192.168.111.0/24 |
192.168.111.1 | vlan | ovs

(1 row)

Vlan for Management:

nailgun=# select * from network_groups;

id | name | release | vlan_start | cidr ...

…

11 | management | 2 | 101 | 192.168.0.0/24 |

…

nailgun=# update network_groups set vlan_start='103' where id=11;

UPDATE 1

nailgun=# select * from network_groups;

id | name | release | vlan_start | cidr ...

…

11 | management | 2 | 103 | 192.168.0.0/24 |

…

Vlan for Storage:

nailgun=# select * from network_groups;

id | name | release | vlan_start | cidr ...

…

12 | storage | 2 | 102 | 192.168.1.0/24 |

…

nailgun=# update network_groups set vlan_start='104' where id=12;

UPDATE 1

nailgun=# select * from network_groups;

id | name | release | vlan_start | cidr ...

…

12 | storage | 2 | 104 | 192.168.1.0/24 |

…

All changes you can to see on Fuel UI → Networks:

-- Before

-- After


2. Modify 'ml2_conf.ini' (on all nodes in environment):

(Note: run on master node)

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/neutron/plugins/ml2 && sed -i
"s/^network_vlan_ranges.*/network_vlan_ranges=physnet2:1700:1730/"
ml2_conf.ini';done

Reboot neutron-server on all controllers :

# for i in $(fuel nodes --env <env_ID> | awk
'/ready.*controller.*True/{print $1}'); do ssh node-$i initctl restart
neutron-server;done

3. Modify astute.yaml (on all nodes in environment):

(Note: run on master node)

Change 'vlan_range' and 'vlans':

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && sed -i "s/vlan_range.*/vlan_range: 1700:1730/"
astute.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk
'/ready.*controller.*True/{print $1}'); do ssh node-$i 'cd /etc/ && sed -i
"s/vlan_range.*/vlan_range: 1700:1730/" primary-controller.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && sed -i "s/vlans: 1000:1030/vlans: 1700:1730/"
astute.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk
'/ready.*controller.*True/{print $1}'); do ssh node-$i 'cd /etc/ && sed -i
"s/vlans: 1000:1030/vlans: 1700:1730/" primary-controller.yaml';done

Change 'vlans' for 'br-storage' and 'br-mgmt':

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && sed -i "s/vlans: 102/vlans: 104/" astute.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk
'/ready.*controller.*True/{print $1}'); do ssh node-$i 'cd /etc/ && sed -i
"s/vlans: 102/vlans: 104/" primary-controller.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && sed -i "s/vlans: 101/vlans: 103/" astute.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk
'/ready.*controller.*True/{print $1}'); do ssh node-$i 'cd /etc/ && sed -i
"s/vlans: 101/vlans: 103/" primary-controller.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && sed -i "s/eth0.101/eth0.103/" astute.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk
'/ready.*controller.*True/{print $1}'); do ssh node-$i 'cd /etc/ && sed -i
"s/eth0.101/eth0.103/" primary-controller.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && sed -i "s/eth0.102/eth0.104/" astute.yaml';done

# for i in $(fuel nodes --env <env_ID> | awk
'/ready.*controller.*True/{print $1}'); do ssh node-$i 'cd /etc/ && sed -i
"s/eth0.102/eth0.104/" primary-controller.yaml';done

Check:

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && cat astute.yaml |grep vlans';done

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && cat astute.yaml |grep vlan_range';done

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'cd /etc/ && cat astute.yaml |grep eth';done

Remove 'globals.yaml':

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'rm -fv /etc/hiera/globals.yaml ';done

Check:

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'ls -l /etc/hiera ';done

Create new 'globals.yaml':

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'nohup puppet apply -d
/etc/puppet/modules/osnailyfacter/modular/globals/globals.pp 2>&1 | tee
/root/puppet_globals_reconfigure.log';done


Check:

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*True/{print $1}'); do
ssh node-$i 'ls -l /etc/hiera ';done


4. Change 'vlan' for networks 'storage' and 'management'

(Note: first on all controller nodes )

Enabling Pacemaker maintenance mode:

(Note: run on one of the controller node)

# crm configure property maintenance-mode=true


On all controller nodes

Disable an Network Interface:

(in our example interfaces eth0.101 and eth0.102)

# ifconfig eth0.101 down

# ifconfig eth0.102 down

Remove old config files for 'eth0.101' and 'eth0.102':

# rm -vf /etc/network/interfaces.d/ifcfg-eth0.101

# rm -vf /etc/network/interfaces.d/ifcfg-eth0.102

Run puppet manifest for configure network with new parameters:

# nohup puppet apply -d
/etc/puppet/modules/osnailyfacter/modular/netconfig/netconfig.pp 2>&1 | tee
/root/puppet_network_reconfigure.log

Delete old sub-interfaces for 'br-mgmt' and 'br-storage':

# brctl show

# brctl delif br-mgmt eth0.101

# brctl delif br-storage eth0.102


Disable services 'neutron-plugin-openvswitch-agent ' and 'nova-compute':

(Note: run on master node)

# for i in $(fuel nodes --env <env_ID> | awk '/ready.*compute.*True/{print
$1}'); do ssh node-$i 'initctl stop neutron-plugin-openvswitch-agent &&
initctl stop nova-compute';done

On all computes nodes

Disable an Network Interface:

(in our example interfaces eth0.101 and eth0.102)

# ifconfig eth0.101 down

# ifconfig eth0.102 down

Remove old config files for 'eth0.101' and 'eth0.102':

# rm -vf /etc/network/interfaces.d/ifcfg-eth0.101

# rm -vf /etc/network/interfaces.d/ifcfg-eth0.102

Run puppet manifest for configure network with new parameters:

# nohup puppet apply -d
/etc/puppet/modules/osnailyfacter/modular/netconfig/netconfig.pp 2>&1 | tee
/root/puppet_network_reconfigure.log

Delete old subinterfaces for 'br-mgmt' and 'br-storage':

# brctl show

# brctl delif br-mgmt eth0.101

# brctl delif br-storage eth0.102

Disable maintenance mode:

(Note: run on one of the controller node)

# crm configure property maintenance-mode=false

Note: You need to wait from a 1 up to 20 minutes.

Enable services 'neutron-plugin-openvswitch-agent ' and 'nova-compute':

(Note: run on master node)

for i in $(fuel nodes --env <env_ID> | awk '/ready.*compute.*True/{print
$1}'); do ssh node-$i 'initctl start neutron-plugin-openvswitch-agent &&
initctl start nova-compute';done


Note: Now If you add new nodes(from UI or CLI) they will be with new
network settings


-- 
Kind Regards,
Alexander Liemieshko
L2 Support engineer
Fuel Core Team | Mirantis Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20150727/d62ac910/attachment.html>


More information about the Openstack mailing list