aboutsummaryrefslogtreecommitdiff
path: root/doc/heat-dev-env.rst
blob: 380194da1df529806ccdfec5eadd29bda7173b4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
Development Environment with Heat
=================================

These `Heat <https://wiki.openstack.org/wiki/Heat>`__ templates will
deploy an *N*-node `Kolla <https://wiki.openstack.org/Kolla>`__ cluster,
where *N* is the value of the ``number_of_nodes`` parameter you specify
when creating the stack.

Kolla has recently undergone a considerable design change. The details
of the design change is addressed in this
`spec <https://review.openstack.org/#/c/153798/>`__. As part of the
design change, containers share pid and networking namespaces with the
Docker host. Therefore, containers no longer connect to a docker0 bridge
and have separate networking from the host. As a result, Kolla
networking has a configuration similar to:

.. image:: kollanet.png
   :alt: Kolla networking

Sharing pid and networking namespaces is detailed in the `super
privileged
containers <http://sdake.io/2015/01/28/an-atomic-upgrade-process-for-openstack-compute-nodes/>`__
concept.

The Kolla cluster is based on Fedora 21, requires the minimum Docker
version of 1.7.0
`binary <https://docs.docker.com/installation/binaries/>`__.

These templates are designed to work with the Icehouse or Juno versions
of Heat. If using Icehouse Heat, this
`patch <https://review.openstack.org/#/c/121139/>`__ is required to
correct a bug with template validation when using the "Fn::Join"
function).

Create the Glance Image
-----------------------

After cloning the project, run the get-image.sh script from the
project's devenv directory:

::

    $ ./get-image.sh

The script will create a Fedora 21 image with the required
modifications.

Add the image to your Glance image store:

::

    $ glance image-create --name "fedora-21-x86_64" \
    --file /var/lib/libvirt/images/fedora-21-x86_64 \
    --disk-format qcow2 --container-format bare \
    --is-public True --progress

Create the Stack
----------------

Copy local.yaml.example to local.yaml and edit the contents to match
your deployment environment. Here is an example of a customized
local.yaml:

::

    parameters:
      ssh_key_name: admin-key
      external_network_id: 028d70dd-67b8-4901-8bdd-0c62b06cce2d
      container_external_network_id: 028d70dd-67b8-4901-8bdd-0c62b06cce2d
      container_external_subnet_id: 575770dd-6828-1101-34dd-0c62b06fjf8s
      dns_nameserver: 192.168.200.1

The external\_network\_id is used by Heat to automatically assign
floating IP's to your Kolla nodes. You can then access your Kolla nodes
directly using the floating IP. The network ID is derived from the
``neutron net-list`` command.

The container\_external\_network\_id is used by the nova-network
container within the Kolla node as the FLAT\_INTERFACE. The
FLAT\_INTERFACE tells Nova what device to use (i.e. eth1) to pass
network traffic between Nova instances across Kolla nodes. This network
should be separate from the external\_network\_id above and is derived
from the 'neutron net-list' command.

The container\_external\_subnet\_id: is the subnet equivalent to
container\_external\_network\_id

Review the parameters section of kollacluster.yaml for a full list of
configuration options. **Note:** You must provide values for:

-  ``ssh_key_name``
-  ``external_network_id``
-  ``container_external_network_id``
-  ``container_external_subnet_id``

And then create the stack, referencing that environment file:

::

    $ heat stack-create -f kollacluster.yaml -e local.yaml kolla-cluster

Access the Kolla Nodes
----------------------

You can get the ip address of the Kolla nodes using the
``heat output-show`` command:

::

    $ heat output-show kolla-cluster kolla_node_external_ip
    "192.168.200.86"

You can ssh into that server as the ``fedora`` user:

::

    $ ssh fedora@192.168.200.86

Once logged into your Kolla node, setup your environment. The basic
starting environment will be created using ``docker-compose``. This
environment will start up the openstack services listed in the compose
directory.

To start, setup your environment variables.

::

    $ cd kolla
    $ ./tools/genenv

The ``genenv`` script will create a compose/openstack.env file and an
openrc file in your current directory. The openstack.env file contains
all of your initialized environment variables, which you can edit for a
different setup.

Next, run the start script.

::

    $ ./tools/kolla-compose start

The ``start`` script is responsible for starting the containers using
``docker-compose -f <osp-service-container> up -d``.

If you want to start a container set by hand use this template

::

    $ docker-compose -f glance-api-registry.yml up -d

Debugging
---------

All Docker commands should be run from the directory of the Docker
binary, by default this is ``/``.

A few commands for debugging the system.

::

    $ sudo ./docker images

Lists all images that have been pulled from the upstream kollaglue
repository thus far. This can be run on the node during the ``./start``
operation to check on the download progress.

::

    $ sudo ./docker ps -a

This will show all processes that docker has started. Removing the
``-a`` will show only active processes. This can be run on the node
during the ``./start`` operation to check that the containers are
orchestrated.

::

    $ sudo ./docker logs <containerid>

::

    $ curl http://<NODE_IP>:3306

You can use curl to test connectivity to a container. This example
demonstrates the Mariadb service is running on the node. Output should
appear as follows

::

    $ curl http://10.0.0.4:3306
    Trying 10.0.0.4...
    Connected to 10.0.0.4.
    Escape character is '^]'.