Chapter 2.4: Configuration and Provisioning

Configuration to be performed in two places.

  • Configuration in opencontrail VM
  • configuration in compute VM

Configuration in opencontrail VM:

In the opencontrail VM below configurations are to be done,

Hosts file updation

Edit the /etc/hosts file and update the IP Address & hostname of opencontrail host and devstack host.

10.0.1.4 opencontrail
10.0.1.7 devstack1

ifmap-server configuration

/etc/ifmap-server/basicauthusers.properties

#OpenContrail users
api-server:api-server
schema-transformer:schema-transformer
svc-monitor:svc-monitor
10.0.1.4:10.0.1.4
10.0.1.4.dns:10.0.1.4.dns

Redis server configuration

/etc/redis/redis.conf

bind 0.0.0.0

cassandra server configuration

vi /etc/cassandra/cassandra.yaml

Modify the below sections.

under seed-provider section
- seeds: "10.0.1.4"
listen_address: 10.0.1.4
start_rpc: true
rpc_address: 10.0.1.4

opencontrail configuration files:

The preconfigured contrail configuration files are available in https://github.com/sureshkvl/contrail-install-doc/tree/master/config-files repository.

  • Copy the cofiguration files in to /etc/contrail folder

  • Edit the configuration file and update the below,

    • Modify the IP address of the opencontrail VM, hostname. Also update the keystone details in the conf files.

Update the vnc_api_lib.ini

This file is used by the vnc api library (consumed by contrail api, svc monitor and many more) to authenticate with keystone.

update this file with the keystone details

Restart the services:

Copy the Service management scripts from https://github.com/sureshkvl/contrail-install-doc/tree/master/manage-scripts repository to your local directory. This scripts are handy to start/stop the contrail services

Restart the dependencies services

cloud@opencontrail:~/manage-scripts$ ./contrail-dependencies.sh stop
Stopping redis-server: redis-server.
zookeeper stop/waiting
stop: Unknown instance: 
 * Stopping message broker rabbitmq-server
   ...done.
cassandra: unrecognized service
cloud@opencontrail:~/manage-scripts$ 

oud@opencontrail:~/manage-scripts$ ./contrail-dependencies.sh start
Starting redis-server: redis-server.
zookeeper start/running, process 5816
ifmap-server start/running, process 5828
 * Starting message broker rabbitmq-server                                                                                          [ OK ] 
cassandra: unrecognized service
cloud@opencontrail:~/manage-scripts$ 

cloud@opencontrail:~/manage-scripts$ ./contrail-dependencies.sh status
redis-server is running
zookeeper start/running, process 5816
ifmap-server start/running, process 6270
Status of node rabbit@opencontrail ...
[{pid,5924},
 {running_applications,[{rabbit,"RabbitMQ","3.2.4"},
                        {os_mon,"CPO  CXC 138 46","2.2.14"},
                        {mnesia,"MNESIA  CXC 138 12","4.11"},
                        {xmerl,"XML parser","1.3.5"},
                        {sasl,"SASL  CXC 138 11","2.3.4"},
                        {stdlib,"ERTS  CXC 138 10","1.19.4"},
                        {kernel,"ERTS  CXC 138 10","2.16.4"}]},
 {os,{unix,linux}},
 {erlang_version,"Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:2:2] [async-threads:30] [kernel-poll:true]\n"},
 {memory,[{total,43746256},
          {connection_procs,221256},
          {queue_procs,32304},
          {plugins,0},
          {other_proc,13604384},
          {mnesia,66048},
          {mgmt_db,0},
          {msg_index,23184},
          {other_ets,762184},
          {binary,7889472},
          {code,16514185},
          {atom,594537},
          {other_system,4038702}]},
 {vm_memory_high_watermark,0.4},
 {vm_memory_limit,3269604147},
 {disk_free_limit,50000000},
 {disk_free,48029241344},
 {file_descriptors,[{total_limit,924},
                    {total_used,6},
                    {sockets_limit,829},
                    {sockets_used,4}]},
 {processes,[{limit,1048576},{used,156}]},
 {run_queue,0},
 {uptime,9}]
...done.
cassandra: unrecognized service
cloud@opencontrail:~/manage-scripts$

Restart the contrail-config services

cloud@opencontrail:~/manage-scripts$ ./contrail-config.sh stop
contrail-discovery: stopped
contrail-api:0: stopped
contrail-schema: stopped
contrail-svc-monitor: stopped
contrail-device-manager: stopped
cloud@opencontrail:~/manage-scripts$ ./contrail-config.sh start
contrail-discovery: started
contrail-api:0: started
contrail-schema: started
contrail-svc-monitor: started
contrail-device-manager: started
cloud@opencontrail:~/manage-scripts$ ./contrail-config.sh status
contrail-discovery               RUNNING    pid 7929, uptime 0:00:11
contrail-api:0                   RUNNING    pid 7946, uptime 0:00:09
contrail-schema                  RUNNING    pid 7973, uptime 0:00:08
contrail-svc-monitor             RUNNING    pid 7985, uptime 0:00:07
contrail-device-manager          RUNNING    pid 7998, uptime 0:00:05
cloud@opencontrail:~/manage-scripts$

