blob: ef59953eb62136592719cea977a792f5c18b268b [file] [log] [blame]
Dean Troyer26dd21b2014-11-06 09:33:02 -06001====================
2All-In-One Single VM
3====================
Sean M. Collins09e550c2014-10-21 11:40:08 -04004
5Use the cloud to build the cloud! Use your cloud to launch new versions
6of OpenStack in about 5 minutes. When you break it, start over! The VMs
7launched in the cloud will be slow as they are running in QEMU
8(emulation), but their primary use is testing OpenStack development and
9operation. Speed not required.
10
11Prerequisites Cloud & Image
12---------------------------
13
14Virtual Machine
15~~~~~~~~~~~~~~~
16
17DevStack should run in any virtual machine running a supported Linux
18release. It will perform best with 2Gb or more of RAM.
19
20OpenStack Deployment & cloud-init
21~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22
23If the cloud service has an image with ``cloud-init`` pre-installed, use
24it. You can get one from `Ubuntu's Daily
25Build <http://uec-images.ubuntu.com>`__ site if necessary. This will
26enable you to launch VMs with userdata that installs everything at boot
27time. The userdata script below will install and run DevStack with a
28minimal configuration. The use of ``cloud-init`` is outside the scope of
29this document, refer to the ``cloud-init`` docs for more information.
30
31If you are directly using a hypervisor like Xen, kvm or VirtualBox you
32can manually kick off the script below as a non-root user in a
33bare-bones server installation.
34
35Installation shake and bake
36---------------------------
37
38Launching With Cloud-Init
39~~~~~~~~~~~~~~~~~~~~~~~~~
40
41This cloud config grabs the latest version of DevStack via git, creates
42a minimal ``local.conf`` file and kicks off ``stack.sh``. It should be
43passed as the user-data file when booting the VM.
44
45::
46
47 #cloud-config
48
49 users:
50 - default
51 - name: stack
52 lock_passwd: False
53 sudo: ["ALL=(ALL) NOPASSWD:ALL\nDefaults:stack !requiretty"]
54 shell: /bin/bash
55
56 write_files:
57 - content: |
58 #!/bin/sh
59 DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy update || sudo yum update -qy
60 DEBIAN_FRONTEND=noninteractive sudo apt-get install -qqy git || sudo yum install -qy git
61 sudo chown stack:stack /home/stack
62 cd /home/stack
63 git clone https://git.openstack.org/openstack-dev/devstack
64 cd devstack
65 echo '[[local|localrc]]' > local.conf
66 echo ADMIN_PASSWORD=password >> local.conf
67 echo MYSQL_PASSWORD=password >> local.conf
68 echo RABBIT_PASSWORD=password >> local.conf
69 echo SERVICE_PASSWORD=password >> local.conf
70 echo SERVICE_TOKEN=tokentoken >> local.conf
71 ./stack.sh
72 path: /home/stack/start.sh
73 permissions: 0755
74
75 runcmd:
76 - su -l stack ./start.sh
77
78As DevStack will refuse to run as root, this configures ``cloud-init``
79to create a non-root user and run the ``start.sh`` script as that user.
80
81Launching By Hand
82~~~~~~~~~~~~~~~~~
83
84Using a hypervisor directly, launch the VM and either manually perform
85the steps in the embedded shell script above or copy it into the VM.
86
87Using OpenStack
88~~~~~~~~~~~~~~~
89
90At this point you should be able to access the dashboard. Launch VMs and
91if you give them floating IPs access those VMs from other machines on
92your network.
93
94One interesting use case is for developers working on a VM on their
95laptop. Once ``stack.sh`` has completed once, all of the pre-requisite
96packages are installed in the VM and the source trees checked out.
97Setting ``OFFLINE=True`` in ``local.conf`` enables ``stack.sh`` to run
98multiple times without an Internet connection. DevStack, making hacking
99at the lake possible since 2012!