Ambiente » History » Version 79

Beraldo Leal, 14 Mar 2013 15:26

1 1 Beraldo Leal
h1. Ambiente de Desenvolvimento
2 1 Beraldo Leal
3 1 Beraldo Leal
h2. Lista de Servidores
4 1 Beraldo Leal
5 76 Beraldo Leal
Educloud00 (LVM)
6 77 Beraldo Leal
  Eth0 - 00:15:17:DE:B7:24 - 200.145.46.165/24
7 76 Beraldo Leal
  Eth1 - 00:15:17:DE:B7:25
8 1 Beraldo Leal
9 76 Beraldo Leal
Educloud01 (TPM01)
10 79 Beraldo Leal
  Eth0 - 00:1e:67:3c:7c:df - 200.145.46.166/24
11 76 Beraldo Leal
  Eth1 - 00:1e:67:3c:7c:e0
12 76 Beraldo Leal
  Eth2 - 00:1e:67:3c:7c:e1
13 76 Beraldo Leal
  Eth3 - 00:1e:67:3c:7c:e2
14 1 Beraldo Leal
15 76 Beraldo Leal
Educloud02 (TPM02)
16 79 Beraldo Leal
  Eth0 - 00:1e:67:3c:89:ce - 200.145.46.167/24
17 76 Beraldo Leal
  Eth1 - 00:1e:67:3c:89:cf
18 76 Beraldo Leal
  Eth2 - 00:1e:67:3c:89:d0
19 76 Beraldo Leal
  Eth3 - 00:1e:67:3c:89:d1
20 76 Beraldo Leal
21 76 Beraldo Leal
Educloud03
22 79 Beraldo Leal
  Eth0 - 00:15:17:da:53:92 - 200.145.46.168/24
23 76 Beraldo Leal
  Eth1 - 00:15:17:da:53:93
24 76 Beraldo Leal
  Eth2 - 00:15:17:da:53:94
25 76 Beraldo Leal
  Eth3 - 00:15:17:da:53:95
26 76 Beraldo Leal
  Eth4 - 00:15:17:da:53:96
27 76 Beraldo Leal
28 76 Beraldo Leal
Educloud04
29 79 Beraldo Leal
  Eth0 - 00:15:17:da:55:62 - 200.145.46.169/24
30 76 Beraldo Leal
  Eth1 - 00:15:17:da:55:63
31 76 Beraldo Leal
  Eth2 - 00:15:17:da:55:64
32 76 Beraldo Leal
  Eth3 - 00:15:17:da:55:65
33 76 Beraldo Leal
  Eth4 - 00:15:17:da:55:66
34 76 Beraldo Leal
35 76 Beraldo Leal
Educloud05
36 79 Beraldo Leal
  Eth0 - 00:26:18:6d:65:a6 - 200.145.46.170/24
37 76 Beraldo Leal
  Eth1 - 00:26:18:6d:65:a7
38 76 Beraldo Leal
39 76 Beraldo Leal
Educloud06
40 79 Beraldo Leal
  Eth0 - 00:26:18:6d:61:64 - 200.145.46.171/24
41 76 Beraldo Leal
  Eth1 - 00:26:18:6d:61:65
42 76 Beraldo Leal
43 76 Beraldo Leal
Educloud07
44 79 Beraldo Leal
  Eth0 - 00:26:18:6d:67:ba - 200.145.46.172/24
45 76 Beraldo Leal
  Eth1 - 00:26:18:6d:67:bb
46 76 Beraldo Leal
47 76 Beraldo Leal
Educloud08
48 79 Beraldo Leal
  Eth0 - 00:26:18:6d:67:be - 200.145.46.173/24
49 76 Beraldo Leal
  Eth1 - 00:26:18:6d:67:bf
50 76 Beraldo Leal
51 76 Beraldo Leal
Educloud09
52 79 Beraldo Leal
  Eth0 - 00:26:18:6d:65:22 - 200.145.46.174/24
53 76 Beraldo Leal
  Eth1 - 00:26:18:6d:65:23
54 76 Beraldo Leal
55 76 Beraldo Leal
Educloud10
56 79 Beraldo Leal
  Eth0 - 00:26:18:6d:65:3e - 200.145.46.175/24
57 76 Beraldo Leal
  Eth1 - 00:26:18:6d:65:3f