Restart the contrail-control services

cloud@opencontrail:~/manage-scripts$ ./contrail-control.sh stop
contrail-control: stopped
contrail-dns: stopped
contrail-named: stopped
cloud@opencontrail:~/manage-scripts$ ./contrail-control.sh start
contrail-control: started
contrail-dns: started
contrail-named: started
cloud@opencontrail:~/manage-scripts$ ./contrail-control.sh status
contrail-control                 RUNNING    pid 8077, uptime 0:00:24
contrail-dns                     RUNNING    pid 8090, uptime 0:00:19
contrail-named                   RUNNING    pid 8123, uptime 0:00:09
cloud@opencontrail:~/manage-scripts$

Restart the contrail-analytics services

cloud@opencontrail:~/manage-scripts$ ./contrail-analytics.sh stop
contrail-collector: stopped
contrail-query-engine: stopped
contrail-analytics-api: stopped
contrail-snmp-collector: stopped
contrail-topology: stopped
contrail-alarm-gen: stopped
cloud@opencontrail:~/manage-scripts$ ./contrail-analytics.sh start
contrail-collector: started
contrail-query-engine: started
contrail-analytics-api: started
contrail-snmp-collector: started
contrail-topology: started
contrail-alarm-gen: started
cloud@opencontrail:~/manage-scripts$ ./contrail-analytics.sh status
contrail-collector               RUNNING    pid 8461, uptime 0:00:35
contrail-query-engine            RUNNING    pid 8481, uptime 0:00:30
contrail-analytics-api           RUNNING    pid 8516, uptime 0:00:25
contrail-snmp-collector          RUNNING    pid 8532, uptime 0:00:19
contrail-topology                RUNNING    pid 8549, uptime 0:00:14
contrail-alarm-gen               RUNNING    pid 8567, uptime 0:00:08
cloud@opencontrail:~/manage-scripts$

Restart the contrail-webui status

cloud@opencontrail:~/contrail-install-doc/manage-scripts$ ./contrail-webui.sh stop
contrail-webui-webserver stop/waiting
contrail-webui-jobserver stop/waiting
cloud@opencontrail:~/contrail-install-doc/manage-scripts$ ./contrail-webui.sh start
contrail-webui-webserver start/running, process 28119
contrail-webui-jobserver start/running, process 28128
cloud@opencontrail:~/contrail-install-doc/manage-scripts$ ./contrail-webui.sh status
contrail-webui-webserver start/running, process 28119
contrail-webui-jobserver start/running, process 28128
cloud@opencontrail:~/contrail-install-doc/manage-scripts$

Configuration in Compute VM(Devstack VM)

In the devstack VM below configurations are to be done,

Hosts file updation

Edit the /etc/hosts file and update the IP Address & hostname of opencontrail host and devstack host.

10.0.1.4 opencontrail
10.0.1.7 devstack1

Configure the VRouter

Setting up the vhost interface

vhost interface needs to be setup in the compute(devstack). To setup

Download the script from here

https://github.com/sureshkvl/contrail-install-doc/blob/master/provisioning-scripts/vrouter_setup.sh

Before run this script, edit and enter correct values

VHOST_INTERFACE_NAME=eth0
VHOST_INTERFACE_CIDR=10.0.1.7/24
VHOST_INTERFACE_IP=10.0.1.7
DEFAULT_GW=10.0.1.1

CAUTION : if you specify the wrong IP, interface details, your VM will be gone. can not be accessible.

Run this script

./vrouter_setup.sh

This script creates a vhost interface.

cloud@devstack1:~/contrail-install-doc/manage-scripts$ ifconfig vhost0
vhost0    Link encap:Ethernet  HWaddr 02:82:7f:cb:b4:33  
          inet addr:10.0.1.7  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::82:7fff:fecb:b433/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38409006 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4763063 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3102782849 (3.1 GB)  TX bytes:1861119488 (1.8 GB)

cloud@devstack1:~/contrail-install-doc/manage-scripts$ ifconfig eth0  
eth0      Link encap:Ethernet  HWaddr 02:82:7f:cb:b4:33  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38751303 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4892817 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4239937996 (4.2 GB)  TX bytes:1877058580 (1.8 GB)

cloud@devstack1:~/contrail-install-doc/manage-scripts$

Configure the Vrouter agent

Copy the The vrouter agent config file from https://github.com/sureshkvl/contrail-install-doc/tree/master/config-files repository to /etc/contrail folder.

Update the IP details

Restart the contrail agent service

Copy the Service management scripts from https://github.com/sureshkvl/contrail-install-doc/tree/master/manage-scripts repository to your local directory. This scripts are handy to start/stop the contrail services

