blob: 8ebf2a638dc7915469787e19275ba94e2ae81706 [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
Matt Riedemann9b6d2f22019-06-18 10:43:16 -040063 git clone https://opendev.org/openstack/devstack
Sean M. Collins09e550c2014-10-21 11:40:08 -040064 cd devstack
65 echo '[[local|localrc]]' > local.conf
66 echo ADMIN_PASSWORD=password >> local.conf
Swapnil (coolsvap) Kulkarnic988bf62015-10-08 13:10:43 +053067 echo DATABASE_PASSWORD=password >> local.conf
Sean M. Collins09e550c2014-10-21 11:40:08 -040068 echo RABBIT_PASSWORD=password >> local.conf
69 echo SERVICE_PASSWORD=password >> local.conf
Sean M. Collins09e550c2014-10-21 11:40:08 -040070 ./stack.sh
71 path: /home/stack/start.sh
72 permissions: 0755
73
74 runcmd:
75 - su -l stack ./start.sh
76
77As DevStack will refuse to run as root, this configures ``cloud-init``
78to create a non-root user and run the ``start.sh`` script as that user.
79
Matt Riedemannf798ec12015-09-01 13:20:48 -070080If you are using cloud-init and you have not
81`enabled custom logging <../configuration.html#enable-logging>`_ of the stack
82output, then the stack output can be found in
83``/var/log/cloud-init-output.log`` by default.
84
Sean M. Collins09e550c2014-10-21 11:40:08 -040085Launching By Hand
Sean Dague32930462014-11-18 06:51:16 -050086-----------------
Sean M. Collins09e550c2014-10-21 11:40:08 -040087
88Using a hypervisor directly, launch the VM and either manually perform
89the steps in the embedded shell script above or copy it into the VM.
90
91Using OpenStack
Sean Dague32930462014-11-18 06:51:16 -050092---------------
Sean M. Collins09e550c2014-10-21 11:40:08 -040093
94At this point you should be able to access the dashboard. Launch VMs and
Shilla Saebi2ed09d82015-04-21 15:02:13 -040095if you give them floating IPs, access those VMs from other machines on
Sean M. Collins09e550c2014-10-21 11:40:08 -040096your network.
97
98One interesting use case is for developers working on a VM on their
99laptop. Once ``stack.sh`` has completed once, all of the pre-requisite
100packages are installed in the VM and the source trees checked out.
101Setting ``OFFLINE=True`` in ``local.conf`` enables ``stack.sh`` to run
102multiple times without an Internet connection. DevStack, making hacking
103at the lake possible since 2012!