Apr 19, 2016

Contrail R3.0 Manual installation on ubuntu(11)

Install Compute Node

A configuration of Nova Compute is many options, but it is done simple configuration. Please modify as your environment. Further more, if you want to use Nova-compute packages other than Local repository, I recommend you to install Nova compute before installing Contrail packages.
**Target Server: Compute1

1.Set variables
HOST=10.84.50.135  ## Set IP address of an Installation server
OPENSTACK=10.84.50.134  ## Set IP address of Openstack server
IVIP=10.84.50.139  ## Set Virtual IP address of Control/Data
DEV=p514p2  ## A name of Physical NIC for Control/Data
MAC=90:e2:ba:a1:aa:e1  ## MAC address of Physical NIC for Control/Data
DGW=10.84.50.252  ## Default Gateway of Control/Data. It is not used by Routing of Linux kernel.

2.Install Nova Compute
apt-get update
apt-get install -y nova-compute sysfsutils

3.Modify /etc/nova.conf
echo "[DEFAULT]
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/var/lock/nova
force_dhcp_release=True
libvirt_use_virtio_for_bridges=True
verbose=True
ec2_private_dns_show_ip=False
api_paste_config=/etc/nova/api-paste.ini
enabled_apis=ec2,osapi_compute,metadata
rabbit_host = $OPENSTACK
security_group_api = neutron
service_neutron_metadata_proxy = True
compute_driver = libvirt.LibvirtDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
novncproxy_port = 5999
novncproxy_host = 0.0.0.0
auth_strategy = keystone
network_api_class = nova.network.neutronv2.api.API
novncproxy_base_url = http://$OPENSTACK:6080/vnc_auto.html
vncserver_enabled = true
vncserver_listen = $HOST
vncserver_proxyclient_address = $HOST

[keystone_authtoken]
admin_tenant_name = service
admin_user = nova
admin_password = password
auth_protocol = http
auth_host = $OPENSTACK
auth_port = 35357
signing_dir = /tmp/keystone-signing-nova

[neutron]
admin_auth_url = http://$OPENSTACK:35357/v2.0/
admin_username = neutron
admin_password = password
admin_tenant_name = service
url = http://$IVIP:9696/
url_timeout = 300
service_metadata_proxy = True

[compute]
compute_driver = libvirt.LibvirtDriver

[glance]
host = $OPENSTACK" > /etc/nova.conf

4.Modify /etc/libvirt/qemu.conf
echo 'cgroup_device_acl = [
    "/dev/null", "/dev/full", "/dev/zero",
    "/dev/random", "/dev/urandom",
    "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
    "/dev/rtc", "/dev/hpet","/dev/net/tun",
]' >> /etc/libvirt/qemu.conf

5.Install Contrail vRouter
In case of Linux Kernel version is other than 3.13.0-40.
apt-get -y install contrail-openstack-vrouter contrail-vrouter-dkms contrail-vrouter-common contrail-nova-vif
In case of Linux Kernel version is 3.13.0-40.
apt-get -y install contrail-openstack-vrouter contrail-vrouter-3.13.0-40-generic contrail-vrouter-common contrail-nova-vif

6.Modify /etc/contrail/vrouter_nodemgr_param
echo "DISCOVERY=$IVIP" > /etc/contrail/vrouter_nodemgr_param

7.Modify /etc/contrail/agent_param
echo "LOG=/var/log/contrail.log
CONFIG=/etc/contrail/contrail-vrouter-agent.conf
prog=/usr/bin/contrail-vrouter-agent
kmod=vrouter
pname=contrail-vrouter-agent
LIBDIR=/usr/lib64
DEVICE=vhost0
dev=$DEV
LOGFILE=--log-file=/var/log/contrail/vrouter.log" > /etc/contrail/agent_param

8.Modify /etc/contrail/contrail-vrouter-agent.conf
sed -i -e "/^\[DISCOVERY\]/i platform=default" /etc/contrail/contrail-vrouter-agent.conf
sed -i -e "/^\[DISCOVERY\]/i physical_interface_mac=$MAC" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# server=127.0.0.1/server=$IVIP/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# max_control_nodes=1/max_control_nodes=2/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# type=kvm/type=kvm/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# control_network_ip=/control_network_ip=$HOST/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# name=vhost0/name=vhost0/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# ip=10.1.1.1/24/ip=$HOST/24/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# gateway=10.1.1.254/gateway=$DGW/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# physical_interface=vnet0/physical_interface=$DEV/g" /etc/contrail/contrail-vrouter-agent.conf
sed -i "s/# thread_count = 4/thread_count = 4/g" /etc/contrail/contrail-vrouter-agent.conf

9.Modify /etc/network/interfaces
vRouter binds Physical NIC for Control/Data to vhost0. Hence, Physical interface doesn't have IP address, instead of that vhost0 has IP address.
Execute a command below, then copy and paste it to /etc/network/interface.
echo "auto $DEV
iface $DEV inet manual
    pre-up ifconfig $IDEV up
    post-down ifconfig $IDEV down


auto vhost0
iface vhost0 inet static
    pre-up /opt/contrail/bin/if-vhost0
    netmask 255.255.255.0
    network_name application
    address $HOST
    gateway $DGW
    dns-nameservers 8.8.8.8"

10.Modify /etc/contrail/contrail-vrouter-nodemgr.conf
echo "[DISCOVERY]
server=$IVIP
port=5998" >> /etc/contrail/contrail-vrouter-nodemgr.conf

11.Reboot ComputeNode
Reboot Compute Node

12.Add Compute node to Conï½”rail
Open WebUI then Open "Configure"->"Infrastructure"->"Virtual Routers", Click"+"
The dialog below is opened. Set host name of Compute node to "Name" and IP address of vhost0 to "IP Address".

The all of installation and configuration is down.
Next topic is "Operation check".

No comments:

Post a Comment