blob: c2ce1a34a02cd3bcb5f71e77b5d361ef944d2252 [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
Shilla Saebi2ed09d82015-04-21 15:02:13 -04006of OpenStack in about 5 minutes. If you break it, start over! The VMs
Sean M. Collins09e550c2014-10-21 11:40:08 -04007launched in the cloud will be slow as they are running in QEMU
8(emulation), but their primary use is testing OpenStack development and
Shilla Saebi2ed09d82015-04-21 15:02:13 -04009operation.
Sean M. Collins09e550c2014-10-21 11:40:08 -040010
11Prerequisites Cloud & Image
Sean Dague32930462014-11-18 06:51:16 -050012===========================
Sean M. Collins09e550c2014-10-21 11:40:08 -040013
14Virtual Machine
Sean Dague32930462014-11-18 06:51:16 -050015---------------
Sean M. Collins09e550c2014-10-21 11:40:08 -040016
17DevStack should run in any virtual machine running a supported Linux
Shilla Saebi2ed09d82015-04-21 15:02:13 -040018release. It will perform best with 4GB or more of RAM.
Sean M. Collins09e550c2014-10-21 11:40:08 -040019
20OpenStack Deployment & cloud-init
Sean Dague32930462014-11-18 06:51:16 -050021---------------------------------
Sean M. Collins09e550c2014-10-21 11:40:08 -040022
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
Sean Dague32930462014-11-18 06:51:16 -050036===========================
Sean M. Collins09e550c2014-10-21 11:40:08 -040037
38Launching With Cloud-Init
Sean Dague32930462014-11-18 06:51:16 -050039-------------------------
Sean M. Collins09e550c2014-10-21 11:40:08 -040040
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
Sean Dague32930462014-11-18 06:51:16 -050082-----------------
Sean M. Collins09e550c2014-10-21 11:40:08 -040083
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
Sean Dague32930462014-11-18 06:51:16 -050088---------------
Sean M. Collins09e550c2014-10-21 11:40:08 -040089
90At this point you should be able to access the dashboard. Launch VMs and
Shilla Saebi2ed09d82015-04-21 15:02:13 -040091if you give them floating IPs, access those VMs from other machines on
Sean M. Collins09e550c2014-10-21 11:40:08 -040092your 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!