58 76 Beraldo Leal
59 3 Beraldo Leal
60 53 Beraldo Leal
h1. Introduction
61 59 Beraldo Leal
62 55 Beraldo Leal
This document refers to the installation manual of the main components of
63 55 Beraldo Leal
OpenStack. The version of each component used can be found in the respective
64 55 Beraldo Leal
sections of the components.
65 1 Beraldo Leal
66 55 Beraldo Leal
This document was produced by the Center for Scientific Computing, UNESP, with
67 55 Beraldo Leal
funding from Intel and UNESP.
68 1 Beraldo Leal
69 1 Beraldo Leal
OpenStack OpenStack is a global collaboration of developers and cloud computing
70 58 Beraldo Leal
technologists producing the ubiquitous open source cloud computing platform for 
71 55 Beraldo Leal
public and private clouds. The project aims to deliver solutions for all types
72 55 Beraldo Leal
of clouds by being simple to implement, massively scalable, and feature rich.
73 55 Beraldo Leal
The technology consists of a series of interrelated projects delivering various
74 55 Beraldo Leal
components for a cloud infrastructure solution.
75 1 Beraldo Leal
76 1 Beraldo Leal
The OpenStack project is divided into sub projects that have a specific role in
77 55 Beraldo Leal
the big picture.
78 1 Beraldo Leal
79 58 Beraldo Leal
The main components are: Cloud Compute (Nova) Cloud Storage (Swift), Image 
80 55 Beraldo Leal
registration and delivery (Glance), Identity (Keystone) and Dashboard
81 55 Beraldo Leal
(Horizon).
82 1 Beraldo Leal
83 1 Beraldo Leal
Each component is independent of each other and can be installed on separate
84 1 Beraldo Leal
machines, or all in one. In the environment of UNESP, OpenStack was installed in
85 55 Beraldo Leal
seven machines, described in section "Environment used."
86 56 Beraldo Leal
87 58 Beraldo Leal
This document is modified version of OpenStack Install and Deploy Manual [1] 
88 58 Beraldo Leal
with minor adjustments and changes to resolve problems encountered during 
89 58 Beraldo Leal
installation and adjustment to the environment in which it was installed.
90 55 Beraldo Leal
91 58 Beraldo Leal
92 55 Beraldo Leal
h1. OpenStack Core Components
93 55 Beraldo Leal
94 55 Beraldo Leal
OpenStack is a collection of open source technology that provides massively
95 55 Beraldo Leal
scalable open source cloud computing software. Currently OpenStack develops two
96 55 Beraldo Leal
related projects: OpenStack Compute, which offers computing power through
97 55 Beraldo Leal
virtual machine and network management, and OpenStack Object Storage which is
98 55 Beraldo Leal
software for redundant, scalable object storage capacity. Closely related to the
99 55 Beraldo Leal
OpenStack Compute project is the Image Service project, named Glance. OpenStack
100 55 Beraldo Leal
can be used by corporations, service providers, VARS, SMBs, researchers, and
101 55 Beraldo Leal
global data centers looking to deploy large-scale cloud deployments for private
102 55 Beraldo Leal
or public clouds.
103 55 Beraldo Leal
104 55 Beraldo Leal
The main components are: Cloud Compute (Nova) Cloud Storage (Swift), Image
105 1 Beraldo Leal
registration and delivery (Glance), Identity (Keystone) and Dashboard
106 1 Beraldo Leal
(Horizon).
107 1 Beraldo Leal
108 1 Beraldo Leal
They are presented here in an order for educational purposes only to a 
109 1 Beraldo Leal
straightforward procedure for installation. But following a brief description of
110 1 Beraldo Leal
each component.
111 1 Beraldo Leal
112 58 Beraldo Leal
h2. Keystone
113 58 Beraldo Leal
114 58 Beraldo Leal
Keystone is an OpenStack project that provides Identity, Token, Catalog and 
115 58 Beraldo Leal
Policy services for use specifically by projects in the OpenStack family. It
116 58 Beraldo Leal
implements OpenStack’s Identity API.
117 58 Beraldo Leal
118 58 Beraldo Leal
119 55 Beraldo Leal
h2. Cloud Compute (Nova)
120 55 Beraldo Leal
121 55 Beraldo Leal
Nova is the project name for OpenStack Compute, a cloud computing fabric
122 55 Beraldo Leal
controller, the main part of an IaaS system. Individuals and organizations can
123 55 Beraldo Leal
use Nova to host and manage their own cloud computing systems. Nova originated
124 55 Beraldo Leal
as a project out of NASA Ames Research Laboratory.
125 55 Beraldo Leal
126 55 Beraldo Leal
h2. Object Storage (Swift)
127 55 Beraldo Leal
128 55 Beraldo Leal
OpenStack Object Storage (Swift) is a system to store objects in a massively
129 55 Beraldo Leal
scalable large capacity system with built-in redundancy and failover. Object
130 55 Beraldo Leal
Storage has a variety of applications, such as backing up or archiving data,
131 55 Beraldo Leal
serving graphics or videos (streaming data to a user's browser), storing
132 55 Beraldo Leal
secondary or tertiary static data, developing new applications with data
133 55 Beraldo Leal
storage integration, storing data when predicting storage capacity is difficult,
134 55 Beraldo Leal
and creating the elasticity and flexibility of cloud-based storage for your web
135 55 Beraldo Leal
applications.
136 1 Beraldo Leal
137 1 Beraldo Leal
h2. Image Service (Glance)
138 1 Beraldo Leal
139 1 Beraldo Leal
OpenStack Image Service (Glance) is a lookup and retrieval system for virtual
140 1 Beraldo Leal
machine images. It can be configured in three ways: using OpenStack Object Store
141 1 Beraldo Leal
to store images; using Amazon's Simple Storage Solution (S3) storage directly;
142 1 Beraldo Leal
or using S3 storage with Object Store as the intermediate for S3 access.
143 58 Beraldo Leal
144 58 Beraldo Leal
145 58 Beraldo Leal
h1. Environment Proposed
146 58 Beraldo Leal
147 58 Beraldo Leal
This document aims to guide you in setting up a test environment or development.
148 58 Beraldo Leal
The original documentation suggests many machines. To install OpenStack here,
149 58 Beraldo Leal
you will need only one or two machines.
150 58 Beraldo Leal
151 58 Beraldo Leal
You can install all services on one machine only (all-in-one). Or you can
152 58 Beraldo Leal
install OpenStack controller (all services except the nova-compute) on machine A
153 58 Beraldo Leal
and a compute cloud controller on machine B.
154 58 Beraldo Leal
155 58 Beraldo Leal
For a production environment it is advisable to separate the elements to ensure
156 58 Beraldo Leal
a high availability and redundancy.
157 58 Beraldo Leal
158 58 Beraldo Leal
Settings used in this document:
159 58 Beraldo Leal
160 58 Beraldo Leal
 - Cloud Controller:
161 58 Beraldo Leal
162 58 Beraldo Leal
163 58 Beraldo Leal
 - Cloud Computer Node:
164 58 Beraldo Leal
165 58 Beraldo Leal
All machines are installed with Ubuntu Server 12.04 LTS.
166 58 Beraldo Leal
167 58 Beraldo Leal
h1. Initial configuration
168 58 Beraldo Leal
169 58 Beraldo Leal
Before starting the installation and configuration of each component must first
170 58 Beraldo Leal
to make some adjustments.
171 58 Beraldo Leal
172 58 Beraldo Leal
h2. Network Configuration
173 58 Beraldo Leal
174 58 Beraldo Leal
For both conserving network resources and ensuring that network administrators
175 58 Beraldo Leal
understand the needs for networks and public IP addresses for accessing the APIs
176 58 Beraldo Leal
and VMs as necessary, this section offers recommendations and required minimum
177 58 Beraldo Leal
sizes. Throughput of at least 1000 Mbps is suggested.
178 58 Beraldo Leal
179 58 Beraldo Leal
For OpenStack Compute, networking is configured on multi-node installations
180 58 Beraldo Leal
between the physical machines on a single subnet. For networking between virtual
181 58 Beraldo Leal
machine instances, three network options are available: flat, DHCP, and VLAN.
182 58 Beraldo Leal
Two NICs (Network Interface Cards) are recommended on the server running
183 58 Beraldo Leal
nova-network.
184 58 Beraldo Leal
185 58 Beraldo Leal
Management Network (RFC1918 IP Range, not publicly routable): This network is
186 58 Beraldo Leal
utilized for all inter-server communications within the cloud infrastructure.
187 58 Beraldo Leal
Recommended size: 255 IPs (CIDR /24)
188 58 Beraldo Leal
189 58 Beraldo Leal
Public Network (Publicly routable IP range): This network is utilized for
190 58 Beraldo Leal
providing Public IP accessibility to the API endpoints within the cloud
191 58 Beraldo Leal
infrastructure. Minimum size: 8 IPs (CIDR /29)
192 58 Beraldo Leal
193 58 Beraldo Leal
VM Network (RFC1918 IP Range, not publicly routable): This network is utilized
194 58 Beraldo Leal
for providing primary IP addresses to the cloud instances. Recommended size:
195 58 Beraldo Leal
1024 IPs (CIDR /22)
196 58 Beraldo Leal
197 58 Beraldo Leal
Floating IP network (Publicly routable IP Range): This network is utilized for
198 58 Beraldo Leal
providing Public IP accessibility to selected cloud instances. Minimum size:
199 58 Beraldo Leal
16 IPs (CIDR /28)
200 58 Beraldo Leal
201 58 Beraldo Leal
In this installation we will use eth0 to public interface and eth1 for
202 58 Beraldo Leal
management interface.
203 58 Beraldo Leal
204 58 Beraldo Leal
h2. Installing Network Time Protocol (NTP)
205 58 Beraldo Leal
206 58 Beraldo Leal
To keep all the services in sync, you need to install NTP, and if you do a
207 58 Beraldo Leal
multi-node configuration you will configure one server to be the reference
208 58 Beraldo Leal
server.
209 58 Beraldo Leal
210 58 Beraldo Leal
# apt-get install -y ntp
211 58 Beraldo Leal
212 58 Beraldo Leal
Set up the NTP server on your controller node so that it receives data by
213 58 Beraldo Leal
modifying the ntp.conf file and restarting the service. As root:
214 58 Beraldo Leal
215 58 Beraldo Leal
# sed -i 's/server ntp.ubuntu.com/server ntp.ubuntu.com\nserver 127.127.1.0\
216 58 Beraldo Leal
nfudge 127.127.1.0 stratum 10/g' /etc/ntp.conf
217 58 Beraldo Leal
# service ntp restart
218 58 Beraldo Leal
219 58 Beraldo Leal
Set up the NTP client on your compute node so that the time between controller
220 58 Beraldo Leal
node and compute node is synchronized. Do the following as a cron job on compute
221 58 Beraldo Leal
node.
222 58 Beraldo Leal
223 58 Beraldo Leal
# ntpdate 'controllernode ip'
224 58 Beraldo Leal
# hwclock -w
225 58 Beraldo Leal
226 58 Beraldo Leal
h2. Storage
227 58 Beraldo Leal
228 58 Beraldo Leal
Many cloud computing use cases require persistent remote storage. Storage
229 58 Beraldo Leal
solutions are often divided into three categories: object storage, block
230 58 Beraldo Leal
storage, and file storage.
231 58 Beraldo Leal
232 58 Beraldo Leal
Here we will use a "object storage" and a "block storage".
233 58 Beraldo Leal
234 58 Beraldo Leal
h3. Object storage (swift)
235 58 Beraldo Leal
236 58 Beraldo Leal
With object storage, files are exposed through an HTTP interface, typically with
237 58 Beraldo Leal
a REST API. All client data access is done at the user level: the operating
238 58 Beraldo Leal
system is unaware of the presence of the remote storage system. In OpenStack,
239 58 Beraldo Leal
the Object Storage service provides this type of functionality. Users access and
240 58 Beraldo Leal
modify files by making HTTP requests. Because the data accesss interface provided
241 58 Beraldo Leal
by an object storage system is at a low level of abstraction, people often build
242 58 Beraldo Leal
on top of object storage to build file-based applications that provide a higher
243 58 Beraldo Leal
level of abstraction. For example, the OpenStack Image service can be configured
244 58 Beraldo Leal
to use the Object Storage service as a backend. Another use for object storage
245 58 Beraldo Leal
solutions is as a content delivery network (CDN) for hosting static web content
246 58 Beraldo Leal
(e.g., images, and media files), since object storage already provides an HTTP
247 58 Beraldo Leal
interface.
248 58 Beraldo Leal
249 58 Beraldo Leal
h3. Block storage (SAN)
250 58 Beraldo Leal
251 58 Beraldo Leal
With block storage, files are exposed through a low-level computer bus interface
252 58 Beraldo Leal
such as SCSI or ATA, that is accessible over the network. Block storage is
253 58 Beraldo Leal
synonymous with SAN (storage area network). Clients access data through the
254 58 Beraldo Leal
operating system at the device level: users access the data by mounting the
255 58 Beraldo Leal
remote device in a similar manner to how they would mount a local, physical disk
256 58 Beraldo Leal
(e.g., using the "mount" command in Linux). In OpenStack, the nova-volume
257 58 Beraldo Leal
service that forms part of the Compute service provides this type of
258 58 Beraldo Leal
functionality, and uses iSCSI to expose remote data as a SCSI disk that is
259 58 Beraldo Leal
attached to the network.
260 58 Beraldo Leal
261 58 Beraldo Leal
Because the data is exposed as a physical device, the end-user is responsible
262 58 Beraldo Leal
for creating partitions and formatting the exposed disk device. In addition,
263 58 Beraldo Leal
in OpenStack Compute a device can only be attached to one server at a time, so
264 58 Beraldo Leal
block storage cannot be used for to share data across virtual machine instances
265 58 Beraldo Leal
concurrently.
266 58 Beraldo Leal
267 58 Beraldo Leal
h1. Installation Assumptions
268 58 Beraldo Leal
269 58 Beraldo Leal
OpenStack Compute has a large number of configuration options. To simplify this
270 58 Beraldo Leal
installation guide, we make a number of assumptions about the target
271 58 Beraldo Leal
installation:
272 58 Beraldo Leal
273 58 Beraldo Leal
 * You have a collection of compute nodes, each installed with Ubuntu Server
274 58 Beraldo Leal
12.04
275 58 Beraldo Leal
276 58 Beraldo Leal
 * You have designated one of the nodes as the Cloud Controller, which will run
277 58 Beraldo Leal
all of the services (RabbitMQ, MySQL, Identity, Image, nova-api, nova-network,
278 58 Beraldo Leal
nova-scheduler, nova-volume) except for nova-compute.
279 58 Beraldo Leal
280 58 Beraldo Leal
 * The disk partitions on your cloud controller are being managed by the Logical
281 58 Beraldo Leal
Volume Manager (LVM)
282 58 Beraldo Leal
283 58 Beraldo Leal
 * Your Cloud Controller has an LVM volume group named "nova-volumes" to provide
284 58 Beraldo Leal
persistent storage to guest VMs. Either create this during the installation or
285 58 Beraldo Leal
leave some free space to create it prior to installing nova services.
286 58 Beraldo Leal
287 58 Beraldo Leal
 * Ensure that the server can resolve its own hostname, otherwise you may have
288 58 Beraldo Leal
problems if you are using RabbitMQ as the messaging backend (RabbitMQ is the default
289 58 Beraldo Leal
messaging back-end on Ubuntu, on Fedora the default backend is Qpid).
290 58 Beraldo Leal
291 58 Beraldo Leal
 * 192.168.69.1 is the primary IP for our controller host on eth0 and
292 58 Beraldo Leal
192.168.69.2 is the primary IP for our computer node on eth0.
293 58 Beraldo Leal
294 58 Beraldo Leal
 * FlatDHCP with a single network interface.
295 58 Beraldo Leal
296 58 Beraldo Leal
 * KVM as the hypervisor.
297 58 Beraldo Leal
298 58 Beraldo Leal
 * Ensure the operating system is up-to-date by running apt-get update and
299 58 Beraldo Leal
apt-get upgrade prior to the installation.
300 58 Beraldo Leal
301 58 Beraldo Leal
 * Ensure that all hosts are with ntp and correct time.
302 58 Beraldo Leal
303 58 Beraldo Leal
304 58 Beraldo Leal
This installation process walks through installing a cloud controller node and a
305 58 Beraldo Leal
compute node using a set of packages that are known to work with each other.
306 58 Beraldo Leal
The cloud controller node contains all the nova- services including the API
307 58 Beraldo Leal
server and the database server. The compute node needs to run only the
308 58 Beraldo Leal
nova-compute service. You only need one nova-network service running in a
309 58 Beraldo Leal
multi-node install.
310 53 Beraldo Leal
311 60 Beraldo Leal
h1. Keystone
312 1 Beraldo Leal
313 60 Beraldo Leal
The OpenStack Identity service manages users, tenants (accounts or projects) and
314 60 Beraldo Leal
offers a common identity system for all the OpenStack components.
315 60 Beraldo Leal
316 60 Beraldo Leal
The Identity services has two primary functions:
317 60 Beraldo Leal
318 60 Beraldo Leal
 1. User management: keep track of users and what they are permitted to do
319 60 Beraldo Leal
 2. Service catalog: Provide a catalog of what services are available and where
320 60 Beraldo Leal
their API endpoints are located.
321 60 Beraldo Leal
322 60 Beraldo Leal
h2. User management
323 60 Beraldo Leal
324 60 Beraldo Leal
The three main concepts of Identity user management are:
325 60 Beraldo Leal
326 60 Beraldo Leal
* Users
327 60 Beraldo Leal
* Tenants
328 60 Beraldo Leal
* Roles
329 60 Beraldo Leal
330 60 Beraldo Leal
A user represents a human user, and has associated information such as username,
331 60 Beraldo Leal
password and email.
332 60 Beraldo Leal
333 60 Beraldo Leal
334 60 Beraldo Leal
A tenant can be thought of as a project, group, or organization. Whenever you
335 60 Beraldo Leal
make requests to OpenStack services, you must specify a tenant. For example, if
336 60 Beraldo Leal
you query the Compute service for a list of running instances, you will receive
337 60 Beraldo Leal
a list of all of the running instances in the tenant you specified in your
338 60 Beraldo Leal
query.
339 60 Beraldo Leal
340 60 Beraldo Leal
A role captures what operations a user is permitted to perform in a given tenant.
341 60 Beraldo Leal
342 60 Beraldo Leal
h3. Service management
343 60 Beraldo Leal
344 60 Beraldo Leal
The two main concepts of Identity service management are:
345 60 Beraldo Leal
346 60 Beraldo Leal
* Services
347 60 Beraldo Leal
* Endpoints
348 60 Beraldo Leal
349 60 Beraldo Leal
The Identity service also maintains a user that corresponds to each service
350 60 Beraldo Leal
(e.g., a user named nova, for the Compute service) and a special service tenant,
351 60 Beraldo Leal
which is called service.
352 60 Beraldo Leal
353 60 Beraldo Leal
354 60 Beraldo Leal
h3. Installing Keystone
355 30 Beraldo Leal
356 1 Beraldo Leal
<pre>
357 18 Beraldo Leal
# apt-get install keystone
358 18 Beraldo Leal
</pre>
359 18 Beraldo Leal
360 18 Beraldo Leal
Delete the keystone.db file created in the /var/lib/keystone directory.
361 18 Beraldo Leal
362 18 Beraldo Leal
<pre>
363 18 Beraldo Leal
# rm /var/lib/keystone/keystone.db
364 18 Beraldo Leal
</pre>
365 18 Beraldo Leal
366 18 Beraldo Leal
Install mysql:
367 18 Beraldo Leal
368 18 Beraldo Leal
<pre>
369 18 Beraldo Leal
# apt-get install python-mysqldb mysql-server
370 11 Beraldo Leal
</pre>
371 19 Beraldo Leal
372 19 Beraldo Leal
Use sed to edit /etc/mysql/my.cnf to change bind-address from localhost
373 19 Beraldo Leal
(127.0.0.1) to any (0.0.0.0) and restart the mysql service, as root:
374 19 Beraldo Leal
375 19 Beraldo Leal
<pre>
376 19 Beraldo Leal
# sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
377 19 Beraldo Leal
# service mysql restart
378 19 Beraldo Leal
</pre>
379 19 Beraldo Leal
380 19 Beraldo Leal
To configure the MySQL database, create the keystone database.
381 19 Beraldo Leal
382 19 Beraldo Leal
<pre>
383 19 Beraldo Leal
# mysql -u root -p
384 19 Beraldo Leal
mysql> CREATE DATABASE keystone;
385 74 Beraldo Leal
mysql> CREATE USER keystone;
386 71 Beraldo Leal
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystonepass';
387 19 Beraldo Leal
mysql> FLUSH PRIVILEGES;
388 19 Beraldo Leal
mysql> quit;
389 19 Beraldo Leal
</pre>
390 20 Beraldo Leal
391 20 Beraldo Leal
Edit _*keystone.conf*_ to use mysql:
392 20 Beraldo Leal
393 20 Beraldo Leal
<pre>
394 1 Beraldo Leal
[sql]
395 20 Beraldo Leal
connection = mysql://keystone:keystonepass@192.168.69.1/keystone
396 20 Beraldo Leal
</pre>
397 21 Beraldo Leal
398 21 Beraldo Leal
Change in _*keystone.conf*_ the ADMIN_TOKEN:
399 21 Beraldo Leal
400 21 Beraldo Leal
<pre>
401 20 Beraldo Leal
admin_token = 012345SECRET99TOKEN012345
402 21 Beraldo Leal
</pre>
403 1 Beraldo Leal
404 61 Beraldo Leal
Restart the keystone service and populate with initial data:
405 22 Beraldo Leal
406 22 Beraldo Leal
<pre>
407 22 Beraldo Leal
# service keystone restart
408 22 Beraldo Leal
# keystone-manage db_sync
409 1 Beraldo Leal
</pre>
410 1 Beraldo Leal
411 1 Beraldo Leal
h2. Configuring Services to work with Keystone
412 23 Beraldo Leal
413 61 Beraldo Leal
Create the file _*/root/openstackrc*_, with theses lines
414 23 Beraldo Leal
415 23 Beraldo Leal
<pre>
416 1 Beraldo Leal
export SERVICE_ENDPOINT=http://192.168.69.1:35357/v2.0/
417 23 Beraldo Leal
export SERVICE_TOKEN=012345SECRET99TOKEN012345
418 23 Beraldo Leal
</pre>
419 23 Beraldo Leal
420 61 Beraldo Leal
Theses environment variables are useful to avoid execute commands with long args, like --token or --endpoint.
421 1 Beraldo Leal
422 61 Beraldo Leal
Reload the file:
423 23 Beraldo Leal
424 23 Beraldo Leal
<pre>
425 23 Beraldo Leal
# source /root/openstackrc
426 1 Beraldo Leal
</pre>
427 23 Beraldo Leal
428 61 Beraldo Leal
Create the *tenants*: _openstackDemo_ and _service_:
429 24 Beraldo Leal
430 24 Beraldo Leal
<pre>
431 24 Beraldo Leal
# keystone tenant-create --name openstackDemo --description "Default Tenant"  --enabled true
432 1 Beraldo Leal
# keystone tenant-create --name service --description "Service Tenant"  --enabled true
433 24 Beraldo Leal
</pre>
434 24 Beraldo Leal
435 61 Beraldo Leal
Create the *user* _admin_, replace the tenant_id by openStackDemo tenant_id:
436 27 Beraldo Leal
437 1 Beraldo Leal
<pre>
438 25 Beraldo Leal
# keystone user-create --tenant_id 9c401c9d2b9d41bcabda6919d4aec63a --name admin --pass adminpass --enabled true
439 1 Beraldo Leal
</pre>
440 1 Beraldo Leal
441 61 Beraldo Leal
Create the *roles*: _admin_ and _user_:
442 26 Beraldo Leal
443 26 Beraldo Leal
<pre>
444 1 Beraldo Leal
# keystone role-create --name admin
445 26 Beraldo Leal
# keystone role-create --name user
446 1 Beraldo Leal
</pre>
447 27 Beraldo Leal
448 61 Beraldo Leal
Grant _admin_ *role* to *user* _admin_:
449 27 Beraldo Leal
450 27 Beraldo Leal
<pre>
451 27 Beraldo Leal
# keystone user-role-add --user [admin_user_id] --tenant_id [openstackDemo_tenant_id] --role [admin_role]
452 29 Beraldo Leal
</pre>
453 29 Beraldo Leal
454 61 Beraldo Leal
Create an user to each service, replace the tenant_id by the service tenant id:
455 29 Beraldo Leal
456 29 Beraldo Leal
<pre>
457 29 Beraldo Leal
# keystone user-create --tenant_id 92920816c7704a8a95c916d34dc7a05c --name glance --pass glancepass --enabled true
458 29 Beraldo Leal
# keystone user-create --tenant_id 92920816c7704a8a95c916d34dc7a05c --name nova --pass novapass --enabled true
459 29 Beraldo Leal
# keystone user-create --tenant_id 92920816c7704a8a95c916d34dc7a05c --name swift --pass swiftpass --enabled true
460 29 Beraldo Leal
</pre>
461 29 Beraldo Leal
462 61 Beraldo Leal
Add the users of each service to admin *role*:
463 29 Beraldo Leal
464 29 Beraldo Leal
<pre>
465 29 Beraldo Leal
# keystone user-role-add --user [glance_user_id] --tenant_id [service_tenant_id] --role [admin_role]
466 1 Beraldo Leal
# keystone user-role-add --user [nova_user_id] --tenant_id [service_tenant_id] --role [admin_role]
467 29 Beraldo Leal
# keystone user-role-add --user [swift_user_id] --tenant_id [service_tenant_id] --role [admin_role]
468 25 Beraldo Leal
</pre>
469 31 Beraldo Leal
470 62 Beraldo Leal
h2. Creating the services:
471 31 Beraldo Leal
472 62 Beraldo Leal
Until now, we just created: tenants, users and roles. The Keystone manage the services and yours endpoints too. In this way, the OpenStack components query to keystone where each service is located:
473 31 Beraldo Leal
474 62 Beraldo Leal
Run the follow commands, to create the services:
475 31 Beraldo Leal
476 31 Beraldo Leal
<pre>
477 31 Beraldo Leal
# keystone service-create --name keystone --type identity --description "Keystone Identity Service" 
478 31 Beraldo Leal
# keystone service-create --name nova --type compute --description "Nova Compute Service"
479 31 Beraldo Leal
# keystone service-create --name volume --type volume --description "Nova Volume Service"
480 31 Beraldo Leal
# keystone service-create --name glance --type image --description "Glance Image Service"
481 41 Beraldo Leal
# keystone service-create --name swift --type object-store --description "Object Storage Service"
482 31 Beraldo Leal
</pre>
483 32 Beraldo Leal
484 62 Beraldo Leal
Run the follow commands, to create the endpoints of each service:
485 32 Beraldo Leal
486 32 Beraldo Leal
<pre>
487 33 Beraldo Leal
# keystone endpoint-create --region RegionOne --service_id [keystone_service_id] --publicurl http://192.168.69.1:5000/v2.0 --internalurl http://192.168.69.1:5000/v2.0 --adminurl http://192.168.69.1:35357/v2.0
488 33 Beraldo Leal
# keystone endpoint-create --region RegionOne --service_id [compute_service_id] --publicurl 'http://192.168.69.1:8774/v2/%(tenant_id)s' --internalurl 'http://192.168.69.1:8774/v2/%(tenant_id)s' --adminurl 'http://192.168.69.1:8774/v2/%(tenant_id)s'
489 1 Beraldo Leal
# keystone endpoint-create --region RegionOne --service_id [volume_service_id] --publicurl 'http://192.168.69.1:8776/v1/%(tenant_id)s' --internalurl 'http://192.168.69.1:8776/v1/%(tenant_id)s' --adminurl 'http://192.168.69.1:8776/v1/%(tenant_id)s'
490 33 Beraldo Leal
# keystone endpoint-create --region RegionOne --service_id [glance_service_id] --publicurl http://192.168.69.1:9292/v1 --internalurl http://192.168.69.1:9292/v1 --adminurl http://192.168.69.1:9292/v1
491 33 Beraldo Leal
# keystone endpoint-create --region RegionOne --service_id [swift_service_id] --publicurl 'http://192.168.69.1:8888/v1/AUTH_%(tenant_id)s' --adminurl 'http://192.168.69.1:8888/' --internalurl 'http://192.168.69.1:8888/v1/AUTH_%(tenant_id)s'
492 32 Beraldo Leal
</pre>
493 34 Beraldo Leal
494 62 Beraldo Leal
h2. Checking the keystone installation:w
495 34 Beraldo Leal
496 34 Beraldo Leal
<pre>
497 34 Beraldo Leal
# sudo apt-get install curl openssl
498 34 Beraldo Leal
</pre>
499 34 Beraldo Leal
500 62 Beraldo Leal
Do a REST request to keystone-api using curl:
501 34 Beraldo Leal
502 34 Beraldo Leal
<pre>
503 34 Beraldo Leal
# curl -d '{"auth": {"tenantName": "openstackDemo", "passwordCredentials": {"username": "admin", "password": "adminpass"}}}' -H "Content-type: application/json" http://192.168.69.1:35357/v2.0/tokens  | python -mjson.tool
504 34 Beraldo Leal
</pre>
505 34 Beraldo Leal
506 62 Beraldo Leal
The output should have the services, endpoints and a valid token for 24 hours:
507 34 Beraldo Leal
508 34 Beraldo Leal
<pre>
509 34 Beraldo Leal
{
510 34 Beraldo Leal
    "access": {
511 34 Beraldo Leal
        "serviceCatalog": [
512 34 Beraldo Leal
            {
513 34 Beraldo Leal
                "endpoints": [
514 34 Beraldo Leal
                    {
515 34 Beraldo Leal
                        "adminURL": "http://192.168.69.1:8776/v1/9c401c9d2b9d41bcabda6919d4aec63a", 
516 34 Beraldo Leal
                        "internalURL": "http://192.168.69.1:8776/v1/9c401c9d2b9d41bcabda6919d4aec63a", 
517 34 Beraldo Leal
                        "publicURL": "http://192.168.69.1:8776/v1/9c401c9d2b9d41bcabda6919d4aec63a", 
518 34 Beraldo Leal
                        "region": "RegionOne"
519 34 Beraldo Leal
                    }
520 34 Beraldo Leal
                ], 
521 34 Beraldo Leal
                "endpoints_links": [], 
522 34 Beraldo Leal
                "name": "volume", 
523 34 Beraldo Leal
                "type": "volume"
524 34 Beraldo Leal
            }, 
525 34 Beraldo Leal
            {
526 34 Beraldo Leal
                "endpoints": [
527 34 Beraldo Leal
                    {
528 34 Beraldo Leal
                        "adminURL": "http://192.168.69.1:9292/v1", 
529 34 Beraldo Leal
                        "internalURL": "http://192.168.69.1:9292/v1", 
530 34 Beraldo Leal
                        "publicURL": "http://192.168.69.1:9292/v1", 
531 34 Beraldo Leal
                        "region": "RegionOne"
532 34 Beraldo Leal
                    }
533 34 Beraldo Leal
                ], 
534 34 Beraldo Leal
                "endpoints_links": [], 
535 34 Beraldo Leal
                "name": "glance", 
536 34 Beraldo Leal
                "type": "image"
537 34 Beraldo Leal
            }, 
538 34 Beraldo Leal
            {
539 34 Beraldo Leal
                "endpoints": [
540 34 Beraldo Leal
                    {
541 34 Beraldo Leal
                        "adminURL": "http://192.168.69.1:8774/v2/9c401c9d2b9d41bcabda6919d4aec63a", 
542 34 Beraldo Leal
                        "internalURL": "http://192.168.69.1:8774/v2/9c401c9d2b9d41bcabda6919d4aec63a", 
543 34 Beraldo Leal
                        "publicURL": "http://192.168.69.1:8774/v2/9c401c9d2b9d41bcabda6919d4aec63a", 
544 34 Beraldo Leal
                        "region": "RegionOne"
545 34 Beraldo Leal
                    }
546 34 Beraldo Leal
                ], 
547 34 Beraldo Leal
                "endpoints_links": [], 
548 34 Beraldo Leal
                "name": "nova", 
549 34 Beraldo Leal
                "type": "compute"
550 34 Beraldo Leal
            }, 
551 34 Beraldo Leal
            {
552 34 Beraldo Leal
                "endpoints": [
553 34 Beraldo Leal
                    {
554 34 Beraldo Leal
                        "adminURL": "http://192.168.69.1:35357/v2.0", 
555 34 Beraldo Leal
                        "internalURL": "http://192.168.69.1:5000/v2.0", 
556 34 Beraldo Leal
                        "publicURL": "http://192.168.69.1:5000/v2.0", 
557 34 Beraldo Leal
                        "region": "RegionOne"
558 34 Beraldo Leal
                    }
559 34 Beraldo Leal
                ], 
560 34 Beraldo Leal
                "endpoints_links": [], 
561 34 Beraldo Leal
                "name": "keystone", 
562 34 Beraldo Leal
                "type": "identity"
563 34 Beraldo Leal
            }, 
564 34 Beraldo Leal
            {
565 34 Beraldo Leal
                "endpoints": [
566 34 Beraldo Leal
                    {
567 34 Beraldo Leal
                        "adminURL": "http://192.168.69.1:8888/", 
568 34 Beraldo Leal
                        "internalURL": "http://192.168.69.1:8888/v1/AUTH_9c401c9d2b9d41bcabda6919d4aec63a", 
569 34 Beraldo Leal
                        "publicURL": "http://192.168.69.1:8888/v1/AUTH_9c401c9d2b9d41bcabda6919d4aec63a", 
570 34 Beraldo Leal
                        "region": "RegionOne"
571 34 Beraldo Leal
                    }
572 34 Beraldo Leal
                ], 
573 34 Beraldo Leal
                "endpoints_links": [], 
574 34 Beraldo Leal
                "name": "swift", 
575 41 Beraldo Leal
                "type": "object-store"
576 34 Beraldo Leal
            }
577 34 Beraldo Leal
        ], 
578 34 Beraldo Leal
        "token": {
579 34 Beraldo Leal
            "expires": "2012-06-08T15:31:46Z", 
580 34 Beraldo Leal
            "id": "05b818ff23564d5599c97ea5e1df7bbe", 
581 34 Beraldo Leal
            "tenant": {
582 34 Beraldo Leal
                "description": "Default Tenant", 
583 34 Beraldo Leal
                "enabled": true, 
584 34 Beraldo Leal
                "id": "9c401c9d2b9d41bcabda6919d4aec63a", 
585 34 Beraldo Leal
                "name": "openstackDemo"
586 34 Beraldo Leal
            }
587 34 Beraldo Leal
        }, 
588 34 Beraldo Leal
        "user": {
589 34 Beraldo Leal
            "id": "1fcfbe778fc3428aa30db782056b34d7", 
590 34 Beraldo Leal
            "name": "admin", 
591 34 Beraldo Leal
            "roles": [
592 34 Beraldo Leal
                {
593 34 Beraldo Leal
                    "id": "a2d6da77c0a54105aab94484e0d2088b", 
594 34 Beraldo Leal
                    "name": "admin"
595 34 Beraldo Leal
                }
596 34 Beraldo Leal
            ], 
597 34 Beraldo Leal
            "roles_links": [], 
598 34 Beraldo Leal
            "username": "admin"
599 34 Beraldo Leal
        }
600 34 Beraldo Leal
    }
601 34 Beraldo Leal
}
602 34 Beraldo Leal
603 34 Beraldo Leal
</pre>
604 36 Beraldo Leal
605 62 Beraldo Leal
You can list users, roles, tenants and services:
606 36 Beraldo Leal
607 36 Beraldo Leal
<pre>
608 36 Beraldo Leal
# keystone user-list
609 39 Beraldo Leal
+----------------------------------+---------+-------+--------+
610 39 Beraldo Leal
|                id                | enabled | email |  name  |
611 39 Beraldo Leal
+----------------------------------+---------+-------+--------+
612 39 Beraldo Leal
| 029c5749548946f7b560b2706d31d488 | True    | None  | glance |
613 39 Beraldo Leal
| 1fcfbe778fc3428aa30db782056b34d7 | True    | None  | admin  |
614 39 Beraldo Leal
| 4b75079aeb1b408ebdb286bfb85e719f | True    | None  | swift  |
615 39 Beraldo Leal
| e25f81d50eb84bdb92907adbd0e41f25 | True    | None  | nova   |
616 39 Beraldo Leal
+----------------------------------+---------+-------+--------+
617 40 Beraldo Leal
</pre>
618 39 Beraldo Leal
619 40 Beraldo Leal
<pre>
620 36 Beraldo Leal
# keystone role-list
621 39 Beraldo Leal
+----------------------------------+-------+
622 39 Beraldo Leal
|                id                |  name |
623 39 Beraldo Leal
+----------------------------------+-------+
624 39 Beraldo Leal
| 845e83e4d9bf4d8d8188b1e261dfe103 | user  |
625 39 Beraldo Leal
| a2d6da77c0a54105aab94484e0d2088b | admin |
626 39 Beraldo Leal
+----------------------------------+-------+
627 40 Beraldo Leal
</pre>
628 1 Beraldo Leal
629 40 Beraldo Leal
<pre>
630 36 Beraldo Leal
# keystone tenant-list
631 39 Beraldo Leal
+----------------------------------+---------------+---------+
632 39 Beraldo Leal
|                id                |      name     | enabled |
633 39 Beraldo Leal
+----------------------------------+---------------+---------+
634 39 Beraldo Leal
| 92920816c7704a8a95c916d34dc7a05c | service       | True    |
635 39 Beraldo Leal
| 9c401c9d2b9d41bcabda6919d4aec63a | openstackDemo | True    |
636 1 Beraldo Leal
+----------------------------------+---------------+---------+
637 40 Beraldo Leal
</pre>
638 1 Beraldo Leal
639 40 Beraldo Leal
<pre>
640 36 Beraldo Leal
# keystone service-list
641 39 Beraldo Leal
+----------------------------------+----------+----------------+---------------------------+
642 39 Beraldo Leal
|                id                |   name   |      type      |        description        |
643 39 Beraldo Leal
+----------------------------------+----------+----------------+---------------------------+
644 39 Beraldo Leal
| 00486163c7c64c6a86f577627071aafc | nova     | compute        | Nova Compute Service      |
645 39 Beraldo Leal
| 69d3a6b21c9348acb1042d7d9386ff81 | volume   | volume         | Nova Volume Service       |
646 39 Beraldo Leal
| 7b09782f9faf448781f5a460acabe258 | swift    | object-store   | Object Storage Service    |
647 39 Beraldo Leal
| d6b32583a6694e9b828b2a50037623ba | keystone | identity       | Keystone Identity Service |
648 39 Beraldo Leal
| f7f964a71e2a45119dcaede68fafbd78 | glance   | image          | Glance Image Service      |
649 36 Beraldo Leal
+----------------------------------+----------+----------------+---------------------------+
650 38 Beraldo Leal
</pre>
651 38 Beraldo Leal
652 42 Beraldo Leal
h1. Installing OpenStack Object Storage - Swift
653 1 Beraldo Leal
654 63 Beraldo Leal
OpenStack Object Storage (Swift) is a system to store objects in a massively
655 63 Beraldo Leal
scalable large capacity system with built-in redundancy and failover. Object
656 63 Beraldo Leal
Storage has a variety of applications, such as backing up or archiving data,
657 63 Beraldo Leal
serving graphics or videos (streaming data to a user's browser), storing
658 63 Beraldo Leal
secondary or tertiary static data, developing new applications with data
659 63 Beraldo Leal
storage integration, storing data when predicting storage capacity is difficult,
660 63 Beraldo Leal
and creating the elasticity and flexibility of cloud-based storage for your web
661 63 Beraldo Leal
applications.
662 1 Beraldo Leal
663 63 Beraldo Leal
In this environment we use the same controller node as storage too. So the swift and swift-proxy is installed in the controller-node.
664 44 Beraldo Leal
665 63 Beraldo Leal
Install the swift and dependencies:
666 44 Beraldo Leal
667 1 Beraldo Leal
<pre>
668 1 Beraldo Leal
# apt-get install swift python-xattr python-memcache rsync memcached python-netifaces
669 44 Beraldo Leal
</pre>
670 44 Beraldo Leal
671 44 Beraldo Leal
672 63 Beraldo Leal
Unfortunately at the time of writing this manual swift package not automates some tasks, such as the creation of configuration files. We have to do this manually:
673 63 Beraldo Leal
674 44 Beraldo Leal
<pre>
675 44 Beraldo Leal
# mkdir /etc/swift
676 44 Beraldo Leal
</pre>
677 44 Beraldo Leal
678 63 Beraldo Leal
Create the config file _/etc/swift/swift.conf_:
679 1 Beraldo Leal
680 44 Beraldo Leal
<pre>
681 1 Beraldo Leal
[swift-hash]
682 1 Beraldo Leal
# random unique string that can never change (DO NOT LOSE)
683 44 Beraldo Leal
swift_hash_path_suffix = fLIbertYgibbitZ
684 44 Beraldo Leal
</pre>
685 44 Beraldo Leal
686 63 Beraldo Leal
h2. Install and configure the "object-nodes"
687 44 Beraldo Leal
688 63 Beraldo Leal
In this case, the object-nodes (computer when data are stored) is the same cloud-controller.
689 63 Beraldo Leal
690 44 Beraldo Leal
<pre>
691 44 Beraldo Leal
# apt-get install swift-account swift-container swift-object xfsprogs
692 44 Beraldo Leal
</pre>
693 1 Beraldo Leal
694 63 Beraldo Leal
Each "Object node" can have many devices Is a requisite use xfs file system.
695 44 Beraldo Leal
696 44 Beraldo Leal
<pre>
697 44 Beraldo Leal
# fdisk /dev/sdb (set up a single partition)
698 44 Beraldo Leal
# mkfs.xfs -i size=1024 /dev/sdb1
699 44 Beraldo Leal
</pre>
700 44 Beraldo Leal
701 1 Beraldo Leal
702 63 Beraldo Leal
This device should be mount at /srv/node/
703 44 Beraldo Leal
704 44 Beraldo Leal
<pre>
705 44 Beraldo Leal
echo "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab
706 44 Beraldo Leal
mkdir -p /srv/node/sdb1
707 44 Beraldo Leal
mount /srv/node/sdb1
708 44 Beraldo Leal
chown -R swift:swift /srv/node
709 44 Beraldo Leal
</pre>
710 44 Beraldo Leal
711 63 Beraldo Leal
h2. Configure the _rsyncd.conf_
712 44 Beraldo Leal
713 44 Beraldo Leal
<pre>
714 44 Beraldo Leal
uid = swift
715 44 Beraldo Leal
gid = swift
716 44 Beraldo Leal
log file = /var/log/rsyncd.log
717 44 Beraldo Leal
pid file = /var/run/rsyncd.pid
718 44 Beraldo Leal
address = 192.168.69.1
719 44 Beraldo Leal
720 44 Beraldo Leal
[account]
721 44 Beraldo Leal
max connections = 2
722 44 Beraldo Leal
path = /srv/node/
723 44 Beraldo Leal
read only = false
724 44 Beraldo Leal
lock file = /var/lock/account.lock
725 44 Beraldo Leal
726 44 Beraldo Leal
[container]
727 44 Beraldo Leal
max connections = 2
728 1 Beraldo Leal
path = /srv/node/
729 44 Beraldo Leal
read only = false
730 44 Beraldo Leal
lock file = /var/lock/container.lock
731 44 Beraldo Leal
732 44 Beraldo Leal
[object]
733 1 Beraldo Leal
max connections = 2
734 44 Beraldo Leal
path = /srv/node/
735 44 Beraldo Leal
read only = false
736 44 Beraldo Leal
lock file = /var/lock/object.lock
737 44 Beraldo Leal
</pre>
738 1 Beraldo Leal
739 63 Beraldo Leal
Edit the _/etc/default/rsync_:
740 44 Beraldo Leal
741 44 Beraldo Leal
<pre>
742 44 Beraldo Leal
RSYNC_ENABLE = true
743 44 Beraldo Leal
</pre>
744 44 Beraldo Leal
745 63 Beraldo Leal
Restart the rsync:
746 44 Beraldo Leal
747 44 Beraldo Leal
<pre>
748 44 Beraldo Leal
service rsync restart
749 44 Beraldo Leal
</pre>
750 44 Beraldo Leal
751 63 Beraldo Leal
Create the _/etc/swift/account-server.conf_:
752 44 Beraldo Leal
753 44 Beraldo Leal
<pre>
754 44 Beraldo Leal
[DEFAULT]
755 44 Beraldo Leal
bind_ip = 192.168.69.1
756 44 Beraldo Leal
workers = 2
757 1 Beraldo Leal
758 44 Beraldo Leal
[pipeline:main]
759 44 Beraldo Leal
pipeline = account-server
760 44 Beraldo Leal
761 44 Beraldo Leal
[app:account-server]
762 44 Beraldo Leal
use = egg:swift#account
763 44 Beraldo Leal
764 44 Beraldo Leal
[account-replicator]
765 44 Beraldo Leal
766 44 Beraldo Leal
[account-auditor]
767 44 Beraldo Leal
768 44 Beraldo Leal
[account-reaper]
769 44 Beraldo Leal
</pre>
770 44 Beraldo Leal
771 63 Beraldo Leal
Create the _/etc/swift/container-server.conf_:
772 44 Beraldo Leal
773 44 Beraldo Leal
<pre>
774 44 Beraldo Leal
[DEFAULT]
775 44 Beraldo Leal
bind_ip = 192.168.69.1
776 1 Beraldo Leal
workers = 2
777 44 Beraldo Leal
778 44 Beraldo Leal
[pipeline:main]
779 44 Beraldo Leal
pipeline = container-server
780 44 Beraldo Leal
781 44 Beraldo Leal
[app:container-server]
782 44 Beraldo Leal
use = egg:swift#container
783 44 Beraldo Leal
784 44 Beraldo Leal
[container-replicator]
785 44 Beraldo Leal
786 44 Beraldo Leal
[container-updater]
787 44 Beraldo Leal
788 44 Beraldo Leal
[container-auditor]
789 44 Beraldo Leal
</pre>
790 44 Beraldo Leal
791 63 Beraldo Leal
Create the _/etc/swift/object-server.conf_:
792 44 Beraldo Leal
793 44 Beraldo Leal
<pre>
794 44 Beraldo Leal
[DEFAULT]
795 44 Beraldo Leal
bind_ip = 192.168.69.1
796 1 Beraldo Leal
workers = 2
797 44 Beraldo Leal
798 1 Beraldo Leal
[pipeline:main]
799 1 Beraldo Leal
pipeline = object-server
800 1 Beraldo Leal
801 1 Beraldo Leal
[app:object-server]
802 44 Beraldo Leal
use = egg:swift#object
803 44 Beraldo Leal
804 44 Beraldo Leal
[object-replicator]
805 1 Beraldo Leal
806 44 Beraldo Leal
[object-updater]
807 44 Beraldo Leal
808 44 Beraldo Leal
[object-auditor]
809 44 Beraldo Leal
</pre>
810 44 Beraldo Leal
811 1 Beraldo Leal
812 63 Beraldo Leal
h2. Installing and configuring the swift-proxy
813 44 Beraldo Leal
814 63 Beraldo Leal
The swift-proxy is the component that acts like a proxy, so you can have multiple object-nodes and one swift-proxy. When an user or openStack component need get a object, its ask for swift-proxy.
815 63 Beraldo Leal
816 63 Beraldo Leal
Install swift-proxy:
817 63 Beraldo Leal
818 1 Beraldo Leal
<pre>
819 44 Beraldo Leal
# apt-get install swift-proxy memcached
820 44 Beraldo Leal
</pre>
821 44 Beraldo Leal
822 63 Beraldo Leal
Create a self-sign SSL certificate:
823 1 Beraldo Leal
824 44 Beraldo Leal
<pre>
825 44 Beraldo Leal
cd /etc/swift
826 44 Beraldo Leal
openssl req -new -x509 -nodes -out cert.crt -keyout cert.key
827 44 Beraldo Leal
</pre>
828 44 Beraldo Leal
829 63 Beraldo Leal
Change the memcached to listen in correct interface, change the /etc/memcached.conf:
830 44 Beraldo Leal
831 44 Beraldo Leal
<pre>
832 44 Beraldo Leal
-l 127.0.0.1
833 44 Beraldo Leal
to
834 44 Beraldo Leal
-l 192.168.69.1
835 44 Beraldo Leal
</pre>
836 44 Beraldo Leal
837 63 Beraldo Leal
Restart the memcached:
838 44 Beraldo Leal
839 44 Beraldo Leal
<pre>
840 44 Beraldo Leal
service memcached restart
841 44 Beraldo Leal
</pre>
842 44 Beraldo Leal
843 63 Beraldo Leal
Create the file _/etc/swift/proxy-server.conf_:
844 44 Beraldo Leal
845 44 Beraldo Leal
<pre>
846 44 Beraldo Leal
[DEFAULT]
847 44 Beraldo Leal
bind_port = 8888
848 44 Beraldo Leal
user = swift
849 44 Beraldo Leal
850 44 Beraldo Leal
[pipeline:main]
851 44 Beraldo Leal
pipeline = catch_errors healthcheck cache authtoken keystone proxy-server
852 44 Beraldo Leal
853 44 Beraldo Leal
[app:proxy-server]
854 44 Beraldo Leal
use = egg:swift#proxy
855 44 Beraldo Leal
account_autocreate = true
856 44 Beraldo Leal
857 44 Beraldo Leal
[filter:keystone]
858 44 Beraldo Leal
paste.filter_factory = keystone.middleware.swift_auth:filter_factory
859 44 Beraldo Leal
operator_roles = admin, swiftoperator
860 44 Beraldo Leal
861 44 Beraldo Leal
[filter:authtoken]
862 44 Beraldo Leal
paste.filter_factory = keystone.middleware.auth_token:filter_factory
863 44 Beraldo Leal
# Delaying the auth decision is required to support token-less
864 44 Beraldo Leal
# usage for anonymous referrers ('.r:*').
865 44 Beraldo Leal
delay_auth_decision = 10
866 44 Beraldo Leal
service_port = 5000
867 44 Beraldo Leal
service_host = 192.168.69.1
868 44 Beraldo Leal
auth_port = 35357
869 44 Beraldo Leal
auth_host = 192.168.69.1
870 44 Beraldo Leal
auth_token = 012345SECRET99TOKEN012345
871 44 Beraldo Leal
admin_token = 012345SECRET99TOKEN012345
872 44 Beraldo Leal
auth_protocol = http
873 44 Beraldo Leal
874 44 Beraldo Leal
[filter:cache]
875 44 Beraldo Leal
use = egg:swift#memcache
876 44 Beraldo Leal
set log_name = cache
877 44 Beraldo Leal
878 44 Beraldo Leal
[filter:catch_errors]
879 44 Beraldo Leal
use = egg:swift#catch_errors
880 44 Beraldo Leal
881 44 Beraldo Leal
[filter:healthcheck]
882 1 Beraldo Leal
use = egg:swift#healthcheck
883 44 Beraldo Leal
</pre>
884 44 Beraldo Leal
885 45 Beraldo Leal
886 45 Beraldo Leal
Create the account, container and object rings. The builder command is basically creating a builder file with a few parameters. The parameter with the value of 18 represents 2 ^ 18th, the value that the partition will be sized to. Set this "partition power" value based on the total amount of storage you expect your entire ring to use. The value of 1 represents the number of replicas of each object, with the last value being the number of hours to restrict moving a partition more than once.
887 45 Beraldo Leal
888 45 Beraldo Leal
<pre>
889 45 Beraldo Leal
cd /etc/swift
890 45 Beraldo Leal
swift-ring-builder account.builder create 18 1 1
891 45 Beraldo Leal
swift-ring-builder container.builder create 18 1 1
892 45 Beraldo Leal
swift-ring-builder object.builder create 18 1 1
893 45 Beraldo Leal
</pre>
894 45 Beraldo Leal
895 45 Beraldo Leal
For every storage device on each node add entries to each ring:
896 45 Beraldo Leal
897 45 Beraldo Leal
<pre>
898 45 Beraldo Leal
swift-ring-builder account.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP>:6002/<DEVICE> 100
899 45 Beraldo Leal
swift-ring-builder container.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP_1>:6001/<DEVICE> 100
900 45 Beraldo Leal
swift-ring-builder object.builder add z<ZONE>-<STORAGE_LOCAL_NET_IP_1>:6000/<DEVICE> 100
901 45 Beraldo Leal
</pre>
902 45 Beraldo Leal
903 63 Beraldo Leal
In our case, we have only one zone in one storage node with one device (sdb1), so the command should be:
904 45 Beraldo Leal
905 1 Beraldo Leal
<pre>
906 45 Beraldo Leal
swift-ring-builder account.builder add z1-192.168.69.1:6002/sdb1 100
907 45 Beraldo Leal
swift-ring-builder container.builder add z1-192.168.69.1:6001/sdb1 100
908 45 Beraldo Leal
swift-ring-builder object.builder add z1-192.168.69.1:6000/sdb1 100
909 45 Beraldo Leal
</pre>
910 1 Beraldo Leal
911 45 Beraldo Leal
Verify the ring contents for each ring:
912 45 Beraldo Leal
913 45 Beraldo Leal
<pre>
914 45 Beraldo Leal
swift-ring-builder account.builder
915 1 Beraldo Leal
swift-ring-builder container.builder
916 45 Beraldo Leal
swift-ring-builder object.builder
917 45 Beraldo Leal
</pre>
918 45 Beraldo Leal
919 45 Beraldo Leal
Rebalance the rings:
920 45 Beraldo Leal
921 45 Beraldo Leal
<pre>
922 1 Beraldo Leal
swift-ring-builder account.builder rebalance
923 1 Beraldo Leal
swift-ring-builder container.builder rebalance
924 45 Beraldo Leal
swift-ring-builder object.builder rebalance
925 45 Beraldo Leal
</pre>
926 44 Beraldo Leal
927 63 Beraldo Leal
Change the permissions of config files:
928 44 Beraldo Leal
929 44 Beraldo Leal
<pre>
930 45 Beraldo Leal
# chown -R swift:swift /etc/swift/
931 45 Beraldo Leal
</pre>
932 45 Beraldo Leal
933 63 Beraldo Leal
Start the swift-proxy:
934 45 Beraldo Leal
935 45 Beraldo Leal
<pre>
936 1 Beraldo Leal
swift-init proxy start
937 45 Beraldo Leal
</pre>
938 45 Beraldo Leal
939 63 Beraldo Leal
Start all swift services:
940 45 Beraldo Leal
941 1 Beraldo Leal
<pre>
942 45 Beraldo Leal
swift-init main start
943 45 Beraldo Leal
swift-init rest start
944 45 Beraldo Leal
</pre>
945 45 Beraldo Leal
946 1 Beraldo Leal
947 63 Beraldo Leal
h2. Checking the installation
948 45 Beraldo Leal
949 63 Beraldo Leal
The file _/root/openstackrc_ will receive more environment variables:
950 45 Beraldo Leal
951 1 Beraldo Leal
<pre>
952 45 Beraldo Leal
# Used for Keystone
953 45 Beraldo Leal
export SERVICE_ENDPOINT=http://192.168.69.1:35357/v2.0/
954 45 Beraldo Leal
export SERVICE_TOKEN=012345SECRET99TOKEN012345
955 45 Beraldo Leal
956 45 Beraldo Leal
# Used for swift
957 1 Beraldo Leal
export ST_AUTH=http://192.168.69.1:5000/v2.0
958 1 Beraldo Leal
export ST_USER=openstackDemo:admin
959 45 Beraldo Leal
export ST_KEY=adminpass
960 45 Beraldo Leal
export OS_REGION_NAME=RegionOne
961 45 Beraldo Leal
</pre>
962 45 Beraldo Leal
963 63 Beraldo Leal
Reload the file:
964 45 Beraldo Leal
965 45 Beraldo Leal
<pre>
966 45 Beraldo Leal
# source /root/openstackrc
967 45 Beraldo Leal
</pre>
968 45 Beraldo Leal
969 63 Beraldo Leal
Try to get swift status, with the command:
970 45 Beraldo Leal
971 45 Beraldo Leal
<pre>
972 45 Beraldo Leal
# swift -V 2.0 stat
973 45 Beraldo Leal
</pre>
974 45 Beraldo Leal
975 63 Beraldo Leal
List the containers:
976 45 Beraldo Leal
977 45 Beraldo Leal
<pre>
978 45 Beraldo Leal
# swift -V 2.0 list
979 46 Beraldo Leal
</pre>
980 46 Beraldo Leal
981 63 Beraldo Leal
Do some upload files:
982 45 Beraldo Leal
983 46 Beraldo Leal
<pre>
984 46 Beraldo Leal
# swift -V 2.0 upload myfiles bigfile1.tgz
985 46 Beraldo Leal
# swift -V 2.0 upload myfiles bigfile2.tgz
986 46 Beraldo Leal
</pre>
987 46 Beraldo Leal
988 63 Beraldo Leal
Download the container "myfiles":
989 63 Beraldo Leal
990 46 Beraldo Leal
<pre>
991 46 Beraldo Leal
# cd /tmp/
992 46 Beraldo Leal
# swift -V 2.0 download myfiles
993 46 Beraldo Leal
</pre>
994 47 Beraldo Leal
995 47 Beraldo Leal
h1. Installing OpenStack Image Service - Glance
996 47 Beraldo Leal
997 64 Beraldo Leal
OpenStack Image Service (Glance) is a lookup and retrieval system for virtual
998 64 Beraldo Leal
machine images. It can be configured in three ways: using OpenStack Object Store
999 64 Beraldo Leal
to store images; using Amazon's Simple Storage Solution (S3) storage directly;
1000 64 Beraldo Leal
or using S3 storage with Object Store as the intermediate for S3 access.
1001 47 Beraldo Leal
1002 64 Beraldo Leal
Install the glance on the controller node:
1003 47 Beraldo Leal
1004 47 Beraldo Leal
<pre>
1005 1 Beraldo Leal
# apt-get install glance
1006 47 Beraldo Leal
</pre>
1007 47 Beraldo Leal
1008 64 Beraldo Leal
Remove the sqlite file:
1009 47 Beraldo Leal
1010 47 Beraldo Leal
<pre>
1011 47 Beraldo Leal
# rm /var/lib/glance/glance.sqlite
1012 47 Beraldo Leal
</pre>
1013 47 Beraldo Leal
1014 47 Beraldo Leal
h2. Configuring the Image Service database backend
1015 47 Beraldo Leal
1016 47 Beraldo Leal
<pre>
1017 47 Beraldo Leal
# mysql -u root -p
1018 1 Beraldo Leal
mysql> CREATE DATABASE glance;
1019 74 Beraldo Leal
mysql> CREATE USER glance;
1020 74 Beraldo Leal
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glancepass';
1021 47 Beraldo Leal
mysql> FLUSH PRIVILEGES;
1022 1 Beraldo Leal
mysql> quit;
1023 47 Beraldo Leal
</pre>
1024 47 Beraldo Leal
1025 64 Beraldo Leal
Copy the config files to _/etc/glance/_:
1026 47 Beraldo Leal
1027 47 Beraldo Leal
*/etc/glance/glance-api.conf*:
1028 47 Beraldo Leal
<pre>
1029 47 Beraldo Leal
[DEFAULT]
1030 47 Beraldo Leal
# Show more verbose log output (sets INFO log level output)
1031 47 Beraldo Leal
verbose = True
1032 47 Beraldo Leal
1033 47 Beraldo Leal
# Show debugging output in logs (sets DEBUG log level output)
1034 47 Beraldo Leal
debug = False
1035 47 Beraldo Leal
1036 47 Beraldo Leal
# Which backend store should Glance use by default is not specified
1037 47 Beraldo Leal
# in a request to add a new image to Glance? Default: 'file'
1038 47 Beraldo Leal
# Available choices are 'file', 'swift', and 's3'
1039 47 Beraldo Leal
default_store = swift
1040 47 Beraldo Leal
1041 47 Beraldo Leal
# Address to bind the API server
1042 47 Beraldo Leal
bind_host = 0.0.0.0
1043 47 Beraldo Leal
1044 47 Beraldo Leal
# Port the bind the API server to
1045 47 Beraldo Leal
bind_port = 9292
1046 47 Beraldo Leal
1047 47 Beraldo Leal
# Log to this file. Make sure you do not set the same log
1048 47 Beraldo Leal
# file for both the API and registry servers!
1049 47 Beraldo Leal
log_file = /var/log/glance/api.log
1050 47 Beraldo Leal
1051 47 Beraldo Leal
# Backlog requests when creating socket
1052 47 Beraldo Leal
backlog = 4096
1053 47 Beraldo Leal
1054 47 Beraldo Leal
# Number of Glance API worker processes to start.
1055 47 Beraldo Leal
# On machines with more than one CPU increasing this value
1056 47 Beraldo Leal
# may improve performance (especially if using SSL with
1057 47 Beraldo Leal
# compression turned on). It is typically recommended to set
1058 47 Beraldo Leal
# this value to the number of CPUs present on your machine.
1059 47 Beraldo Leal
workers = 0
1060 47 Beraldo Leal
1061 47 Beraldo Leal
# Role used to identify an authenticated user as administrator
1062 47 Beraldo Leal
#admin_role = admin
1063 47 Beraldo Leal
1064 47 Beraldo Leal
# ================= Syslog Options ============================
1065 47 Beraldo Leal
1066 47 Beraldo Leal
# Send logs to syslog (/dev/log) instead of to file specified
1067 47 Beraldo Leal
# by `log_file`
1068 47 Beraldo Leal
use_syslog = False
1069 47 Beraldo Leal
1070 47 Beraldo Leal
# Facility to use. If unset defaults to LOG_USER.
1071 47 Beraldo Leal
# syslog_log_facility = LOG_LOCAL0
1072 47 Beraldo Leal
1073 47 Beraldo Leal
# ================= SSL Options ===============================
1074 47 Beraldo Leal
1075 47 Beraldo Leal
# Certificate file to use when starting API server securely
1076 47 Beraldo Leal
# cert_file = /path/to/certfile
1077 47 Beraldo Leal
1078 47 Beraldo Leal
# Private key file to use when starting API server securely
1079 47 Beraldo Leal
# key_file = /path/to/keyfile
1080 47 Beraldo Leal
1081 47 Beraldo Leal
# ================= Security Options ==========================
1082 47 Beraldo Leal
1083 47 Beraldo Leal
# AES key for encrypting store 'location' metadata, including
1084 47 Beraldo Leal
# -- if used -- Swift or S3 credentials
1085 47 Beraldo Leal
# Should be set to a random string of length 16, 24 or 32 bytes
1086 47 Beraldo Leal
# metadata_encryption_key = <16, 24 or 32 char registry metadata key>
1087 47 Beraldo Leal
1088 47 Beraldo Leal
# ============ Registry Options ===============================
1089 47 Beraldo Leal
1090 47 Beraldo Leal
# Address to find the registry server
1091 47 Beraldo Leal
registry_host = 0.0.0.0
1092 47 Beraldo Leal
1093 47 Beraldo Leal
# Port the registry server is listening on
1094 47 Beraldo Leal
registry_port = 9191
1095 47 Beraldo Leal
1096 47 Beraldo Leal
# What protocol to use when connecting to the registry server?
1097 47 Beraldo Leal
# Set to https for secure HTTP communication
1098 47 Beraldo Leal
registry_client_protocol = http
1099 47 Beraldo Leal
1100 47 Beraldo Leal
# The path to the key file to use in SSL connections to the
1101 47 Beraldo Leal
# registry server, if any. Alternately, you may set the
1102 47 Beraldo Leal
# GLANCE_CLIENT_KEY_FILE environ variable to a filepath of the key file
1103 47 Beraldo Leal
# registry_client_key_file = /path/to/key/file
1104 47 Beraldo Leal
1105 47 Beraldo Leal
# The path to the cert file to use in SSL connections to the
1106 47 Beraldo Leal
# registry server, if any. Alternately, you may set the
1107 47 Beraldo Leal
# GLANCE_CLIENT_CERT_FILE environ variable to a filepath of the cert file
1108 47 Beraldo Leal
# registry_client_cert_file = /path/to/cert/file
1109 47 Beraldo Leal
1110 47 Beraldo Leal
# The path to the certifying authority cert file to use in SSL connections
1111 47 Beraldo Leal
# to the registry server, if any. Alternately, you may set the
1112 47 Beraldo Leal
# GLANCE_CLIENT_CA_FILE environ variable to a filepath of the CA cert file
1113 47 Beraldo Leal
# registry_client_ca_file = /path/to/ca/file
1114 47 Beraldo Leal
1115 47 Beraldo Leal
# ============ Notification System Options =====================
1116 47 Beraldo Leal
1117 47 Beraldo Leal
# Notifications can be sent when images are create, updated or deleted.
1118 47 Beraldo Leal
# There are three methods of sending notifications, logging (via the
1119 47 Beraldo Leal
# log_file directive), rabbit (via a rabbitmq queue), qpid (via a Qpid
1120 47 Beraldo Leal
# message queue), or noop (no notifications sent, the default)
1121 47 Beraldo Leal
notifier_strategy = noop
1122 47 Beraldo Leal
1123 47 Beraldo Leal
# Configuration options if sending notifications via rabbitmq (these are
1124 47 Beraldo Leal
# the defaults)
1125 47 Beraldo Leal
rabbit_host = localhost
1126 47 Beraldo Leal
rabbit_port = 5672
1127 47 Beraldo Leal
rabbit_use_ssl = false
1128 47 Beraldo Leal
rabbit_userid = guest
1129 47 Beraldo Leal
rabbit_password = guest
1130 47 Beraldo Leal
rabbit_virtual_host = /
1131 47 Beraldo Leal
rabbit_notification_exchange = glance
1132 47 Beraldo Leal
rabbit_notification_topic = glance_notifications
1133 47 Beraldo Leal
1134 47 Beraldo Leal
# Configuration options if sending notifications via Qpid (these are
1135 47 Beraldo Leal
# the defaults)
1136 47 Beraldo Leal
qpid_notification_exchange = glance
1137 47 Beraldo Leal
qpid_notification_topic = glance_notifications
1138 47 Beraldo Leal
qpid_host = localhost
1139 47 Beraldo Leal
qpid_port = 5672
1140 47 Beraldo Leal
qpid_username =
1141 47 Beraldo Leal
qpid_password =
1142 47 Beraldo Leal
qpid_sasl_mechanisms =
1143 47 Beraldo Leal
qpid_reconnect_timeout = 0
1144 47 Beraldo Leal
qpid_reconnect_limit = 0
1145 47 Beraldo Leal
qpid_reconnect_interval_min = 0
1146 47 Beraldo Leal
qpid_reconnect_interval_max = 0
1147 47 Beraldo Leal
qpid_reconnect_interval = 0
1148 47 Beraldo Leal
qpid_heartbeat = 5
1149 47 Beraldo Leal
# Set to 'ssl' to enable SSL
1150 47 Beraldo Leal
qpid_protocol = tcp
1151 47 Beraldo Leal
qpid_tcp_nodelay = True
1152 47 Beraldo Leal
1153 47 Beraldo Leal
# ============ Filesystem Store Options ========================
1154 47 Beraldo Leal
1155 47 Beraldo Leal
# Directory that the Filesystem backend store
1156 47 Beraldo Leal
# writes image data to
1157 47 Beraldo Leal
filesystem_store_datadir = /var/lib/glance/images/
1158 47 Beraldo Leal
1159 47 Beraldo Leal
# ============ Swift Store Options =============================
1160 47 Beraldo Leal
1161 47 Beraldo Leal
# Version of the authentication service to use
1162 47 Beraldo Leal
# Valid versions are '2' for keystone and '1' for swauth and rackspace
1163 47 Beraldo Leal
swift_store_auth_version = 2
1164 47 Beraldo Leal
1165 47 Beraldo Leal
# Address where the Swift authentication service lives
1166 47 Beraldo Leal
# Valid schemes are 'http://' and 'https://'
1167 47 Beraldo Leal
# If no scheme specified,  default to 'https://'
1168 47 Beraldo Leal
# For swauth, use something like '127.0.0.1:8080/v1.0/'
1169 47 Beraldo Leal
swift_store_auth_address = http://192.168.69.1:35357/v2.0/
1170 47 Beraldo Leal
1171 47 Beraldo Leal
# User to authenticate against the Swift authentication service
1172 47 Beraldo Leal
# If you use Swift authentication service, set it to 'account':'user'
1173 47 Beraldo Leal
# where 'account' is a Swift storage account and 'user'
1174 47 Beraldo Leal
# is a user in that account
1175 47 Beraldo Leal
swift_store_user = service:glance
1176 47 Beraldo Leal
1177 47 Beraldo Leal
# Auth key for the user authenticating against the
1178 47 Beraldo Leal
# Swift authentication service
1179 47 Beraldo Leal
swift_store_key = glancepass
1180 47 Beraldo Leal
1181 47 Beraldo Leal
# Container within the account that the account should use
1182 47 Beraldo Leal
# for storing images in Swift
1183 47 Beraldo Leal
swift_store_container = glance
1184 47 Beraldo Leal
1185 47 Beraldo Leal
# Do we create the container if it does not exist?
1186 47 Beraldo Leal
swift_store_create_container_on_put = True
1187 47 Beraldo Leal
1188 47 Beraldo Leal
# What size, in MB, should Glance start chunking image files
1189 47 Beraldo Leal
# and do a large object manifest in Swift? By default, this is
1190 47 Beraldo Leal
# the maximum object size in Swift, which is 5GB
1191 47 Beraldo Leal
swift_store_large_object_size = 5120
1192 47 Beraldo Leal
1193 47 Beraldo Leal
# When doing a large object manifest, what size, in MB, should
1194 47 Beraldo Leal
# Glance write chunks to Swift? This amount of data is written
1195 47 Beraldo Leal
# to a temporary disk buffer during the process of chunking
1196 47 Beraldo Leal
# the image file, and the default is 200MB
1197 47 Beraldo Leal
swift_store_large_object_chunk_size = 200
1198 47 Beraldo Leal
1199 47 Beraldo Leal
# Whether to use ServiceNET to communicate with the Swift storage servers.
1200 47 Beraldo Leal
# (If you aren't RACKSPACE, leave this False!)
1201 47 Beraldo Leal
#
1202 47 Beraldo Leal
# To use ServiceNET for authentication, prefix hostname of
1203 47 Beraldo Leal
# `swift_store_auth_address` with 'snet-'.
1204 47 Beraldo Leal
# Ex. https://example.com/v1.0/ -> https://snet-example.com/v1.0/
1205 47 Beraldo Leal
swift_enable_snet = False
1206 47 Beraldo Leal
1207 47 Beraldo Leal
# ============ S3 Store Options =============================
1208 47 Beraldo Leal
1209 47 Beraldo Leal
# Address where the S3 authentication service lives
1210 47 Beraldo Leal
# Valid schemes are 'http://' and 'https://'
1211 47 Beraldo Leal
# If no scheme specified,  default to 'http://'
1212 47 Beraldo Leal
s3_store_host = 127.0.0.1:8080/v1.0/
1213 47 Beraldo Leal
1214 47 Beraldo Leal
# User to authenticate against the S3 authentication service
1215 47 Beraldo Leal
s3_store_access_key = <20-char AWS access key>
1216 47 Beraldo Leal
1217 47 Beraldo Leal
# Auth key for the user authenticating against the
1218 47 Beraldo Leal
# S3 authentication service
1219 47 Beraldo Leal
s3_store_secret_key = <40-char AWS secret key>
1220 47 Beraldo Leal
1221 47 Beraldo Leal
# Container within the account that the account should use
1222 47 Beraldo Leal
# for storing images in S3. Note that S3 has a flat namespace,
1223 47 Beraldo Leal
# so you need a unique bucket name for your glance images. An
1224 47 Beraldo Leal
# easy way to do this is append your AWS access key to "glance".
1225 47 Beraldo Leal
# S3 buckets in AWS *must* be lowercased, so remember to lowercase
1226 47 Beraldo Leal
# your AWS access key if you use it in your bucket name below!
1227 47 Beraldo Leal
s3_store_bucket = <lowercased 20-char aws access key>glance
1228 47 Beraldo Leal
1229 47 Beraldo Leal
# Do we create the bucket if it does not exist?
1230 47 Beraldo Leal
s3_store_create_bucket_on_put = False
1231 47 Beraldo Leal
1232 47 Beraldo Leal
# When sending images to S3, the data will first be written to a
1233 47 Beraldo Leal
# temporary buffer on disk. By default the platform's temporary directory
1234 47 Beraldo Leal
# will be used. If required, an alternative directory can be specified here.
1235 47 Beraldo Leal
# s3_store_object_buffer_dir = /path/to/dir
1236 47 Beraldo Leal
1237 47 Beraldo Leal
# ============ RBD Store Options =============================
1238 47 Beraldo Leal
1239 47 Beraldo Leal
# Ceph configuration file path
1240 47 Beraldo Leal
# If using cephx authentication, this file should
1241 47 Beraldo Leal
# include a reference to the right keyring
1242 47 Beraldo Leal
# in a client.<USER> section
1243 47 Beraldo Leal
rbd_store_ceph_conf = /etc/ceph/ceph.conf
1244 47 Beraldo Leal
1245 47 Beraldo Leal
# RADOS user to authenticate as (only applicable if using cephx)
1246 47 Beraldo Leal
rbd_store_user = glance
1247 47 Beraldo Leal
1248 47 Beraldo Leal
# RADOS pool in which images are stored
1249 47 Beraldo Leal
rbd_store_pool = images
1250 47 Beraldo Leal
1251 47 Beraldo Leal
# Images will be chunked into objects of this size (in megabytes).
1252 47 Beraldo Leal
# For best performance, this should be a power of two
1253 47 Beraldo Leal
rbd_store_chunk_size = 8
1254 47 Beraldo Leal
1255 47 Beraldo Leal
# ============ Delayed Delete Options =============================
1256 47 Beraldo Leal
1257 47 Beraldo Leal
# Turn on/off delayed delete
1258 47 Beraldo Leal
delayed_delete = False
1259 47 Beraldo Leal
1260 47 Beraldo Leal
# Delayed delete time in seconds
1261 47 Beraldo Leal
scrub_time = 43200
1262 47 Beraldo Leal
1263 47 Beraldo Leal
# Directory that the scrubber will use to remind itself of what to delete
1264 47 Beraldo Leal
# Make sure this is also set in glance-scrubber.conf
1265 47 Beraldo Leal
scrubber_datadir = /var/lib/glance/scrubber
1266 47 Beraldo Leal
1267 47 Beraldo Leal
# =============== Image Cache Options =============================
1268 47 Beraldo Leal
1269 47 Beraldo Leal
# Base directory that the Image Cache uses
1270 47 Beraldo Leal
image_cache_dir = /var/lib/glance/image-cache/
1271 47 Beraldo Leal
1272 47 Beraldo Leal
[paste_deploy]
1273 47 Beraldo Leal
flavor = keystone
1274 47 Beraldo Leal
</pre>
1275 47 Beraldo Leal
1276 47 Beraldo Leal
*/etc/glance/glance-api-paste.ini*:
1277 47 Beraldo Leal
1278 47 Beraldo Leal
<pre>
1279 47 Beraldo Leal
# Default minimal pipeline
1280 47 Beraldo Leal
[pipeline:glance-api]
1281 47 Beraldo Leal
pipeline = versionnegotiation context apiv1app authtoken
1282 47 Beraldo Leal
1283 47 Beraldo Leal
# Use the following pipeline for keystone auth
1284 47 Beraldo Leal
# i.e. in glance-api.conf:
1285 47 Beraldo Leal
#   [paste_deploy]
1286 47 Beraldo Leal
#   flavor = keystone
1287 47 Beraldo Leal
#
1288 47 Beraldo Leal
[pipeline:glance-api-keystone]
1289 47 Beraldo Leal
pipeline = versionnegotiation authtoken context apiv1app
1290 47 Beraldo Leal
1291 47 Beraldo Leal
# Use the following pipeline to enable transparent caching of image files
1292 47 Beraldo Leal
# i.e. in glance-api.conf:
1293 47 Beraldo Leal
#   [paste_deploy]
1294 47 Beraldo Leal
#   flavor = caching
1295 47 Beraldo Leal
#
1296 47 Beraldo Leal
[pipeline:glance-api-caching]
1297 47 Beraldo Leal
pipeline = versionnegotiation context cache apiv1app
1298 47 Beraldo Leal
1299 47 Beraldo Leal
# Use the following pipeline for keystone auth with caching
1300 47 Beraldo Leal
# i.e. in glance-api.conf:
1301 47 Beraldo Leal
#   [paste_deploy]
1302 47 Beraldo Leal
#   flavor = keystone+caching
1303 47 Beraldo Leal
#
1304 47 Beraldo Leal
[pipeline:glance-api-keystone+caching]
1305 47 Beraldo Leal
pipeline = versionnegotiation authtoken context cache apiv1app
1306 47 Beraldo Leal
1307 47 Beraldo Leal
# Use the following pipeline to enable the Image Cache Management API
1308 47 Beraldo Leal
# i.e. in glance-api.conf:
1309 47 Beraldo Leal
#   [paste_deploy]
1310 47 Beraldo Leal
#   flavor = cachemanagement
1311 47 Beraldo Leal
#
1312 47 Beraldo Leal
[pipeline:glance-api-cachemanagement]
1313 47 Beraldo Leal
pipeline = versionnegotiation context cache cachemanage apiv1app
1314 47 Beraldo Leal
1315 47 Beraldo Leal
# Use the following pipeline for keystone auth with cache management
1316 47 Beraldo Leal
# i.e. in glance-api.conf:
1317 47 Beraldo Leal
#   [paste_deploy]
1318 47 Beraldo Leal
#   flavor = keystone+cachemanagement
1319 47 Beraldo Leal
#
1320 47 Beraldo Leal
[pipeline:glance-api-keystone+cachemanagement]
1321 47 Beraldo Leal
pipeline = versionnegotiation authtoken context cache cachemanage apiv1app
1322 47 Beraldo Leal
1323 47 Beraldo Leal
[app:apiv1app]
1324 47 Beraldo Leal
paste.app_factory = glance.common.wsgi:app_factory
1325 47 Beraldo Leal
glance.app_factory = glance.api.v1.router:API
1326 47 Beraldo Leal
1327 47 Beraldo Leal
[filter:versionnegotiation]
1328 47 Beraldo Leal
paste.filter_factory = glance.common.wsgi:filter_factory
1329 47 Beraldo Leal
glance.filter_factory = glance.api.middleware.version_negotiation:VersionNegotiationFilter
1330 47 Beraldo Leal
1331 47 Beraldo Leal
[filter:cache]
1332 47 Beraldo Leal
paste.filter_factory = glance.common.wsgi:filter_factory
1333 47 Beraldo Leal
glance.filter_factory = glance.api.middleware.cache:CacheFilter
1334 47 Beraldo Leal
1335 47 Beraldo Leal
[filter:cachemanage]
1336 47 Beraldo Leal
paste.filter_factory = glance.common.wsgi:filter_factory
1337 47 Beraldo Leal
glance.filter_factory = glance.api.middleware.cache_manage:CacheManageFilter
1338 47 Beraldo Leal
1339 47 Beraldo Leal
[filter:context]
1340 47 Beraldo Leal
paste.filter_factory = glance.common.wsgi:filter_factory
1341 47 Beraldo Leal
glance.filter_factory = glance.common.context:ContextMiddleware
1342 47 Beraldo Leal
1343 47 Beraldo Leal
[filter:authtoken]
1344 47 Beraldo Leal
paste.filter_factory = keystone.middleware.auth_token:filter_factory
1345 47 Beraldo Leal
service_protocol = http
1346 47 Beraldo Leal
service_host = 192.168.69.1
1347 47 Beraldo Leal
service_port = 5000
1348 47 Beraldo Leal
auth_host = 192.168.69.1
1349 47 Beraldo Leal
auth_port = 35357
1350 47 Beraldo Leal
auth_protocol = http
1351 47 Beraldo Leal
auth_uri = http://192.168.69.1:5000/
1352 47 Beraldo Leal
admin_tenant_name = service
1353 47 Beraldo Leal
admin_user = glance
1354 47 Beraldo Leal
admin_password = glancepass
1355 47 Beraldo Leal
</pre>
1356 48 Beraldo Leal
1357 48 Beraldo Leal
*/etc/glance/glance-registry.conf*:
1358 48 Beraldo Leal
1359 48 Beraldo Leal
<pre>
1360 48 Beraldo Leal
[DEFAULT]
1361 48 Beraldo Leal
# Show more verbose log output (sets INFO log level output)
1362 48 Beraldo Leal
verbose = True
1363 48 Beraldo Leal
1364 48 Beraldo Leal
# Show debugging output in logs (sets DEBUG log level output)
1365 48 Beraldo Leal
debug = True
1366 48 Beraldo Leal
1367 48 Beraldo Leal
# Address to bind the registry server
1368 48 Beraldo Leal
bind_host = 0.0.0.0
1369 48 Beraldo Leal
1370 48 Beraldo Leal
# Port the bind the registry server to
1371 48 Beraldo Leal
bind_port = 9191
1372 48 Beraldo Leal
1373 48 Beraldo Leal
# Log to this file. Make sure you do not set the same log
1374 48 Beraldo Leal
# file for both the API and registry servers!
1375 48 Beraldo Leal
log_file = /var/log/glance/registry.log
1376 48 Beraldo Leal
1377 48 Beraldo Leal
# Backlog requests when creating socket
1378 48 Beraldo Leal
backlog = 4096
1379 48 Beraldo Leal
1380 48 Beraldo Leal
# SQLAlchemy connection string for the reference implementation
1381 48 Beraldo Leal
# registry server. Any valid SQLAlchemy connection string is fine.
1382 48 Beraldo Leal
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
1383 48 Beraldo Leal
sql_connection = mysql://glance:glancepass@192.168.69.1/glance
1384 48 Beraldo Leal
1385 48 Beraldo Leal
# Period in seconds after which SQLAlchemy should reestablish its connection
1386 48 Beraldo Leal
# to the database.
1387 48 Beraldo Leal
#
1388 48 Beraldo Leal
# MySQL uses a default `wait_timeout` of 8 hours, after which it will drop
1389 48 Beraldo Leal
# idle connections. This can result in 'MySQL Gone Away' exceptions. If you
1390 48 Beraldo Leal
# notice this, you can lower this value to ensure that SQLAlchemy reconnects
1391 48 Beraldo Leal
# before MySQL can drop the connection.
1392 48 Beraldo Leal
sql_idle_timeout = 3600
1393 48 Beraldo Leal
1394 48 Beraldo Leal
# Limit the api to return `param_limit_max` items in a call to a container. If
1395 48 Beraldo Leal
# a larger `limit` query param is provided, it will be reduced to this value.
1396 48 Beraldo Leal
api_limit_max = 1000
1397 48 Beraldo Leal
1398 48 Beraldo Leal
# If a `limit` query param is not provided in an api request, it will
1399 48 Beraldo Leal
# default to `limit_param_default`
1400 48 Beraldo Leal
limit_param_default = 25
1401 48 Beraldo Leal
1402 48 Beraldo Leal
# Role used to identify an authenticated user as administrator
1403 48 Beraldo Leal
#admin_role = admin
1404 48 Beraldo Leal
1405 48 Beraldo Leal
# ================= Syslog Options ============================
1406 48 Beraldo Leal
1407 48 Beraldo Leal
# Send logs to syslog (/dev/log) instead of to file specified
1408 48 Beraldo Leal
# by `log_file`
1409 48 Beraldo Leal
use_syslog = True
1410 48 Beraldo Leal
1411 48 Beraldo Leal
# Facility to use. If unset defaults to LOG_USER.
1412 48 Beraldo Leal
# syslog_log_facility = LOG_LOCAL1
1413 48 Beraldo Leal
1414 48 Beraldo Leal
# ================= SSL Options ===============================
1415 48 Beraldo Leal
1416 48 Beraldo Leal
# Certificate file to use when starting registry server securely
1417 48 Beraldo Leal
# cert_file = /path/to/certfile
1418 48 Beraldo Leal
1419 48 Beraldo Leal
# Private key file to use when starting registry server securely
1420 48 Beraldo Leal
# key_file = /path/to/keyfile
1421 48 Beraldo Leal
1422 48 Beraldo Leal
[paste_deploy]
1423 48 Beraldo Leal
flavor = keystone
1424 48 Beraldo Leal
</pre>
1425 48 Beraldo Leal
1426 48 Beraldo Leal
1427 48 Beraldo Leal
*/etc/glance/glance-registry-paste.ini*:
1428 48 Beraldo Leal
1429 48 Beraldo Leal
<pre>
1430 48 Beraldo Leal
# Default minimal pipeline
1431 48 Beraldo Leal
[pipeline:glance-registry]
1432 48 Beraldo Leal
pipeline = context registryapp authtoken
1433 48 Beraldo Leal
1434 48 Beraldo Leal
# Use the following pipeline for keystone auth
1435 48 Beraldo Leal
# i.e. in glance-registry.conf:
1436 48 Beraldo Leal
#   [paste_deploy]
1437 48 Beraldo Leal
#   flavor = keystone
1438 48 Beraldo Leal
#
1439 48 Beraldo Leal
[pipeline:glance-registry-keystone]
1440 48 Beraldo Leal
pipeline = authtoken context registryapp
1441 48 Beraldo Leal
1442 48 Beraldo Leal
[app:registryapp]
1443 48 Beraldo Leal
paste.app_factory = glance.common.wsgi:app_factory
1444 48 Beraldo Leal
glance.app_factory = glance.registry.api.v1:API
1445 48 Beraldo Leal
1446 48 Beraldo Leal
[filter:context]
1447 48 Beraldo Leal
context_class = glance.registry.context.RequestContext
1448 48 Beraldo Leal
paste.filter_factory = glance.common.wsgi:filter_factory
1449 48 Beraldo Leal
glance.filter_factory = glance.common.context:ContextMiddleware
1450 48 Beraldo Leal
1451 48 Beraldo Leal
[filter:authtoken]
1452 48 Beraldo Leal
paste.filter_factory = keystone.middleware.auth_token:filter_factory
1453 48 Beraldo Leal
service_protocol = http
1454 48 Beraldo Leal
service_host = 192.168.69.1
1455 48 Beraldo Leal
service_port = 5000
1456 48 Beraldo Leal
auth_host = 192.168.69.1
1457 48 Beraldo Leal
auth_port = 35357
1458 48 Beraldo Leal
auth_protocol = http
1459 48 Beraldo Leal
auth_uri = http://192.168.69.1:5000/
1460 48 Beraldo Leal
admin_tenant_name = service
1461 48 Beraldo Leal
admin_user = glance
1462 48 Beraldo Leal
admin_password = glancepass
1463 49 Beraldo Leal
</pre>
1464 48 Beraldo Leal
1465 49 Beraldo Leal
*/etc/glance/glance-scrubber.conf*:
1466 49 Beraldo Leal
1467 49 Beraldo Leal
<pre>
1468 49 Beraldo Leal
[DEFAULT]
1469 49 Beraldo Leal
# Show more verbose log output (sets INFO log level output)
1470 49 Beraldo Leal
verbose = True
1471 49 Beraldo Leal
1472 49 Beraldo Leal
# Show debugging output in logs (sets DEBUG log level output)
1473 49 Beraldo Leal
debug = False
1474 49 Beraldo Leal
1475 49 Beraldo Leal
# Log to this file. Make sure you do not set the same log
1476 49 Beraldo Leal
# file for both the API and registry servers!
1477 49 Beraldo Leal
log_file = /var/log/glance/scrubber.log
1478 49 Beraldo Leal
1479 49 Beraldo Leal
# Send logs to syslog (/dev/log) instead of to file specified by `log_file`
1480 49 Beraldo Leal
use_syslog = False
1481 49 Beraldo Leal
1482 49 Beraldo Leal
# Should we run our own loop or rely on cron/scheduler to run us
1483 49 Beraldo Leal
daemon = False
1484 49 Beraldo Leal
1485 49 Beraldo Leal
# Loop time between checking for new items to schedule for delete
1486 49 Beraldo Leal
wakeup_time = 300
1487 49 Beraldo Leal
1488 49 Beraldo Leal
sql_connection = mysql://glance:glancepass@192.168.69.1/glance
1489 49 Beraldo Leal
1490 49 Beraldo Leal
# Directory that the scrubber will use to remind itself of what to delete
1491 49 Beraldo Leal
# Make sure this is also set in glance-api.conf
1492 49 Beraldo Leal
scrubber_datadir = /var/lib/glance/scrubber
1493 49 Beraldo Leal
1494 49 Beraldo Leal
# Only one server in your deployment should be designated the cleanup host
1495 49 Beraldo Leal
cleanup_scrubber = False
1496 49 Beraldo Leal
1497 49 Beraldo Leal
# pending_delete items older than this time are candidates for cleanup
1498 49 Beraldo Leal
cleanup_scrubber_time = 86400
1499 49 Beraldo Leal
1500 49 Beraldo Leal
# Address to find the registry server for cleanups
1501 1 Beraldo Leal
registry_host = 0.0.0.0
1502 49 Beraldo Leal
1503 49 Beraldo Leal
# Port the registry server is listening on
1504 49 Beraldo Leal
registry_port = 9191
1505 48 Beraldo Leal
</pre>
1506 50 Beraldo Leal
1507 64 Beraldo Leal
h2. Synchronizing the database and restarting the services
1508 50 Beraldo Leal
1509 1 Beraldo Leal
<pre>
1510 1 Beraldo Leal
# glance-manage version_control 0
1511 1 Beraldo Leal
# glance-manage db_sync
1512 50 Beraldo Leal
# service glance-registry restart
1513 50 Beraldo Leal
# service glance-api restart
1514 50 Beraldo Leal
</pre>
1515 50 Beraldo Leal
1516 64 Beraldo Leal
h2. Testing the Glance installation:
1517 50 Beraldo Leal
1518 64 Beraldo Leal
Put the new env vars to _/root/openstackrc_:
1519 64 Beraldo Leal
1520 52 Beraldo Leal
<pre>
1521 52 Beraldo Leal
# Used for Keystone
1522 52 Beraldo Leal
export SERVICE_ENDPOINT=http://192.168.69.1:35357/v2.0/
1523 52 Beraldo Leal
export SERVICE_TOKEN=012345SECRET99TOKEN012345
1524 52 Beraldo Leal
1525 52 Beraldo Leal
# Used for swift
1526 52 Beraldo Leal
export ST_AUTH=http://192.168.69.1:5000/v2.0
1527 52 Beraldo Leal
export ST_USER=openstackDemo:admin
1528 52 Beraldo Leal
export ST_KEY=adminpass
1529 52 Beraldo Leal
export OS_REGION_NAME=RegionOne
1530 52 Beraldo Leal
1531 1 Beraldo Leal
# Used for glance
1532 1 Beraldo Leal
export OS_USERNAME=admin
1533 52 Beraldo Leal
export OS_TENANT_NAME=openstackDemo
1534 52 Beraldo Leal
export OS_PASSWORD=adminpass
1535 52 Beraldo Leal
export OS_AUTH_URL=http://192.168.69.1:5000/v2.0/
1536 52 Beraldo Leal
export OS_REGION_NAME=RegionOne
1537 52 Beraldo Leal
</pre>
1538 52 Beraldo Leal
1539 1 Beraldo Leal
1540 64 Beraldo Leal
Download a test image:
1541 64 Beraldo Leal
1542 50 Beraldo Leal
<pre>
1543 50 Beraldo Leal
mkdir /tmp/images
1544 50 Beraldo Leal
cd /tmp/images/
1545 50 Beraldo Leal
wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
1546 50 Beraldo Leal
tar -zxvf ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
1547 1 Beraldo Leal
</pre>
1548 50 Beraldo Leal
1549 64 Beraldo Leal
Upload the image:
1550 50 Beraldo Leal
1551 50 Beraldo Leal
<pre>
1552 50 Beraldo Leal
# cd /tmp/images/
1553 50 Beraldo Leal
# glance add name="tty-linux-kernel" disk_format=aki container_format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz 
1554 50 Beraldo Leal
# glance add name="tty-linux-ramdisk" disk_format=ari container_format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-loader 
1555 50 Beraldo Leal
# glance add name="tty-linux" disk_format=ami container_format=ami kernel_id=[kernel_image_id] ramdisk_id=[kernel_ramdisk_image_id] < ttylinux-uec-amd64-12.1_2.6.35-22_1.img 
1556 50 Beraldo Leal
</pre>
1557 51 Beraldo Leal
1558 64 Beraldo Leal
List the images:
1559 51 Beraldo Leal
1560 51 Beraldo Leal
<pre>
1561 51 Beraldo Leal
# glance index
1562 51 Beraldo Leal
</pre>
1563 65 Beraldo Leal
1564 65 Beraldo Leal
1565 75 Beraldo Leal
h1. OpenStack Compute service - nova
1566 65 Beraldo Leal
1567 65 Beraldo Leal
Nova is the project name for OpenStack Compute, a cloud computing fabric controller, the main part of an IaaS system. Individuals and organizations can use Nova to host and manage their own cloud computing systems. Nova originated as a project out of NASA Ames Research Laboratory.
1568 65 Beraldo Leal
1569 66 Beraldo Leal
OpenStack Compute gives you a tool to orchestrate a cloud, including running instances, managing networks, and controlling access to the cloud through users and projects. The underlying open source project's name is Nova, and it provides the software that can control an Infrastructure as a Service (IaaS) cloud computing platform. It is similar in scope to Amazon EC2 and Rackspace Cloud Servers. OpenStack Compute does not include any virtualization software; rather it defines drivers that interact with underlying virtualization mechanisms that run on your host operating system, and exposes functionality over a web-based API.
1570 66 Beraldo Leal
1571 66 Beraldo Leal
1572 65 Beraldo Leal
h2. AMQP and Nova
1573 65 Beraldo Leal
1574 65 Beraldo Leal
AMQP is the messaging technology chosen by the OpenStack cloud. The AMQP broker, either RabbitMQ or Qpid, sits between any two Nova components and allows them to communicate in a loosely coupled fashion. More precisely, Nova components (the compute fabric of OpenStack) use Remote Procedure Calls (RPC hereinafter) to communicate to one another.
1575 1 Beraldo Leal
1576 66 Beraldo Leal
For more information about AMQP in Nova, please read the "AMQP section in nova manual":http://docs.openstack.org/developer/nova/devref/rpc.html
1577 66 Beraldo Leal
1578 66 Beraldo Leal
h2. Hypervisor
1579 66 Beraldo Leal
1580 66 Beraldo Leal
For production environments the most tested hypervisors are KVM and Xen-based hypervisors. KVM runs through libvirt, Xen runs best through XenAPI calls. KVM is selected by default and requires the least additional configuration. This guide offers information on
1581 66 Beraldo Leal
specific walkthrough configuration options to KVM.
1582 66 Beraldo Leal
1583 66 Beraldo Leal
h3. Configuring the kvm
1584 66 Beraldo Leal
1585 66 Beraldo Leal
KVM is configured as the default hypervisor for Compute. To enable KVM explicitly, add the following configuration options /etc/nova/nova.conf:
1586 66 Beraldo Leal
1587 66 Beraldo Leal
<pre>
1588 66 Beraldo Leal
connection_type=libvirt
1589 66 Beraldo Leal
libvirt_type=kvm
1590 66 Beraldo Leal
</pre>
1591 66 Beraldo Leal
1592 66 Beraldo Leal
The KVM hypervisor supports the following virtual machine image formats:
1593 66 Beraldo Leal
1594 66 Beraldo Leal
* Raw
1595 66 Beraldo Leal
* QEMU Copy-on-write (qcow2)
1596 66 Beraldo Leal
* VMWare virtual machine disk format (vmdk)
1597 66 Beraldo Leal
1598 66 Beraldo Leal
h3. Checking for hardware virtualization support
1599 66 Beraldo Leal
1600 66 Beraldo Leal
The processors of your compute host need to support virtualization technology (VT) to use KVM.
1601 66 Beraldo Leal
1602 66 Beraldo Leal
If you are running on Ubuntu, use the _kvm-ok_ command to check if your processor has VT support, it is enabled in the BIOS, and KVM is installed properly, as root:
1603 66 Beraldo Leal
1604 66 Beraldo Leal
<pre>
1605 66 Beraldo Leal
# kvm-ok
1606 66 Beraldo Leal
INFO: /dev/kvm exists
1607 66 Beraldo Leal
KVM acceleration can be used
1608 66 Beraldo Leal
</pre>
1609 66 Beraldo Leal
1610 66 Beraldo Leal
On distributions that don't have kvm-ok, you can check if your processor has VT support by looking at the processor flags in the /proc/cpuinfo file. For Intel processors, look for the vmx flag, and for AMD processors, look for the svm flag. A simple way to check is to run the following command and see if there is any output:
1611 66 Beraldo Leal
1612 66 Beraldo Leal
<pre>
1613 66 Beraldo Leal
$ egrep '(vmx|svm)' --color=always /proc/cpuinfo
1614 66 Beraldo Leal
</pre>
1615 66 Beraldo Leal
1616 66 Beraldo Leal
h3. Enabling KVM
1617 66 Beraldo Leal
1618 66 Beraldo Leal
KVM requires the kvm and either kvm-intel or kvm-amd modules to be loaded. This may have been configured automatically on your distribution when KVM is installed. You can check that they have been loaded using lsmod, as follows, with expected output for Intel-based processors:
1619 66 Beraldo Leal
1620 66 Beraldo Leal
<pre>
1621 66 Beraldo Leal
$ lsmod | grep kvm
1622 66 Beraldo Leal
kvm_intel  137721 9
1623 66 Beraldo Leal
kvm        415459 1 kvm_intel
1624 66 Beraldo Leal
</pre>
1625 66 Beraldo Leal
1626 66 Beraldo Leal
If your compute host is Intel-based, run the following as root to load the kernel modules:
1627 66 Beraldo Leal
1628 66 Beraldo Leal
<pre>
1629 66 Beraldo Leal
# modprobe kvm
1630 66 Beraldo Leal
# modprobe kvm-intel
1631 66 Beraldo Leal
</pre>
1632 66 Beraldo Leal
1633 66 Beraldo Leal
Add the following lines to /etc/modules so that these modules will load on reboot:
1634 66 Beraldo Leal
1635 66 Beraldo Leal
<pre>
1636 66 Beraldo Leal
kvm
1637 66 Beraldo Leal
kvm-intel
1638 66 Beraldo Leal
</pre>
1639 66 Beraldo Leal
1640 66 Beraldo Leal
1641 66 Beraldo Leal
h2. Configuring the Compute Service database backend
1642 66 Beraldo Leal
1643 66 Beraldo Leal
To configure the MySQL database, create the nova database on the cloud controller machine:
1644 66 Beraldo Leal
1645 66 Beraldo Leal
<pre>
1646 1 Beraldo Leal
mysql> CREATE DATABASE nova;
1647 75 Beraldo Leal
mysql> CREATE USER nova;
1648 75 Beraldo Leal
mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'novapass';
1649 66 Beraldo Leal
mysql> quit
1650 66 Beraldo Leal
</pre>
1651 66 Beraldo Leal
1652 66 Beraldo Leal
h2. Installing the Cloud Controller
1653 66 Beraldo Leal
1654 66 Beraldo Leal
Install the messaging queue server, RabbitMQ. You also have the option of installing 
1655 66 Beraldo Leal
Apache Qpid, refer to the Compute Administration Manual for instructions.
1656 66 Beraldo Leal
1657 66 Beraldo Leal
<pre>
1658 66 Beraldo Leal
sudo apt-get install rabbitmq-server
1659 66 Beraldo Leal
</pre>
1660 66 Beraldo Leal
1661 66 Beraldo Leal
Install the required nova- packages, and dependencies are automatically installed.
1662 66 Beraldo Leal
1663 66 Beraldo Leal
<pre>
1664 67 Beraldo Leal
sudo apt-get install nova-volume nova-compute nova-vncproxy nova-api  nova-ajax-console-proxy nova-cert nova-consoleauth nova-doc nova-scheduler nova-network
1665 66 Beraldo Leal
</pre>
1666 1 Beraldo Leal
1667 72 Beraldo Leal
1668 72 Beraldo Leal
<pre>
1669 72 Beraldo Leal
nova-manage config convert --infile=/etc/nova/nova.conf --outfile=/etc/nova/nova.conf.new
1670 72 Beraldo Leal
mv /etc/nova/nova.conf.new /etc/nova/nova.conf
1671 72 Beraldo Leal
</pre>
1672 67 Beraldo Leal
h3. Configuring nova
1673 67 Beraldo Leal
1674 67 Beraldo Leal
The packages automatically do these steps for a user named nova, but if you are installing
1675 67 Beraldo Leal
as another user you should ensure that the nova.conf file should have its owner set to
1676 67 Beraldo Leal
root:nova, and mode set to 0640, since the file contains your MySQL server’s username
1677 67 Beraldo Leal
and password. This packaged install ensures that the nova user belongs to the nova group
1678 67 Beraldo Leal
and that the .conf file permissions are set, but here are the manual commands, which
1679 67 Beraldo Leal
should be run as root:
1680 67 Beraldo Leal
1681 67 Beraldo Leal
<pre>
1682 67 Beraldo Leal
# groupadd nova
1683 67 Beraldo Leal
# usermod -g nova nova
1684 67 Beraldo Leal
# chown -R root:nova /etc/nova
1685 67 Beraldo Leal
# chmod 640 /etc/nova/nova.conf
1686 67 Beraldo Leal
</pre>
1687 67 Beraldo Leal
1688 67 Beraldo Leal
Modify your nova.conf, nova-compute and api-paste.ini according to the following examples:
1689 67 Beraldo Leal
1690 67 Beraldo Leal
*nova-compute.conf*
1691 67 Beraldo Leal
<pre>
1692 67 Beraldo Leal
[DEFAULT]
1693 67 Beraldo Leal
libvirt_type=kvm
1694 67 Beraldo Leal
</pre>
1695 67 Beraldo Leal
1696 67 Beraldo Leal
*nova.conf*
1697 67 Beraldo Leal
<pre>
1698 67 Beraldo Leal
[DEFAULT]
1699 67 Beraldo Leal
# LOGS/STATE
1700 67 Beraldo Leal
verbose=True
1701 67 Beraldo Leal
use_syslog=False
1702 67 Beraldo Leal
debug=False
1703 67 Beraldo Leal
1704 67 Beraldo Leal
#logging_default_format_string =  '%(asctime)s %(levelname)s %(name)s [-] %(message)s'
1705 67 Beraldo Leal
logging_default_format_string = '%(asctime)s %(levelname)s %(name)s [-] %(message)s'
1706 67 Beraldo Leal
logging_context_format_string = '%(asctime)s %(levelname)s %(name)s [-] %(message)s'
1707 67 Beraldo Leal
1708 67 Beraldo Leal
# AUTHENTICATION
1709 67 Beraldo Leal
auth_strategy=keystone
1710 67 Beraldo Leal
logdir=/var/log/nova/
1711 67 Beraldo Leal
state_path=/var/lib/nova
1712 67 Beraldo Leal
lock_path=/var/run/nova
1713 67 Beraldo Leal
bindir=/usr/bin/
1714 67 Beraldo Leal
1715 67 Beraldo Leal
force_to_raw=False
1716 67 Beraldo Leal
1717 67 Beraldo Leal
# SCHEDULER
1718 67 Beraldo Leal
compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler
1719 67 Beraldo Leal
1720 67 Beraldo Leal
scheduler_default_filters=AllHostsFilter
1721 67 Beraldo Leal
1722 67 Beraldo Leal
# VOLUMES
1723 67 Beraldo Leal
volume_group=nova-volumes
1724 67 Beraldo Leal
volume_name_template=volume-%08x
1725 67 Beraldo Leal
iscsi_helper=tgtadm
1726 67 Beraldo Leal
1727 67 Beraldo Leal
# DATABASE
1728 67 Beraldo Leal
sql_connection=mysql://nova:novapass@192.168.69.1/nova
1729 67 Beraldo Leal
1730 67 Beraldo Leal
# COMPUTE
1731 67 Beraldo Leal
libvirt_type=kvm
1732 67 Beraldo Leal
connection_type=libvirt
1733 67 Beraldo Leal
instance_name_template=instance-%08x
1734 67 Beraldo Leal
api_paste_config=/etc/nova/api-paste.ini
1735 67 Beraldo Leal
allow_resize_to_same_host=True
1736 67 Beraldo Leal
1737 67 Beraldo Leal
# APIS
1738 67 Beraldo Leal
osapi_compute_extension=nova.api.openstack.compute.contrib.standard_extensions
1739 67 Beraldo Leal
ec2_dmz_host=192.168.69.1
1740 67 Beraldo Leal
s3_host=192.168.69.1
1741 67 Beraldo Leal
# RABBITMQ
1742 67 Beraldo Leal
rabbit_host=192.168.69.1
1743 67 Beraldo Leal
# GLANCE
1744 67 Beraldo Leal
image_service=nova.image.glance.GlanceImageService
1745 67 Beraldo Leal
glance_api_servers=192.168.69.1:9292
1746 67 Beraldo Leal
# NETWORK
1747 67 Beraldo Leal
network_manager=nova.network.manager.FlatDHCPManager
1748 67 Beraldo Leal
force_dhcp_release=True
1749 67 Beraldo Leal
dhcpbridge_flagfile=/etc/nova/nova.conf
1750 67 Beraldo Leal
firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
1751 67 Beraldo Leal
my_ip=192.168.69.1
1752 67 Beraldo Leal
public_interface=br100
1753 67 Beraldo Leal
vlan_interface=eth0
1754 67 Beraldo Leal
flat_network_bridge=br100
1755 67 Beraldo Leal
flat_interface=eth0
1756 67 Beraldo Leal
fixed_range=192.168.70.0/24
1757 67 Beraldo Leal
# NOVNC CONSOLE - You should change this IP to public ip of current nova-compute machine
1758 67 Beraldo Leal
novncproxy_base_url=http://200.145.46.167:6080/vnc_auto.html
1759 67 Beraldo Leal
vncserver_proxyclient_address=200.145.46.167
1760 67 Beraldo Leal
vncserver_listen=200.145.46.167
1761 67 Beraldo Leal
xvpvncproxy_base_url=http://200.145.46.167:6081/console
1762 67 Beraldo Leal
</pre>
1763 67 Beraldo Leal
1764 67 Beraldo Leal
*api-paste.ini*
1765 67 Beraldo Leal
<pre>
1766 67 Beraldo Leal
############
1767 67 Beraldo Leal
# Metadata #
1768 67 Beraldo Leal
############
1769 67 Beraldo Leal
[composite:metadata]
1770 67 Beraldo Leal
use = egg:Paste#urlmap
1771 67 Beraldo Leal
/: metaversions
1772 67 Beraldo Leal
/latest: meta
1773 67 Beraldo Leal
/1.0: meta
1774 67 Beraldo Leal
/2007-01-19: meta
1775 67 Beraldo Leal
/2007-03-01: meta
1776 67 Beraldo Leal
/2007-08-29: meta
1777 67 Beraldo Leal
/2007-10-10: meta
1778 67 Beraldo Leal
/2007-12-15: meta
1779 67 Beraldo Leal
/2008-02-01: meta
1780 67 Beraldo Leal
/2008-09-01: meta
1781 67 Beraldo Leal
/2009-04-04: meta
1782 67 Beraldo Leal
1783 67 Beraldo Leal
[pipeline:metaversions]
1784 67 Beraldo Leal
pipeline = ec2faultwrap logrequest metaverapp
1785 67 Beraldo Leal
1786 67 Beraldo Leal
[pipeline:meta]
1787 67 Beraldo Leal
pipeline = ec2faultwrap logrequest metaapp
1788 67 Beraldo Leal
1789 67 Beraldo Leal
[app:metaverapp]
1790 67 Beraldo Leal
paste.app_factory = nova.api.metadata.handler:Versions.factory
1791 67 Beraldo Leal
1792 67 Beraldo Leal
[app:metaapp]
1793 67 Beraldo Leal
paste.app_factory = nova.api.metadata.handler:MetadataRequestHandler.factory
1794 67 Beraldo Leal
1795 67 Beraldo Leal
#######
1796 67 Beraldo Leal
# EC2 #
1797 67 Beraldo Leal
#######
1798 67 Beraldo Leal
1799 67 Beraldo Leal
[composite:ec2]
1800 67 Beraldo Leal
use = egg:Paste#urlmap
1801 67 Beraldo Leal
/services/Cloud: ec2cloud
1802 67 Beraldo Leal
1803 67 Beraldo Leal
[composite:ec2cloud]
1804 67 Beraldo Leal
use = call:nova.api.auth:pipeline_factory
1805 67 Beraldo Leal
noauth = ec2faultwrap logrequest ec2noauth cloudrequest validator ec2executor
1806 67 Beraldo Leal
deprecated = ec2faultwrap logrequest authenticate cloudrequest validator ec2executor
1807 67 Beraldo Leal
keystone = ec2faultwrap logrequest ec2keystoneauth cloudrequest validator ec2executor
1808 67 Beraldo Leal
1809 67 Beraldo Leal
[filter:ec2faultwrap]
1810 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:FaultWrapper.factory
1811 67 Beraldo Leal
1812 67 Beraldo Leal
[filter:logrequest]
1813 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:RequestLogging.factory
1814 67 Beraldo Leal
1815 67 Beraldo Leal
[filter:ec2lockout]
1816 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:Lockout.factory
1817 67 Beraldo Leal
1818 67 Beraldo Leal
[filter:totoken]
1819 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:EC2Token.factory
1820 67 Beraldo Leal
1821 67 Beraldo Leal
[filter:ec2keystoneauth]
1822 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:EC2KeystoneAuth.factory
1823 67 Beraldo Leal
1824 67 Beraldo Leal
[filter:ec2noauth]
1825 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:NoAuth.factory
1826 67 Beraldo Leal
1827 67 Beraldo Leal
[filter:authenticate]
1828 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:Authenticate.factory
1829 67 Beraldo Leal
1830 67 Beraldo Leal
[filter:cloudrequest]
1831 67 Beraldo Leal
controller = nova.api.ec2.cloud.CloudController
1832 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:Requestify.factory
1833 67 Beraldo Leal
1834 67 Beraldo Leal
[filter:authorizer]
1835 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:Authorizer.factory
1836 67 Beraldo Leal
1837 67 Beraldo Leal
[filter:validator]
1838 67 Beraldo Leal
paste.filter_factory = nova.api.ec2:Validator.factory
1839 67 Beraldo Leal
1840 67 Beraldo Leal
[app:ec2executor]
1841 67 Beraldo Leal
paste.app_factory = nova.api.ec2:Executor.factory
1842 67 Beraldo Leal
1843 67 Beraldo Leal
#############
1844 67 Beraldo Leal
# Openstack #
1845 67 Beraldo Leal
#############
1846 67 Beraldo Leal
1847 67 Beraldo Leal
[composite:osapi_compute]
1848 67 Beraldo Leal
use = call:nova.api.openstack.urlmap:urlmap_factory
1849 67 Beraldo Leal
/: oscomputeversions
1850 67 Beraldo Leal
/v1.1: openstack_compute_api_v2
1851 67 Beraldo Leal
/v2: openstack_compute_api_v2
1852 67 Beraldo Leal
1853 67 Beraldo Leal
[composite:osapi_volume]
1854 67 Beraldo Leal
use = call:nova.api.openstack.urlmap:urlmap_factory
1855 67 Beraldo Leal
/: osvolumeversions
1856 67 Beraldo Leal
/v1: openstack_volume_api_v1
1857 67 Beraldo Leal
1858 67 Beraldo Leal
[composite:openstack_compute_api_v2]
1859 67 Beraldo Leal
use = call:nova.api.auth:pipeline_factory
1860 67 Beraldo Leal
noauth = faultwrap noauth ratelimit osapi_compute_app_v2
1861 67 Beraldo Leal
deprecated = faultwrap auth ratelimit osapi_compute_app_v2
1862 67 Beraldo Leal
keystone = faultwrap authtoken keystonecontext ratelimit osapi_compute_app_v2
1863 67 Beraldo Leal
keystone_nolimit = faultwrap authtoken keystonecontext osapi_compute_app_v2
1864 67 Beraldo Leal
1865 67 Beraldo Leal
[composite:openstack_volume_api_v1]
1866 67 Beraldo Leal
use = call:nova.api.auth:pipeline_factory
1867 67 Beraldo Leal
noauth = faultwrap noauth ratelimit osapi_volume_app_v1
1868 67 Beraldo Leal
deprecated = faultwrap auth ratelimit osapi_volume_app_v1
1869 67 Beraldo Leal
keystone = faultwrap authtoken keystonecontext ratelimit osapi_volume_app_v1
1870 67 Beraldo Leal
keystone_nolimit = faultwrap authtoken keystonecontext osapi_volume_app_v1
1871 67 Beraldo Leal
1872 67 Beraldo Leal
[filter:faultwrap]
1873 67 Beraldo Leal
paste.filter_factory = nova.api.openstack:FaultWrapper.factory
1874 67 Beraldo Leal
1875 67 Beraldo Leal
[filter:auth]
1876 67 Beraldo Leal
paste.filter_factory = nova.api.openstack.auth:AuthMiddleware.factory
1877 67 Beraldo Leal
1878 67 Beraldo Leal
[filter:noauth]
1879 67 Beraldo Leal
paste.filter_factory = nova.api.openstack.auth:NoAuthMiddleware.factory
1880 67 Beraldo Leal
1881 67 Beraldo Leal
[filter:ratelimit]
1882 67 Beraldo Leal
paste.filter_factory = nova.api.openstack.compute.limits:RateLimitingMiddleware.factory
1883 67 Beraldo Leal
1884 67 Beraldo Leal
[app:osapi_compute_app_v2]
1885 67 Beraldo Leal
paste.app_factory = nova.api.openstack.compute:APIRouter.factory
1886 67 Beraldo Leal
1887 67 Beraldo Leal
[pipeline:oscomputeversions]
1888 67 Beraldo Leal
pipeline = faultwrap oscomputeversionapp
1889 67 Beraldo Leal
1890 67 Beraldo Leal
[app:osapi_volume_app_v1]
1891 67 Beraldo Leal
paste.app_factory = nova.api.openstack.volume:APIRouter.factory
1892 67 Beraldo Leal
1893 67 Beraldo Leal
[app:oscomputeversionapp]
1894 67 Beraldo Leal
paste.app_factory = nova.api.openstack.compute.versions:Versions.factory
1895 67 Beraldo Leal
1896 67 Beraldo Leal
[pipeline:osvolumeversions]
1897 67 Beraldo Leal
pipeline = faultwrap osvolumeversionapp
1898 67 Beraldo Leal
1899 67 Beraldo Leal
[app:osvolumeversionapp]
1900 67 Beraldo Leal
paste.app_factory = nova.api.openstack.volume.versions:Versions.factory
1901 67 Beraldo Leal
1902 67 Beraldo Leal
##########
1903 67 Beraldo Leal
# Shared #
1904 67 Beraldo Leal
##########
1905 67 Beraldo Leal
1906 67 Beraldo Leal
[filter:keystonecontext]
1907 67 Beraldo Leal
paste.filter_factory = nova.api.auth:NovaKeystoneContext.factory
1908 67 Beraldo Leal
1909 67 Beraldo Leal
[filter:authtoken]
1910 67 Beraldo Leal
paste.filter_factory = keystone.middleware.auth_token:filter_factory
1911 67 Beraldo Leal
service_protocol = http
1912 67 Beraldo Leal
service_host = 192.168.69.1
1913 67 Beraldo Leal
service_port = 5000
1914 67 Beraldo Leal
auth_host = 192.168.69.1
1915 67 Beraldo Leal
auth_port = 35357
1916 67 Beraldo Leal
auth_protocol = http
1917 67 Beraldo Leal
auth_uri = http://192.168.69.1:5000/
1918 67 Beraldo Leal
admin_tenant_name = service
1919 67 Beraldo Leal
admin_user = nova
1920 67 Beraldo Leal
admin_password = novapass
1921 67 Beraldo Leal
</pre>
1922 67 Beraldo Leal
1923 68 Beraldo Leal
Restart the nova- services prior to running db sync, by running as root:
1924 66 Beraldo Leal
1925 68 Beraldo Leal
<pre>
1926 68 Beraldo Leal
# restart nova-api
1927 68 Beraldo Leal
# restart nova-compute
1928 68 Beraldo Leal
# restart nova-network
1929 68 Beraldo Leal
# restart nova-scheduler
1930 68 Beraldo Leal
# restart nova-vncproxy
1931 68 Beraldo Leal
# restart nova-volume
1932 68 Beraldo Leal
</pre>
1933 68 Beraldo Leal
1934 66 Beraldo Leal
h3. Installing additional computer nodes
1935 66 Beraldo Leal
1936 66 Beraldo Leal
There are many different ways to perform a multinode install of Compute in order to scale out your deployment and run more. In this case, you can install all the nova- packages and dependencies as you did for the Cloud Controller node, or just install nova-network and nova-compute. Your installation can run any nova- services anywhere, so long as the service can access nova.conf so it knows where the Rabbitmq or Qpid messaging server is installed.
1937 66 Beraldo Leal
1938 1 Beraldo Leal
The Compute Node is where you configure the Compute network, the networking between your instances. Because you may need to query the database from the Compute node and learn more information about instances, the nova client and MySQL client or PostgresSQL client
1939 1 Beraldo Leal
packages should be installed on any additional Compute nodes. Copy the nova.conf from your controller node to all additional compute nodes.
1940 75 Beraldo Leal
1941 75 Beraldo Leal
If you are using a network bridge configuration and the computer nodes will not have external access, no need to install the nova-network computer nodes.
1942 68 Beraldo Leal
1943 68 Beraldo Leal
h3. Configuring the Database for Compute
1944 68 Beraldo Leal
1945 68 Beraldo Leal
Create the tables in your backend data store by running the following command:
1946 68 Beraldo Leal
1947 68 Beraldo Leal
<pre>
1948 68 Beraldo Leal
sudo nova-manage db sync
1949 68 Beraldo Leal
</pre>
1950 68 Beraldo Leal
1951 68 Beraldo Leal
Restart all the services:
1952 68 Beraldo Leal
1953 68 Beraldo Leal
<pre>
1954 68 Beraldo Leal
# restart nova-api
1955 68 Beraldo Leal
# restart nova-compute
1956 68 Beraldo Leal
# restart nova-network
1957 68 Beraldo Leal
# restart nova-scheduler
1958 68 Beraldo Leal
# restart nova-vncproxy
1959 68 Beraldo Leal
# restart nova-volume
1960 68 Beraldo Leal
# restart libvirt-bin
1961 73 Beraldo Leal
# restart nova-cert
1962 73 Beraldo Leal
# restart nova-consoleauth
1963 68 Beraldo Leal
# sudo /etc/init.d/rabbitmq-server restart
1964 68 Beraldo Leal
</pre>
1965 68 Beraldo Leal
1966 68 Beraldo Leal
All nova services are now installed and started. If the "restart" command doesn't work, your services may not be running correctly (or not at all). Review the logs in /var/log/nova. 
1967 68 Beraldo Leal
1968 68 Beraldo Leal
h3. Creating the Network for Compute VMs
1969 68 Beraldo Leal
1970 68 Beraldo Leal
You must run the command that creates the network and the bridge using the br100 specified in the nova.conf file to create the network that the virtual machines use. This example shows the network range using 192.168.70.0/24 as the fixed range for our guest
1971 68 Beraldo Leal
VMs, but you can substitute the range for the network you have available. We're labeling it with "private" in this case.
1972 68 Beraldo Leal
1973 68 Beraldo Leal
<pre>
1974 68 Beraldo Leal
nova-manage network create private --multi_host=T --fixed_range_v4=192.168.70.0/24 --bridge_interface=br100 --num_networks=1 --network_size=256
1975 68 Beraldo Leal
</pre>
1976 68 Beraldo Leal
1977 68 Beraldo Leal
h3. Verifying the Compute Installation
1978 68 Beraldo Leal
1979 68 Beraldo Leal
You can ensure all the Compute services are running by using the nova-manage command:
1980 68 Beraldo Leal
1981 68 Beraldo Leal
<pre>
1982 68 Beraldo Leal
sudo nova-manage service list
1983 68 Beraldo Leal
</pre>
1984 68 Beraldo Leal
1985 68 Beraldo Leal
In return you should see "smiley faces" rather than three X symbols. Here's an example.
1986 68 Beraldo Leal
1987 68 Beraldo Leal
<pre>
1988 68 Beraldo Leal
Binary           Host                                 Zone             Status     State Updated_At
1989 68 Beraldo Leal
nova-compute     educloud01                           nova             disabled   XXX   2012-06-03 14:23:45
1990 68 Beraldo Leal
nova-network     educloud01                           nova             enabled    :-)   2012-06-08 12:04:21
1991 68 Beraldo Leal
nova-scheduler   educloud01                           nova             enabled    :-)   2012-06-08 12:04:14
1992 68 Beraldo Leal
nova-volume      educloud01                           nova             enabled    :-)   2012-06-08 12:04:21
1993 68 Beraldo Leal
nova-cert        educloud01                           nova             enabled    :-)   2012-06-08 12:04:21
1994 68 Beraldo Leal
nova-consoleauth educloud01                           nova             enabled    :-)   2012-06-08 12:04:21
1995 68 Beraldo Leal
nova-compute     educloud02                           nova             enabled    :-)   2012-06-08 12:04:00
1996 68 Beraldo Leal
nova-network     educloud02                           nova             enabled    :-)   2012-06-08 12:04:00
1997 68 Beraldo Leal
</pre>
1998 69 Beraldo Leal
1999 69 Beraldo Leal
h2. Installing the OpenStack frontend - Horizon
2000 69 Beraldo Leal
2001 69 Beraldo Leal
OpenStack has components that provide a view of the OpenStack installation such as a Django-built website that serves as a dashboard. You can use a dashboard interface with an OpenStack Compute installation with a web-based console provided by the Openstack-Dashboard project. It provides web-based interactions with the OpenStack Compute cloud controller through the OpenStack APIs. For more information about the Openstack-Dashboard project, please visit: https://github.com/openstack/horizon/. These instructions are for an example deployment configured with an Apache web server.
2002 69 Beraldo Leal
2003 69 Beraldo Leal
h3. System Requirements for the Dashboard
2004 69 Beraldo Leal
2005 69 Beraldo Leal
* You should have a running OpenStack Compute installation with the Identity Service, Keystone, enabled for identity management.
2006 69 Beraldo Leal
* The dashboard needs to be installed on the node that can contact the Identity Service.
2007 69 Beraldo Leal
* You should know the URL of your Identity endpoint and the Compute endpoint.
2008 69 Beraldo Leal
* You must know the credentials of a valid Identity service user.
2009 69 Beraldo Leal
* Python 2.6 is required;
2010 69 Beraldo Leal
* It should run on any system with Python 2.6 or 2.7 that is capable of running Django;
2011 69 Beraldo Leal
* Optional components:
2012 69 Beraldo Leal
> * An Image Store (Glance) endpoint.
2013 69 Beraldo Leal
> * An Object Store (Swift) endpoint.
2014 70 Beraldo Leal
2015 70 Beraldo Leal
Install the OpenStack Dashboard, as root:
2016 70 Beraldo Leal
2017 70 Beraldo Leal
<pre>
2018 70 Beraldo Leal
# apt-get install -y memcached libapache2-mod-wsgi openstack-dashboard
2019 70 Beraldo Leal
</pre>
2020 70 Beraldo Leal
2021 70 Beraldo Leal
Next, modify the variable CACHE_BACKEND in /etc/openstack-dashboard/ local_settings.py to match the ones set in /etc/memcached.conf. Open /etc/openstack-dashboard/local_settings.py and look for this line:
2022 70 Beraldo Leal
2023 70 Beraldo Leal
<pre>
2024 70 Beraldo Leal
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
2025 70 Beraldo Leal
</pre>
2026 70 Beraldo Leal
2027 70 Beraldo Leal
To configure the MySQL database, create the dash database.
2028 70 Beraldo Leal
2029 70 Beraldo Leal
<pre>
2030 70 Beraldo Leal
mysql> CREATE DATABASE dash;
2031 70 Beraldo Leal
mysql> GRANT ALL ON dash.* TO 'dash'@'%' IDENTIFIED BY 'dashpass';
2032 70 Beraldo Leal
mysql> quit;
2033 70 Beraldo Leal
</pre>
2034 70 Beraldo Leal
2035 70 Beraldo Leal
After configuring the local_settings.py as shown below, you can run the manage.py syncdb command to populate this newly-created database.
2036 70 Beraldo Leal
2037 70 Beraldo Leal
<pre>
2038 70 Beraldo Leal
import os
2039 70 Beraldo Leal
from django.utils.translation import ugettext_lazy as _
2040 70 Beraldo Leal
DEBUG = False
2041 70 Beraldo Leal
TEMPLATE_DEBUG = DEBUG
2042 70 Beraldo Leal
PROD = False
2043 70 Beraldo Leal
USE_SSL = False
2044 70 Beraldo Leal
SWIFT_ENABLED = True
2045 70 Beraldo Leal
ENABLE_JUJU_PANEL = True
2046 70 Beraldo Leal
SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
2047 70 Beraldo Leal
LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
2048 70 Beraldo Leal
CACHE_BACKEND = 'memcached://192.168.69.1:11211/'
2049 70 Beraldo Leal
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
2050 70 Beraldo Leal
OPENSTACK_HOST = "192.168.69.1"
2051 70 Beraldo Leal
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
2052 70 Beraldo Leal
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
2053 70 Beraldo Leal
OPENSTACK_KEYSTONE_BACKEND = {
2054 70 Beraldo Leal
    'name': 'native',
2055 70 Beraldo Leal
    'can_edit_user': True
2056 70 Beraldo Leal
}
2057 70 Beraldo Leal
API_RESULT_LIMIT = 1000
2058 70 Beraldo Leal
LOGGING = {
2059 70 Beraldo Leal
        'version': 1,
2060 70 Beraldo Leal
        # When set to True this will disable all logging except
2061 70 Beraldo Leal
        # for loggers specified in this configuration dictionary. Note that
2062 70 Beraldo Leal
        # if nothing is specified here and disable_existing_loggers is True,
2063 70 Beraldo Leal
        # django.db.backends will still log unless it is disabled explicitly.
2064 70 Beraldo Leal
        'disable_existing_loggers': False,
2065 70 Beraldo Leal
        'handlers': {
2066 70 Beraldo Leal
            'null': {
2067 70 Beraldo Leal
                'level': 'DEBUG',
2068 70 Beraldo Leal
                'class': 'django.utils.log.NullHandler',
2069 70 Beraldo Leal
                },
2070 70 Beraldo Leal
            'console': {
2071 70 Beraldo Leal
                # Set the level to "DEBUG" for verbose output logging.
2072 70 Beraldo Leal
                'level': 'INFO',
2073 70 Beraldo Leal
                'class': 'logging.StreamHandler',
2074 70 Beraldo Leal
                },
2075 70 Beraldo Leal
            },
2076 70 Beraldo Leal
        'loggers': {
2077 70 Beraldo Leal
            # Logging from django.db.backends is VERY verbose, send to null
2078 70 Beraldo Leal
            # by default.
2079 70 Beraldo Leal
            'django.db.backends': {
2080 70 Beraldo Leal
                'handlers': ['null'],
2081 70 Beraldo Leal
                'propagate': False,
2082 70 Beraldo Leal
                },
2083 70 Beraldo Leal
            'horizon': {
2084 70 Beraldo Leal
                'handlers': ['console'],
2085 70 Beraldo Leal
                'propagate': False,
2086 70 Beraldo Leal
            },
2087 70 Beraldo Leal
            'novaclient': {
2088 70 Beraldo Leal
                'handlers': ['console'],
2089 70 Beraldo Leal
                'propagate': False,
2090 70 Beraldo Leal
            },
2091 70 Beraldo Leal
            'keystoneclient': {
2092 70 Beraldo Leal
                'handlers': ['console'],
2093 70 Beraldo Leal
                'propagate': False,
2094 70 Beraldo Leal
            },
2095 70 Beraldo Leal
            'nose.plugins.manager': {
2096 70 Beraldo Leal
                'handlers': ['console'],
2097 70 Beraldo Leal
                'propagate': False,
2098 70 Beraldo Leal
            }
2099 70 Beraldo Leal
        }
2100 70 Beraldo Leal
}
2101 70 Beraldo Leal
DATABASES = {
2102 70 Beraldo Leal
'default': {
2103 70 Beraldo Leal
'ENGINE': 'django.db.backends.mysql',
2104 70 Beraldo Leal
'NAME': 'dash',
2105 70 Beraldo Leal
'USER': 'dash',
2106 70 Beraldo Leal
'PASSWORD': 'dashpass',
2107 70 Beraldo Leal
'HOST': '192.168.69.1',
2108 70 Beraldo Leal
'default-character-set': 'utf8'
2109 70 Beraldo Leal
},
2110 70 Beraldo Leal
}
2111 70 Beraldo Leal
2112 70 Beraldo Leal
</pre>
2113 70 Beraldo Leal
2114 70 Beraldo Leal
Run the manage.py syncdb command to initialize the database.
2115 70 Beraldo Leal
2116 70 Beraldo Leal
<pre>
2117 70 Beraldo Leal
$ /usr/share/openstack-dashboard/manage.py syncdb
2118 70 Beraldo Leal
</pre>
2119 70 Beraldo Leal
2120 70 Beraldo Leal
2121 70 Beraldo Leal
Restart Apache to pick up the default site and symbolic link settings.
2122 70 Beraldo Leal
2123 70 Beraldo Leal
<pre>
2124 70 Beraldo Leal
# /etc/init.d/apache2 restart
2125 70 Beraldo Leal
</pre>
2126 70 Beraldo Leal
2127 70 Beraldo Leal
Restart the nova-api service to ensure the API server can connect to the Dashboard and to avoid an error displayed in the Dashboard
2128 70 Beraldo Leal
2129 70 Beraldo Leal
<pre>
2130 70 Beraldo Leal
sudo restart nova-api
2131 70 Beraldo Leal
</pre>