Debian Codegraph @

doc/source/contributor/devstack_setup.rst

raw
1 ====================
2 DevStack Quick Start
3 ====================
4
5 Create stack user (optional)
6 ----------------------------
7
8 Devstack should be run as a non-root user with sudo enabled (standard logins to
9 cloud images such as “ubuntu” or “cloud-user” are usually fine).
10
11 You can quickly create a separate stack user to run DevStack with.
12
13 .. code-block:: console
14
15 $ sudo useradd -s /bin/bash -d /opt/stack -m stack
16
17 Since this user will be making many changes to your system, it should have sudo
18 privileges:
19
20 .. code-block:: console
21
22 $ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
23
24 .. code-block:: console
25
26 $ sudo su - stack
27
28 Download DevStack
29 -----------------
30
31 .. code-block:: console
32
33 $ git clone https://opendev.org/openstack/devstack
34
35 .. code-block:: console
36
37 $ cd devstack
38
39 The ``devstack`` repo contains a script that installs OpenStack.
40
41 Create local.conf file
42 ----------------------
43
44 Create a ``local.conf`` file at the root of the devstack git repo.
45
46 Host settings
47 >>>>>>>>>>>>>
48
49 ::
50
51 [[local|localrc]]
52 HOST_IP=YOUR_IP_CONFIG
53 SERVICE_HOST=$HOST_IP
54 DATABASE_TYPE=mysql
55 MYSQL_HOST=$HOST_IP
56 RABBIT_HOST=$HOST_IP
57
58 - Replace YOUR_IP_CONFIG with your host IP (e.g. 10.0.0.72 or localhost).
59
60 Password settings
61 >>>>>>>>>>>>>>>>>
62
63 ::
64
65 # Passwords
66 DATABASE_PASSWORD=123
67 ADMIN_PASSWORD=123
68 MYSQL_PASSWORD=123
69 RABBIT_PASSWORD=123
70 SERVICE_PASSWORD=123
71 SERVICE_TOKEN=ADMIN
72
73 - Pre-set the passwords to prevent interactive prompts.
74
75 Enable services
76 >>>>>>>>>>>>>>>
77
78 ::
79
80 #FIXED_RANGE=192.168.128.0/24
81 #IPV4_ADDRS_SAFE_TO_USE=192.168.128.0/24
82 #GIT_BASE=/opt/git
83 disable_service n-net
84 disable_service tempest
85 disable_service heat
86 enable_service q-svc
87 enable_service q-agt
88 enable_service q-dhcp
89 enable_service q-l3
90 enable_service q-meta
91 enable_service neutron
92 enable_service n-novnc
93 enable_plugin cyborg https://opendev.org/openstack/cyborg
94 NOVA_VNC_ENABLED=True
95 NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html"
96 VNCSERVER_LISTEN=0.0.0.0
97 VNCSERVER_PROXYCLIENT_ADDRESS=$SERVICE_HOST
98 RECLONE=False
99 #enable Logging
100 LOGFILE=/opt/stack/logs/stack.sh.log
101 VERBOSE=True
102 LOG_COLOR=True
103 LOGDIR=/opt/stack/logs
104
105 - Uncomment GIT_BASE configuration if you have a local git repo
106
107 - enable_plugin cyborg will execute cyborg/devstack/plugin.sh and start cyborg
108 service
109
110 - The devstack logs will appear in $LOGDIR
111
112 .. note::
113
114 If you got version conflicts, please set ``PIP_UPGRADE`` to ``True`` in local.conf
115
116
117 Multi-Node Lab
118 --------------
119 If you want to setup an OpenStack with cyborg in a realistic test configuration
120 with multiple physical servers. Please ref [#MultiNodeLab]_.
121
122 Cluster Controller
123 >>>>>>>>>>>>>>>>>>
124
125 ::
126
127 disable_service cyborg-agent
128
129 Compute Nodes
130 >>>>>>>>>>>>>
131
132 ::
133
134 enable_service cyborg-agent
135 disable_service cyborg-api
136 disable_service cyborg-cond
137
138 - If you do not want to setup cyborg-agent on controller, you can disable it.
139 - You do not need to enable cyborg-api and cyborg-cond on compute nodes.
140
141 Testing with unmerged changes
142 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
143
144 To test with changes that have not been merged, the enable_plugin
145 line can be modified to specify the branch/reference to be cloned.
146
147 ::
148
149 enable_plugin cyborg https://review.opendev.org/openstack/cyborg refs/changes/28/708728/1
150
151 the format is
152
153 ::
154
155 enable_plugin <directory name> <git repo url> <change/revision>
156
157
158 Cell V2 Deployment
159 >>>>>>>>>>>>>>>>>>
160
161 Compute node services must be mapped to a cell before they can be used.
162 Cell V2 deployment, please ref [#CellV2]_.
163
164 Run DevStack
165 ------------
166
167 .. code-block:: console
168
169 $ ./stack.sh
170
171 This will take a 30-40 minutes, largely depending on the speed of your internet
172 connection. Many git trees and packages will be installed during this process.
173
174 It will speed up your installation if you have a local GIT_BASE.
175
176 Use OpenStack
177 -------------
178
179 Command line
180 >>>>>>>>>>>>
181
182 You can ``source openrc YOUR_USER YOUR_USER (e.g. source openrc admin admin)``
183 in your shell, and then use the ``openstack`` command line tool to manage your
184 devstack.
185
186 Horizon
187 >>>>>>>
188
189 You can access horizon to experience the web interface to OpenStack, and manage
190 vms, networks, volumes, and images from there.
191
192 References
193 ==========
194
195 .. [#MultiNodeLab] `Openstack Multi-Node Lab Setup
196 <https://docs.openstack.org/devstack/latest/guides/multinode-lab.html>`_
197 .. [#CellV2] `Openstack Cell V2 Deployment Guide
198 <https://docs.openstack.org/nova/latest/user/cells.html>`_