cloud@devstack1:~/contrail-install-doc/manage-scripts$ ./contrail-vrouter-agent.sh stop  
contrail-vrouter-agent: stopped
checking the vrouter kernel modules 
vrouter               391308  0 
cloud@devstack1:~/contrail-install-doc/manage-scripts$ ./contrail-vrouter-agent.sh start
contrail-vrouter-agent: started
checking the vrouter kernel modules 
vrouter               391308  1 
cloud@devstack1:~/contrail-install-doc/manage-scripts$ ./contrail-vrouter-agent.sh status
contrail-vrouter-agent           RUNNING    pid 7677, uptime 0:00:07
checking the vrouter kernel modules 
vrouter               391308  1 
cloud@devstack1:~/contrail-install-doc/manage-scripts$

Configure the neutron :

Clean the openvswitch footprints:

clean the network namespaces created by devstack

sudo ip netns ls
sudo ip netns del <qrouter namespace>
sudo ip netns del <qdhcp namespace>

Remove the br-int, br-ext, br-tun

ifconfig br-int down
ifconfig br-ext down
ifconfig br-tun down

ovs-vsctl del-br br-int
ovs-vsctl del-br br-ex
ovs-vsctl del-br br-tun

Stop the openvswitch:

sudo service openvswitch-switch stop

Neutron configuration :

Edit the /etc/neutron.conf file

Modify as below,

1.include this line,in line 2:

api_extensions_path = extensions:/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/extensions

2.comment out the service_plugins and core_plugin line, include the below line.

core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_v3.NeutronPluginContrailCoreV3

3.in [keystone_authtoken], section, include below
auth_host = 10.0.1.7
auth_protocol = http
admin_tenant_name = admin
admin_password = openstackl123
admin_user = admin

4. in [quotas] , include the below line,
quota_driver = neutron_plugin_contrail.plugins.opencontrail.quota.driver.QuotaDriver

Note : Contrail plugin has V2 and V3 versions.

For V3 Plugin,

core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_v3.NeutronPluginContrailCoreV3

For V2 Plugin,

core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2

Also, Service Plugins (Load balancer) can be added. Ex:

service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin

Note : To use service plugins, some installations are required.(To be updated). So just disabled

Update the plugins/opencontrail/ContrailPlugin.ini

sudo vi /etc/neutron/plugins/opencontrail/ContrailPlugin.ini

[APISERVER]
apply_subnet_host_routes = True
api_server_ip = 10.0.1.7
api_server_port = 8082
multi_tenancy = False

Stop the following neutron services/screens in devstack (These are no more required. Opencontrail will take care)

1. stop the(q-agt) - /usr/local/bin/neutron-openvswitch-agent --config-file /etc/neutron/neutron.conf
2. stop the (q-dhcp) - /usr/local/bin/neutron-dhcp-agent --config-file /etc/neutron/neutron.conf
3. stop the (q-l3) - /usr/local/bin/neutron-l3-agent --config-file /etc/neutron/neutron.conf
4. stop the (q-meta) - /usr/local/bin/neutron-metadata-agent --config-file /etc/neutron/neutron.conf -

Restart the netutron service- q-svc screen (include contrail plugin config file) ,using contrail plugin instead of ml2 plugin

/usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/opencontrail/ContrailPlugin.ini

Setting up the Virtual Gateway:

Note : This step to be performed after provisioning.

Create the public network

source openrc admin admin
neutron net-create public --router:external True --provider:network_type local
neutron subnet-create --gateway 172.24.4.1 --allocation-pool start=172.24.4.5,end=172.24.4.20 public 172.24.4.0/24

Run the vgw_setup script

Download the script from here

https://github.com/sureshkvl/contrail-install-doc/blob/master/provisioning-scripts/vgw_setup.sh

Edit this script and modify the IPs according to your setup

VHOST_INTERFACE_NAME=eth0
VHOST_INTERFACE_CIDR=10.0.1.5/24
VHOST_INTERFACE_IP=10.0.1.5
DEFAULT_GW=10.0.1.1

Run this script

./vgw_setup.sh

This script will create vgw interface and nat stuff.


1.2.5 Provisioning

Run this script in opencontrail VM

Provision the vrouter

Download the https://github.com/sureshkvl/contrail-install-doc/blob/master/provisioning-scripts

Edit the script and update the IP and HOSTNAME properly

cloud@opencontrail:~/contrail-install-doc/provisioning-scripts$ ./provisioning_vrouter.sh
Created.UUID is c8f39c1a-9b60-49d0-93d9-914e706776e3
cloud@opencontrail:~/contrail-install-doc/provisioning-scripts$ ./provisioning_vrouter.sh
BGP Router [u'default-domain',
u'default-project',
u'ip-fabric',
u'__default__',
'opencontrail'] already exists with uuid 7a73b580-4cc0-416d-9f8e-737cdd3e6123
Updated.{"global-vrouter-config": {"href": "http://10.0.1.4:8082/global-vrouter-config/c8f39c1a-9b60-49d0-93d9-914e706776e3", "uuid": "c8f39c1a-9b60-49d0-93d9-914e706776e3"}}
cloud@opencontrail:~/contrail-install-doc/provisioning-scripts$

results matching ""

    No results matching ""