| Dean Troyer | 26dd21b | 2014-11-06 09:33:02 -0600 | [diff] [blame] | 1 | ========================= | 
|  | 2 | All-In-One Single Machine | 
|  | 3 | ========================= | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 4 |  | 
|  | 5 | Things are about to get real! Using OpenStack in containers or VMs is | 
|  | 6 | nice for kicking the tires, but doesn't compare to the feeling you get | 
|  | 7 | with hardware. | 
|  | 8 |  | 
|  | 9 | Prerequisites Linux & Network | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 10 | ============================= | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 11 |  | 
|  | 12 | Minimal Install | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 13 | --------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 14 |  | 
|  | 15 | You need to have a system with a fresh install of Linux. You can | 
|  | 16 | download the `Minimal | 
|  | 17 | CD <https://help.ubuntu.com/community/Installation/MinimalCD>`__ for | 
|  | 18 | Ubuntu releases since DevStack will download & install all the | 
|  | 19 | additional dependencies. The netinstall ISO is available for | 
| Dean Troyer | ea3cdfa | 2014-11-08 08:29:16 -0600 | [diff] [blame] | 20 | `Fedora <http://mirrors.kernel.org/fedora/releases/>`__ | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 21 | and | 
| Dean Troyer | ea3cdfa | 2014-11-08 08:29:16 -0600 | [diff] [blame] | 22 | `CentOS/RHEL <http://mirrors.kernel.org/centos/>`__. | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 23 | You may be tempted to use a desktop distro on a laptop, it will probably | 
|  | 24 | work but you may need to tell Network Manager to keep its fingers off | 
|  | 25 | the interface(s) that OpenStack uses for bridging. | 
|  | 26 |  | 
|  | 27 | Network Configuration | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 28 | --------------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 29 |  | 
|  | 30 | Determine the network configuration on the interface used to integrate | 
|  | 31 | your OpenStack cloud with your existing network. For example, if the IPs | 
|  | 32 | given out on your network by DHCP are 192.168.1.X - where X is between | 
|  | 33 | 100 and 200 you will be able to use IPs 201-254 for **floating ips**. | 
|  | 34 |  | 
|  | 35 | To make things easier later change your host to use a static IP instead | 
|  | 36 | of DHCP (i.e. 192.168.1.201). | 
|  | 37 |  | 
|  | 38 | Installation shake and bake | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 39 | =========================== | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 40 |  | 
|  | 41 | Add your user | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 42 | ------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 43 |  | 
|  | 44 | We need to add a user to install DevStack. (if you created a user during | 
|  | 45 | install you can skip this step and just give the user sudo privileges | 
|  | 46 | below) | 
|  | 47 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 48 | .. code-block:: console | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 49 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 50 | $ sudo useradd -s /bin/bash -d /opt/stack -m stack | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 51 |  | 
|  | 52 | Since this user will be making many changes to your system, it will need | 
|  | 53 | to have sudo privileges: | 
|  | 54 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 55 | .. code-block:: console | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 56 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 57 | $ apt-get install sudo -y || yum install -y sudo | 
|  | 58 | $ echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | 
|  | 59 |  | 
|  | 60 | .. note:: On some systems you may need to use ``sudo visudo``. | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 61 |  | 
|  | 62 | From here on you should use the user you created. **Logout** and | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 63 | **login** as that user: | 
|  | 64 |  | 
|  | 65 | .. code-block:: console | 
|  | 66 |  | 
|  | 67 | $ sudo su stack && cd ~ | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 68 |  | 
|  | 69 | Download DevStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 70 | ----------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 71 |  | 
|  | 72 | We'll grab the latest version of DevStack via https: | 
|  | 73 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 74 | .. code-block:: console | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 75 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 76 | $ sudo apt-get install git -y || sudo yum install -y git | 
| Matt Riedemann | 9b6d2f2 | 2019-06-18 10:43:16 -0400 | [diff] [blame] | 77 | $ git clone https://opendev.org/openstack/devstack | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 78 | $ cd devstack | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 79 |  | 
|  | 80 | Run DevStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 81 | ------------ | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 82 |  | 
|  | 83 | Now to configure ``stack.sh``. DevStack includes a sample in | 
|  | 84 | ``devstack/samples/local.conf``. Create ``local.conf`` as shown below to | 
|  | 85 | do the following: | 
|  | 86 |  | 
|  | 87 | -  Set ``FLOATING_RANGE`` to a range not used on the local network, i.e. | 
|  | 88 | 192.168.1.224/27. This configures IP addresses ending in 225-254 to | 
|  | 89 | be used as floating IPs. | 
| Stephen Finucane | 4b8cba7 | 2019-05-21 14:17:11 +0100 | [diff] [blame] | 90 | -  Set ``FIXED_RANGE`` to configure the internal address space used by the | 
|  | 91 | instances. | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 92 | -  Set the administrative password. This password is used for the | 
|  | 93 | **admin** and **demo** accounts set up as OpenStack users. | 
|  | 94 | -  Set the MySQL administrative password. The default here is a random | 
|  | 95 | hex string which is inconvenient if you need to look at the database | 
|  | 96 | directly for anything. | 
|  | 97 | -  Set the RabbitMQ password. | 
|  | 98 | -  Set the service password. This is used by the OpenStack services | 
|  | 99 | (Nova, Glance, etc) to authenticate with Keystone. | 
|  | 100 |  | 
|  | 101 | ``local.conf`` should look something like this: | 
|  | 102 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 103 | .. code-block:: ini | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 104 |  | 
|  | 105 | [[local|localrc]] | 
|  | 106 | FLOATING_RANGE=192.168.1.224/27 | 
|  | 107 | FIXED_RANGE=10.11.12.0/24 | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 108 | ADMIN_PASSWORD=supersecret | 
| Swapnil (coolsvap) Kulkarni | c988bf6 | 2015-10-08 13:10:43 +0530 | [diff] [blame] | 109 | DATABASE_PASSWORD=iheartdatabases | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 110 | RABBIT_PASSWORD=flopsymopsy | 
|  | 111 | SERVICE_PASSWORD=iheartksl | 
|  | 112 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 113 | .. note:: There is a sample :download:`local.conf </assets/local.conf>` file | 
|  | 114 | under the *samples* directory in the devstack repository. | 
|  | 115 |  | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 116 | Run DevStack: | 
|  | 117 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 118 | .. code-block:: console | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 119 |  | 
| Matt Riedemann | 584979c | 2018-12-13 08:22:12 -0500 | [diff] [blame] | 120 | $ ./stack.sh | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 121 |  | 
|  | 122 | A seemingly endless stream of activity ensues. When complete you will | 
|  | 123 | see a summary of ``stack.sh``'s work, including the relevant URLs, | 
|  | 124 | accounts and passwords to poke at your shiny new OpenStack. | 
|  | 125 |  | 
|  | 126 | Using OpenStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 127 | --------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 128 |  | 
|  | 129 | At this point you should be able to access the dashboard from other | 
|  | 130 | computers on the local network. In this example that would be | 
|  | 131 | http://192.168.1.201/ for the dashboard (aka Horizon). Launch VMs and if | 
|  | 132 | you give them floating IPs and security group access those VMs will be | 
|  | 133 | accessible from other machines on your network. |