Jump to: navigation, search

OpenStack Kolla and OpenDaylight

OpenStack is a popular open source Infrastructure as a service project, covering compute, storage and network management. OpenStack can use OpenDaylight as its network management provider through the Modular Layer 2 (ML2) north-bound plug-in. OpenDaylight manages the network flows for the OpenStack compute nodes via the OVSDB south-bound plug-in. Kolla is an OpenStack project that deploys OpenStack using containers providing version control and reproduce-ability to an OpenStack Deploy. This page describes how to set that up, and how to tell when everything is working.

Installing OpenStack w/ Kolla + OpenDaylight

Assumes CentOS 7 System. Needs one node for ODL, three nodes for OpenStack (1 control, 2 compute)

EVERY NODE

Install epel repo

   yum -y install epel-release

Ensure every node is time synchronized.

   yum -y install ntp
   systemctl enable ntpd.service
   systemctl start ntpd.service

Stop and disable libvirt service. Avoids conflicts with libvirt containers.

   systemctl stop libvirtd
   systemctl disable libvirtd

Install docker

   yum install -y yum-utils
   yum-config-manager \
   --add-repo \
   https://docs.docker.com/engine/installation/linux/repo_files/centos/docker.repo
   yum install docker-engine

Add user to docker group to enable this user to issue docker commands without sudo. Logoff and login to apply changes.

   sudo usermod -aG docker <user-name>

Create a file called kolla.conf with the following content.

   vim /etc/systemd/system/docker.service.d/kolla.conf
   [Service]
   MountFlags=shared

If using a proxy create a file called http-proxy.conf with the following content.

   vim /etc/systemd/system/docker.service.d/http-proxy.conf
   [Service]
   Environment="HTTP_PROXY=<proxy-here>/" "NO_PROXY=localhost,127.0.0.1,*.evilcorp.com,<host-IP>"

Chane systemd /usr/lib/systemd/system/docker.service. Change the line ExecStart=/usr/bin/dockerd to

         ExecStart=/usr/bin/dockerd \
         $OPTIONS \
         $DOCKER_STORAGE_OPTIONS \
         $DOCKER_NETWORK_OPTIONS \
         $ADD_REGISTRY \
         $BLOCK_REGISTRY \
         $INSECURE_REGISTRY

Reload daemon, restart and enable docker service

   systemctl daemon-reload
   systemctl restart docker
   systemctl enable docker

Install required packages

  yum install -y python-devel libffi-devel openssl-devel gcc git python-pip python-openstackclient

DEPLOY NODE

Install ansible, tox

   yum install -y ansible
   pip install tox

Clone Kolla and kolla ansible code and checkout ODL patches.

   git clone https://git.openstack.org/openstack/kolla
   git clone https://git.openstack.org/openstack/kolla-ansible

Install kolla and dependencies.

   pip install kolla/
   pip install kolla-ansible/

Copy kolla configuration files to /etc/

  cp -r kolla-ansible/etc/kolla /etc/

Create kolla build config file

  cd kolla
  tox -e genconfig
  cp etc/kolla/kolla-build.conf /etc/kolla/kolla-build.conf 

Edit kolla-build.conf

  vim /etc/kolla/kolla-build.conf
  base = centos
  tag = newton
  push = true
  install_type = source
  registry = <host-OP>:4000
  namespace = kolla-odl
  [opendaylight]
  type = url
  location = https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.6.1-Carbon/distribution-karaf-0.6.1-Carbon.tar.gz
  [profiles]
  odl = opendaylight,chrony,cron,kolla-toolbox,glance,haproxy,heat,heka,horizon,keepalived,keystone,mariadb,memcached,neutron,nova,openvswitch,rabbitmq,rally

To ensure you are using the OpenStack release wanted, please add source (git,url or local) locations for each service you build to kolla-build.conf like below (NOTE: Kolla will not build ODL, so source is prebuilt archive or directory for ODL)

  [nova-base]
  type = url
  location = $tarballs_base/nova/nova-stable-ocata.tar.gz
  
  [opendaylight]
  
  # Source location type (string value)
  # Allowed values: local, git, url
  type = url
  
  # The location for source install (string value)
  location = https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.6.1-Carbon/distribution-karaf-0.6.1-Carbon.tar.gz
  
  # Git reference to pull, commit sha, tag or branch name (string value)

Add the following line to /etc/sysconfig/docker

  vim /etc/sysconfig/docker
  INSECURE_REGISTRY='--insecure-registry <host-IP>:4000'
  systemctl daemon-reload
  systemctl restart docker

Start Registry

  docker run -d -p 4000:5000 --restart=always --name registry registry:2

Build Containers

  kolla-build -n kolla-odl --push --profile odl

To build a custom version of OpenDaylight edit the kolla-build.conf and add location of ODL compiled build

  [opendaylight]
  
  # Source location type (string value)
  # Allowed values: local, git, url
  type = local
  
  # The location for source install (string value)
  location = /opt/distribution-karaf-0.6.1-Carbon-SNAPSHOT/

Then build the opendaylight container only

  kolla-build -n kolla-odl --push opendaylight

TARGET HOSTS

