~evilnick/clouddocs/latest-pre-sprint

« back to all changes in this revision

Viewing changes to Admin/Scaling-OpenStack.md

  • Committer: Frank Mueller
  • Date: 2014-04-16 10:14:27 UTC
  • Revision ID: frank.mueller@canonical.com-20140416101427-63g1yxjlqusfhgyx
Add files from former branches to reorganized project

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Title: Scaling - OpenStack
 
2
Status: In Progress
 
3
 
 
4
# Scaling - OpenStack
 
5
 
 
6
## Introduction
 
7
 
 
8
Whereas traditional applications required larger hardware to scale ("vertical scaling"), 
 
9
cloud-based applications typically request more, discrete hardware ("horizontal scaling"). 
 
10
If your cloud is successful, eventually you must add resources to meet the increasing 
 
11
demand.
 
12
 
 
13
To suit the cloud paradigm, OpenStack itself is designed to be horizontally scalable. 
 
14
Rather than switching to larger servers, you procure more servers and simply install 
 
15
identically configured services. Ideally, you scale out and load balance among groups 
 
16
of functionally identical services.
 
17
 
 
18
But to scale the services running on OpenStack sometimes even OpenStack itself has to
 
19
be scaled. This means nodes for computing or storage have to be added.
 
20
 
 
21
## Scope
 
22
 
 
23
**TODO**
 
24
 
 
25
## Nova
 
26
 
 
27
### Analyzis
 
28
 
 
29
To list the hosts and the nova-related services that run on them call
 
30
 
 
31
```
 
32
$ nova host-list
 
33
+------------------+-------------+----------+
 
34
| host_name        | service     | zone     |
 
35
+------------------+-------------+----------+
 
36
| devstack-grizzly | conductor   | internal |
 
37
| devstack-grizzly | compute     | nova     |
 
38
| devstack-grizzly | cert        | internal |
 
39
| devstack-grizzly | network     | internal |
 
40
| devstack-grizzly | scheduler   | internal |
 
41
| devstack-grizzly | consoleauth | internal |
 
42
+------------------+-------------+----------+
 
43
```
 
44
 
 
45
To get a summary of resource usage of all of the instances running on the host call
 
46
 
 
47
```
 
48
$ nova host-describe devstack-grizzly
 
49
+------------------+----------------------------------+-----+-----------+---------+
 
50
| HOST             | PROJECT                          | cpu | memory_mb | disk_gb |
 
51
+------------------+----------------------------------+-----+-----------+---------+
 
52
| devstack-grizzly | (total)                          | 2   | 4003      | 157     |
 
53
| devstack-grizzly | (used_now)                       | 3   | 5120      | 40      |
 
54
| devstack-grizzly | (used_max)                       | 3   | 4608      | 40      |
 
55
| devstack-grizzly | b70d90d65e464582b6b2161cf3603ced | 1   | 512       | 0       |
 
56
| devstack-grizzly | 66265572db174a7aa66eba661f58eb9e | 2   | 4096      | 40      |
 
57
+------------------+----------------------------------+-----+-----------+---------+
 
58
```
 
59
 
 
60
These information help you understand how this host is used.
 
61
 
 
62
- The `cpu` column shows the sum of the virtual CPUs for instances running on the host.
 
63
- The `memory_mb` column shows the sum of the memory (in MB) allocated to the instances 
 
64
  that run on the hosts.
 
65
- The `disk_gb` column shows the sum of the root and ephemeral disk sizes (in GB) of 
 
66
  the instances that run on the hosts.
 
67
- The `used_now` row shows the sum of the resources allocated to the instances that run 
 
68
  on the host plus the resources allocated to the virtual machine of the host itself.
 
69
- The `used_max` row shows the sum of the resources allocated to the instances that run 
 
70
  on the host.
 
71
 
 
72
**Note:** These values are computed by using only information about the flavors of the 
 
73
instances that run on the hosts. This command does not query the CPU usage, memory usage, 
 
74
or hard disk usage of the physical host.
 
75
 
 
76
Now you an retrieve the CPU, memory, I/O, and network statistics for an instance. First
 
77
list all instances.
 
78
 
 
79
```
 
80
$ nova list
 
81
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
 
82
| ID                                   | Name                 | Status | Task State | Power State | Networks         |
 
83
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
 
84
| 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 | myCirrosServer       | ACTIVE | None       | Running     | private=10.0.0.3 |
 
85
| 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | myInstanceFromVolume | ACTIVE | None       | Running     | private=10.0.0.4 |
 
86
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
 
87
```
 
88
 
 
89
Then, get diagnostic statistics:
 
90
 
 
91
```
 
92
$ nova diagnostics myCirrosServer
 
93
+------------------+----------------+
 
94
| Property         | Value          |
 
95
+------------------+----------------+
 
96
| vnet1_rx         | 1210744        |
 
97
| cpu0_time        | 19624610000000 |
 
98
| vda_read         | 0              |
 
99
| vda_write        | 0              |
 
100
| vda_write_req    | 0              |
 
101
| vnet1_tx         | 863734         |
 
102
| vnet1_tx_errors  | 0              |
 
103
| vnet1_rx_drop    | 0              |
 
104
| vnet1_tx_packets | 3855           |
 
105
| vnet1_tx_drop    | 0              |
 
106
| vnet1_rx_errors  | 0              |
 
107
| memory           | 2097152        |
 
108
| vnet1_rx_packets | 5485           |
 
109
| vda_read_req     | 0              |
 
110
| vda_errors       | -1             |
 
111
+------------------+----------------+
 
112
```
 
113
 
 
114
Finally you can get summary statistics for each tenant.
 
115
 
 
116
```
 
117
$ nova usage-list
 
118
Usage from 2013-06-25 to 2013-07-24:
 
119
+----------------------------------+-----------+--------------+-----------+---------------+
 
120
| Tenant ID                        | Instances | RAM MB-Hours | CPU Hours | Disk GB-Hours |
 
121
+----------------------------------+-----------+--------------+-----------+---------------+
 
122
| b70d90d65e464582b6b2161cf3603ced | 1         | 344064.44    | 672.00    | 0.00          |
 
123
| 66265572db174a7aa66eba661f58eb9e | 3         | 671626.76    | 327.94    | 6558.86       |
 
124
+----------------------------------+-----------+--------------+-----------+---------------+
 
125
```
 
126
 
 
127
**TODO** How to interpret this information to know when to scale?
 
128
 
 
129
### Scaling
 
130
 
 
131
Adding compute nodes is straightforward. They are easily picked up by the existing 
 
132
installation. Simply call
 
133
 
 
134
```
 
135
juju add-unit nova-compute
 
136
```
 
137
 
 
138
## Cinder
 
139
 
 
140
**TODO**