summaryrefslogtreecommitdiffstats
path: root/docs/getting.started.rst
blob: 55a73dd00b09720e867e77f4819490e1ff680c50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Getting Started with Nova
=========================


GOTTA HAVE A nova.pth file added or it WONT WORK (will write setup.py file soon)

Create a file named nova.pth in your python libraries directory
(usually /usr/local/lib/python2.6/dist-packages) with a single line that points
to the directory where you checked out the source (that contains the nova/
directory).

DEPENDENCIES
------------

Related servers we rely on

* RabbitMQ: messaging queue, used for all communication between components
* OpenLDAP: users, groups (maybe cut)
* ReDIS: Remote Dictionary Store (for fast, shared state data)
* nginx: HTTP server to handle serving large files (because Tornado can't)

Python libraries we don't vendor

* M2Crypto: python library interface for openssl
* curl

Vendored python libaries (don't require any installation)

* Tornado: scalable non blocking web server for api requests
* Twisted: just for the twisted.internet.defer package
* boto: python api for aws api
* IPy: library for managing ip addresses

Recommended
-----------------

* euca2ools: python implementation of aws ec2-tools and ami tools
* build tornado to use C module for evented section


Installation
--------------
::

    # system libraries and tools
    apt-get install -y aoetools vlan curl
    modprobe aoe

    # python libraries
    apt-get install -y python-setuptools python-dev python-pycurl python-m2crypto

    # ON THE CLOUD CONTROLLER
    apt-get install -y rabbitmq-server dnsmasq nginx
    # build redis from 2.0.0-rc1 source
    # setup ldap (slap.sh as root will remove ldap and reinstall it)
    NOVA_PATH/nova/auth/slap.sh
    /etc/init.d/rabbitmq-server start

    # ON VOLUME NODE:
    apt-get install -y vblade-persist

    # ON THE COMPUTE NODE:
    apt-get install -y python-libvirt
    apt-get install -y kpartx kvm libvirt-bin
    modprobe kvm

    # optional packages
    apt-get install -y euca2ools

Configuration
---------------

ON CLOUD CONTROLLER

* Add yourself to the libvirtd group, log out, and log back in
* fix hardcoded ec2 metadata/userdata uri ($IP is the IP of the cloud), and masqurade all traffic from launched instances
::

    iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination $IP:8773
    iptables --table nat --append POSTROUTING --out-interface $PUBLICIFACE -j MASQUERADE


* Configure NginX proxy (/etc/nginx/sites-enabled/default)

::

  server {
    listen 3333 default;
    server-name localhost;
    client_max_body_size 10m;

    access_log /var/log/nginx/localhost.access.log;

    location ~ /_images/.+ {
      root NOVA_PATH/images;
      rewrite ^/_images/(.*)$ /$1 break;
    }

    location / {
      proxy_pass http://localhost:3334/;
    }
  }

ON VOLUME NODE

* create a filesystem (you can use an actual disk if you have one spare, default is /dev/sdb)

::

    # This creates a 1GB file to create volumes out of
    dd if=/dev/zero of=MY_FILE_PATH bs=100M count=10
    losetup --show -f MY_FILE_PATH
    # replace loop0 below with whatever losetup returns
    echo "--storage_dev=/dev/loop0" >> NOVA_PATH/bin/nova.conf

Running
---------

Launch servers

* rabbitmq
* redis
* slapd
* nginx

Launch nova components

* nova-api
* nova-compute
* nova-objectstore
* nova-volume