openstackinstallation guide

17
Preparing a Test Environment Using OpenStack By: Sabir Mustafa Project Lead RHCE, MCSA, Oracle Enterprise Linux Certified Web site: www.sabirmustafa.com Ph: +923336781389 Host Access Client Package(HACP), Enterprise Modernization IBM Royal Cyber Inc

Upload: stanbael

Post on 03-Dec-2015

12 views

Category:

Documents


1 download

DESCRIPTION

Installation and Configuration of Open Stack

TRANSCRIPT

Preparing a Test Environment Using

OpenStack

By:

Sabir Mustafa

Project Lead

RHCE, MCSA, Oracle Enterprise Linux Certified

Web site: www.sabirmustafa.com

Ph: +923336781389

Host Access Client Package(HACP), Enterprise Modernization IBM

Royal Cyber Inc

Table of Contents INTRODUCTION ............................................................................................................................................. 3

Environment Settings .................................................................................................................................... 4

Tasks to be performed during installation. ................................................................................................... 4

Post install actions ........................................................................................................................................ 4

Update all packages .................................................................................................................................. 4

Disable Selinux .......................................................................................................................................... 4

Disable Firewall (or you need to write rules accordingly) ........................................................................ 4

Disable NetworkManager and enable “network” .................................................................................... 4

Grant root privileges to “test1” user ........................................................................................................ 5

OpenStack Installation .................................................................................................................................. 5

Installing OpenStack files .......................................................................................................................... 5

Setup RDO repositories ............................................................................................................................. 5

Install PackStack Installer .......................................................................................................................... 5

Run PackStack to install OpenStack .......................................................................................................... 5

Reteriving the “admin” user and password information .......................................................................... 6

Working with OpenStack .............................................................................................................................. 7

Accessing Web UI ...................................................................................................................................... 7

Setting up basic environment ................................................................................................................... 8

Creating Key Pairs ..................................................................................................................................... 9

Creating an Image ................................................................................................................................... 10

Creating an instance of Fedora22 (VM) .................................................................................................. 12

Connecting to instance via SSH ............................................................................................................... 16

Credits ......................................................................................................................................................... 17

INTRODUCTION It is a very basic guide that shall include all the components i.e. keystone, nova, neutron etc. shall reside on single node. A multi-node deployment needs more time and resources. The community will be kept posted of any new progress.

Environment Settings

CentOS 7 64-bit Virtual Machine on VMWare o 01 LAN Card using Bridged network o RAM 08 GB o Virtual Disk 40 GB o Virtual Processors 2x2

Tasks to be performed during installation.

Software Selection (Choose Minimal Install) Installation Destination (Choose Automatic partition) Network and Hostname (Enable Network, hostname=server1.mystack.com) User creation (create a user “test1” and provide its password as desired)

Post install actions

Update all packages yum update -y

Disable Selinux vi /etc/selinux/config and change SELINUX=enforcing To SELINUX=disabled save and reboot

Disable Firewall (or you need to write rules accordingly) systemctl stop firewalld systemctl disable firewalld systemctl stop firewalld.service

Disable NetworkManager and enable “network” The OpenStack does not work if NetworkManager is enabled.

systemctl stop NetworkManager systemctl disable NetworkManager systemctl start network

Grant root privileges to “test1” user viduso test1 ALL=(ALL) ALL save and close the file

OpenStack Installation

Installing OpenStack files Switch to “test1” user created during the installation

su - test1

Setup RDO repositories sudo yum install -y https://rdoproject.org/repos/rdo-release.rpm

Install PackStack Installer sudo yum install -y openstack-packstack

Run PackStack to install OpenStack packstack --allinone

Note: - it may take 30-50 minutes depending upon your internet speed.

If everything goes well, you will see message similar to following

Applying Puppet manifests [ DONE ] Finalizing [ DONE ] **** Installation completed successfully ****** Additional information: * A new answerfile was created in: /home/test1/packstack-answers-20151020-070508.txt * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components. * File /root/keystonerc_admin has been created on OpenStack client host 192.x.x.90. To use the command line tools you need to source the file. * Copy of keystonerc_admin file has been created for non-root user in /home/test1. * To access the OpenStack Dashboard browse to http://192.x.x.90/dashboard . Please, find your login credentials stored in the keystonerc_admin in your home directory. * To use Nagios, browse to http://192.x.x.90/nagios username: nagiosadmin, password: 3a452196e8804e5b

* The installation log file is available at: /var/tmp/packstack/20151020-070508-Jk001o/openstack-setup.log * The generated manifests are available at: /var/tmp/packstack/20151020-070508-Jk001o/manifests

Reteriving the “admin” user and password information sudo vi keystonerc_admin

Write down the OS_USERNAME and OS_PASSWORD with you.

Working with OpenStack

Accessing Web UI

Switch to browser and access the OpenStack url of your machine. Supply the username and password

After logon, you will see following dashboard.

Setting up basic environment Allow the SSH connections to instances that shall be created later

Go to Compute -> Access & Security -> Security Groups and click “Manage Rules” button of “default” policy

Click “Add Rule” button and perform following action

Creating Key Pairs

Go to Compute -> Access & Security -> Security Groups and click “Key Pairs” link

Click the “Create Key Pair” button and perform following actions.

The private key file shall be downloaded on to your machine. The key files are injected into the newly built instances during installation and one can only login into instances using the SSH key file.

Creating an Image In order to create an instance i.e. VM of CentOS or any other Operating system you need to download its image first. There are different pre-built images of different OSs shared at following link.

https://www.rdoproject.org/Image_resources

I had chosen to install Fedora22 image for this guide.

Perform following steps:

Click on Compute -> Images and press the “Create Image” button

The OpenStack shall download images from Fedora website and save into the local repository. You can see the progress on dashboard while image is saving.

Once image creation is complete, the dashboard looks like following

Creating an instance of Fedora22 (VM) Click on Compute -> Images and press the “Launch Instance” button in last column of “Fedora22” and provide settings as shown below:

The instances creation shall begin. During installation you can also assign a “Allocate Floating IP” that shall bind a public ip to the VM hence it shall be accessible from outside OpenStack network without any network/router settings.

Once completed, VM shall start running

Click on the Instance name to view more details of the instance including the “console”

Connecting to instance via SSH The keypair downloaded to client machine shall be required to connect with instance. I had added a “Floating IP Address” to VM during creation and shall login through it. You can also add a “Floating IP Address” during the Image creation process.

Credits http://docs.openstack.org/developer/devstack/ https://www.rdoproject.org