| 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 |  | 
 | 48 | :: | 
 | 49 |  | 
 | 50 |     adduser stack | 
 | 51 |  | 
 | 52 | Since this user will be making many changes to your system, it will need | 
 | 53 | to have sudo privileges: | 
 | 54 |  | 
 | 55 | :: | 
 | 56 |  | 
 | 57 |     apt-get install sudo -y || yum install -y sudo | 
 | 58 |     echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | 
 | 59 |  | 
 | 60 | From here on you should use the user you created. **Logout** and | 
 | 61 | **login** as that user. | 
 | 62 |  | 
 | 63 | Download DevStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 64 | ----------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 65 |  | 
 | 66 | We'll grab the latest version of DevStack via https: | 
 | 67 |  | 
 | 68 | :: | 
 | 69 |  | 
 | 70 |     sudo apt-get install git -y || yum install -y git | 
 | 71 |     git clone https://git.openstack.org/openstack-dev/devstack | 
 | 72 |     cd devstack | 
 | 73 |  | 
 | 74 | Run DevStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 75 | ------------ | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 76 |  | 
 | 77 | Now to configure ``stack.sh``. DevStack includes a sample in | 
 | 78 | ``devstack/samples/local.conf``. Create ``local.conf`` as shown below to | 
 | 79 | do the following: | 
 | 80 |  | 
 | 81 | -  Set ``FLOATING_RANGE`` to a range not used on the local network, i.e. | 
 | 82 |    192.168.1.224/27. This configures IP addresses ending in 225-254 to | 
 | 83 |    be used as floating IPs. | 
 | 84 | -  Set ``FIXED_RANGE`` and ``FIXED_NETWORK_SIZE`` to configure the | 
 | 85 |    internal address space used by the instances. | 
 | 86 | -  Set ``FLAT_INTERFACE`` to the Ethernet interface that connects the | 
 | 87 |    host to your local network. This is the interface that should be | 
 | 88 |    configured with the static IP address mentioned above. | 
 | 89 | -  Set the administrative password. This password is used for the | 
 | 90 |    **admin** and **demo** accounts set up as OpenStack users. | 
 | 91 | -  Set the MySQL administrative password. The default here is a random | 
 | 92 |    hex string which is inconvenient if you need to look at the database | 
 | 93 |    directly for anything. | 
 | 94 | -  Set the RabbitMQ password. | 
 | 95 | -  Set the service password. This is used by the OpenStack services | 
 | 96 |    (Nova, Glance, etc) to authenticate with Keystone. | 
 | 97 |  | 
 | 98 | ``local.conf`` should look something like this: | 
 | 99 |  | 
 | 100 | :: | 
 | 101 |  | 
 | 102 |     [[local|localrc]] | 
 | 103 |     FLOATING_RANGE=192.168.1.224/27 | 
 | 104 |     FIXED_RANGE=10.11.12.0/24 | 
 | 105 |     FIXED_NETWORK_SIZE=256 | 
 | 106 |     FLAT_INTERFACE=eth0 | 
 | 107 |     ADMIN_PASSWORD=supersecret | 
 | 108 |     MYSQL_PASSWORD=iheartdatabases | 
 | 109 |     RABBIT_PASSWORD=flopsymopsy | 
 | 110 |     SERVICE_PASSWORD=iheartksl | 
 | 111 |  | 
 | 112 | Run DevStack: | 
 | 113 |  | 
 | 114 | :: | 
 | 115 |  | 
 | 116 |     ./stack.sh | 
 | 117 |  | 
 | 118 | A seemingly endless stream of activity ensues. When complete you will | 
 | 119 | see a summary of ``stack.sh``'s work, including the relevant URLs, | 
 | 120 | accounts and passwords to poke at your shiny new OpenStack. | 
 | 121 |  | 
 | 122 | Using OpenStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 123 | --------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 124 |  | 
 | 125 | At this point you should be able to access the dashboard from other | 
 | 126 | computers on the local network. In this example that would be | 
 | 127 | http://192.168.1.201/ for the dashboard (aka Horizon). Launch VMs and if | 
 | 128 | you give them floating IPs and security group access those VMs will be | 
 | 129 | accessible from other machines on your network. | 
 | 130 |  | 
 | 131 | Some examples of using the OpenStack command-line clients ``nova`` and | 
 | 132 | ``glance`` are in the shakedown scripts in ``devstack/exercises``. | 
 | 133 | ``exercise.sh`` will run all of those scripts and report on the results. |