In target nodes (contol/compute openstack nodes), install newer version of pip and docker-py

  sudo pip install -U pip
  pip install -U docker-py

DEPLOY KOLLA

Following commands run on deploy node.

Use kolla-genpwd to create random passwords or modify passwords file at /etc/kolla/passwords.yml

  kolla-genpwd

Change OpenDaylight password in passwords.yml to 'admin' (cannot easily change default password on startup) Edit globals.yml file (Find reference globals.yml for stable/newton here: https://drive.google.com/a/mgkwill.com/file/d/0B9z-kdO_o1WddFNtQkc4SXhGYzQ/view?usp=sharing)

  vim /etc/kolla/globals.yml
  ---
  kolla_base_distro: "centos"
  kolla_install_type: "source"
  openstack_release: "ocata" ## Tag of images in local docker repository
  kolla_internal_vip_address: "<IP>" ## Should be VIP, unused IP on network
  docker_registry: "<host-IP>:4000"
  docker_namespace: "kolla-odl"
  network_interface: "<network-interface-name>"
  neutron_external_interface: "<external-network-interface-name>"
  neutron_plugin_agent: "opendaylight"   
  
  ###############################
  # OpenDaylight
  ###############################
  enable_opendaylight_l3: "yes"
  enable_opendaylight_qos: "no"

If you have more than one kolla deploy in your environment add the following line to globals.yml with different id for each deploy

  keepalived_virtual_router_id: "67"

Edit the inventory file with your server’s IPs or hostnames.

  vim /usr/share/kolla/ansible/inventory/multinode
  [control]
  # These hostname must be resolvable from your deployment host
  <Node 1 IP>
  # network nodes are where l3-agents and opendaylight runs
  [network]
  <Node 1 IP> network_interface=ens7e431 neutron_external_interface=ens387f1
  [compute]
  <Node 2 IP> network_interface=ens787f1 neutron_external_interface=ens74f3
  <Node 3 IP> network_interface=ens787f2 neutron_external_interface=ens7bf1
  # If compute nodes and control nodes use different interfaces,
  # Specify "api_interface" etc:
  #compute01 neutron_external_interface=<interface1> api_interface=<interface2> storage_interface=<interfaceN> tunnel_interface=<interfaceN+1>
  [storage]
  <Node 1 IP>

For standalone instances of OpenDaylight be sure to remove "[opendaylight:children]" from the inventory file and make "[opendaylight]" group with appropriate hosts

  <snip>
  [opendaylight:children] 
  network
  <snip>

Create SSH keys for login to target nodes.

  ssh-keygen

Copy the SSH key you have previously created to all your target nodes.

  ssh-copy-id root@<Node 1 IP>
  ssh-copy-id root@<Node 2 IP>
  ssh-copy-id root@<Node 3 IP>

Ensure hostnames can be resolved between all the nodes, otherwise rabbitmq will fail. Configure hosts file.

  vim /etc/hosts
  <Node 1 IP> node1
  <Node 2 IP> node2
  <Node 3 IP> node3

Copy hosts file to the other nodes.

  scp /etc/hosts root@node2:/etc/hosts
  scp /etc/hosts root@node3:/etc/hosts

On Deploy node execute prechecks to check requirements are satisfied.

  kolla-ansible prechecks -i /usr/share/kolla/ansible/inventory/multinode 

If prechecks pass install OpenStack with Kolla.

Note: first deploy is long. Docker images need to be pulled into target hosts

  kolla-ansible deploy -i /usr/share/kolla/ansible/inventory/multinode

Create a credential file once deploy is completed.

  kolla-ansible post-deploy

The reference deployment we will use for this document is a 3 node cluster + OpenDaylight:

  • One control node containing all of the management services for OpenStack (Nova, Neutron, Glance, Swift, Cinder, Keystone)
  • Two compute nodes running nova-compute
  • Neutron using the OVS back-end and vxlan for tunnels

Once you have installed OpenStack, verify that it is working by connecting to Horizon and performing a few operations. To check the Neutron configuration, create two instances on a private subnet bridging to your public network, and verify that you can connect to them, and that they can see each other.

Verifying it works

  • Verify that OpenDaylight's ML2 interface is working:
curl -u admin:<odl password> http://${OPENDAYLIGHT_HOST}:8087/controller/nb/v2/neutron/networks

{
   "networks" : [ ]
}

If this does not work or gives an error, check Neutron's log file in /var/log/neutron/server.log. Error messages here should give some clue as to what the problem is in the connection with OpenDaylight

  • Create a net, subnet, router, connect ports, and start an instance using the Neutron CLI:
openstack network create private
openstack router create router1
openstack subnet create private_subnet --network private --subnet-range 10.10.5.0/24
openstack router add subnet router1 private_subnet
net_id=$(openstack network show private -f shell --prefix net_ | grep "net_id" | grep -o '".*"' | sed 's/"//g')
openstack server create --flavor cirros --image cirros-0.3.4-x86_64 --nic $net_id test1
openstack server create --flavor cirros --image cirros-0.3.4-x86_64 --nic $net_id test2

At this point, you have confirmed that OpenDaylight is creating network end-points for instances on your network and managing traffic to them.

Congratulations! You're done!