add code.org to intro and fix typo
[wiki.git] / openstack.mdwn
1 [[!toc levels=99]]
2
3 ## Installing OpenStack via Vagrant on Fedora 17 using https://github.com/lorin/openstack-ansible
4
5 The great thing about this repo is that it "just works" from Fedora 17 and quite possibly other platforms.
6
7 You'll be creating VMs within VMs, but don't worry about that. At the end of `make all` you'll have the following systems:
8
9 - **controller**: an Ubuntu box running the following OpenStack components
10     - Nova: https://github.com/lorin/openstack-ansible/blob/master/playbooks/nova/controller.yaml
11     - Glance: https://github.com/lorin/openstack-ansible/blob/master/playbooks/glance/setup.yaml
12     - Keystone: https://github.com/lorin/openstack-ansible/blob/master/playbooks/keystone/setup.yaml
13 - **compute1**: an Ubuntu box running the following OpenStack components
14     - Nova: https://github.com/lorin/openstack-ansible/blob/master/playbooks/nova/compute-host.yaml
15 - **instance-00000001**: a [CirrOS][] VM running on the **compute1** host
16
17 [CirrOS]: https://launchpad.net/cirros
18
19 ### Install dependencies 
20
21 (You'll need to install [Vagrant][] and its dependencies, of course.)
22
23 [Vagrant]: http://vagrantup.com
24
25     yum install ansible
26     yum install python-nova
27
28 (Fedora 17 ships with `python-nova-2012.1.3`)
29
30 ### `vagrant up` via `make all`
31
32     git clone https://github.com/lorin/openstack-ansible.git
33     cd openstack-ansible
34     make all
35
36 ### Verify that a "cirros" VM was created
37
38     source openrc
39     nova list
40
41 You should see output similar to this:
42
43     +--------------------------------------+--------+--------+-----------------------+
44     |                  ID                  |  Name  | Status |        Networks       |
45     +--------------------------------------+--------+--------+-----------------------+
46     | 8b10ed50-70a4-46a5-b69e-989cfe5b91a8 | cirros | ACTIVE | private=192.168.100.2 |
47     +--------------------------------------+--------+--------+-----------------------+
48
49 ### Take a look at the two Openstack hosts that were created ("controller" and "compute1")
50
51     cd vms
52     vagrant status
53
54 You should see output like this:
55
56     Current VM states:
57
58     controller               running
59     compute1                 running
60
61 To ssh to compute1 (from the "vms" directory)
62
63     vagrant ssh compute1
64
65 Once you're ssh'd in, you can run a `virsh list`:
66
67     vagrant@compute1:~$ virsh list
68      Id Name                 State
69     ----------------------------------
70       1 instance-00000001    running
71
72 Here's are the ethernet interfaces on the two Ubuntu hosts:
73
74 **controller**:
75
76     vagrant@controller:~$ ifconfig | grep 'inet addr' -B1
77     br100     Link encap:Ethernet  HWaddr 08:00:27:3f:9f:60  
78               inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0
79     --
80     eth0      Link encap:Ethernet  HWaddr 08:00:27:88:0c:a6  
81               inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
82     --
83     eth1      Link encap:Ethernet  HWaddr 08:00:27:20:6a:3f  
84               inet addr:192.168.206.130  Bcast:192.168.206.255  Mask:255.255.255.0
85     --
86     lo        Link encap:Local Loopback  
87               inet addr:127.0.0.1  Mask:255.0.0.0
88
89 **compute1**:
90
91     vagrant@compute1:~$ ifconfig | grep 'inet addr' -B1
92     br100     Link encap:Ethernet  HWaddr 08:00:27:d2:d2:9e  
93               inet addr:192.168.100.131  Bcast:192.168.100.255  Mask:255.255.255.0
94     --
95     eth0      Link encap:Ethernet  HWaddr 08:00:27:88:0c:a6  
96               inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
97     --
98     eth1      Link encap:Ethernet  HWaddr 08:00:27:d7:7d:cb  
99               inet addr:192.168.206.131  Bcast:192.168.206.255  Mask:255.255.255.0
100     --
101     lo        Link encap:Local Loopback  
102               inet addr:127.0.0.1  Mask:255.0.0.0
103     --
104     virbr0    Link encap:Ethernet  HWaddr de:d5:4a:6b:e0:48  
105               inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
106
107 I tried using a CentOS base box but the network config didn't work... the VMs didn't get the IP addresses from the Vagrantfile. Here is the error:
108
109     [controller] Configuring and enabling network interfaces...
110     The following SSH command responded with a non-zero exit status.
111     Vagrant assumes that this means the command failed!
112
113     /sbin/ifup eth1 2> /dev/null
114
115 Other users of CentOS base boxes report similar problems here: https://github.com/mitchellh/vagrant/issues/997
116
117 For some discussion of my situation: http://irclog.perlgeek.de/crimsonfu/2012-10-31#i_6116485