Openstack installation in 20 mins

December 31st, 2015

OpenStack – An Overview

OpenStack is an integrated system of components which allow you to manage a cloud.

  • Open source and free.
  • Basic system can install on a single Linux machine.
  • Initial components were developed by NASA and RackSpace in 2010.
  • Released on a 6 month schedule with alphabetically named releases.
  • Current release is Liberty (October 2015) and next release in Apr’2016.
  • There are many companies supporting,using and writing openstack: Oracle,Intel,IBM,Cisco ..etc

Where do I get Openstack ?

You can get download the latest version of Openstack here at www.openstack.org
Go to https://www.openstack.org/software/start/ it should automatically start downloading if not just refresh or press download button.

Canonical publishes an Ubuntu distribution with OpenStack installed:

Redhat RDO script.
Mirantis installer.

Using RDO script (packstack installer):

Red Hat Enterprise Linux (RHEL) 7 is the minimum recommended version, or any RHEL-based Linux distributions such as CentOS, Scientific Linux, etc., or Fedora 21. x86_64 is currently the only supported architecture.

In case your system is running with NetworkManager, just disable it and Stop and disable NetworkManager:

Use the following codes:
 "systemctl stop NetworkManager
 systemctl disable NetworkManager
 systemctl enable network"

Make sure devices are named properly for the network daemon:

 i.e. the following line must be present in /etc/sysconfig/network-scripts/ifcfg-<interface_name>
 DEVICE="<interface_name>"
vi /etc/sysconfig/network-scripts/ifcfg-<IFNAME>  (assign mgt_ip/subnet/gateway details)
echo "proxy=http://IP:port" >> /etc/yum.conf -> your http proxy details, skip this if you have internet connection.

install ssh client:

"yum install -y openssh-server" (ssh from putty client)
restart network interfaces:
"service network restart"

Now three steps to bring openstack (all-in-one case):

"sudo yum update -y
 sudo yum install -y https://rdoproject.org/repos/rdo-release.rpm
 sudo yum install -y openstack-packstack"
The last command generates packstack-answers file, edit this to include your management IP details.
"CONFIG_CONTROLLER_HOST=<MGMNT_IP>
 CONFIG_COMPUTE_HOSTS=<MGMNT_IP>
 CONFIG_NETWORK_HOSTS=<MGMNT_IP>
 CONFIG_STORAGE_HOST=<MGMNT_IP>
 CONFIG_AMQP_HOST=<MGMNT_IP>
 CONFIG_MARIADB_HOST=<MGMNT_IP>
 CONFIG_MONGODB_HOST=<MGMNT_IP>
 CONFIG_NOVA_COMPUTE_PRIVIF=<NEXT_MGMNT_IFNAME, ex: "ens33">
 CONFIG_NOVA_NETWORK_PUBIF=<MGMNT_IFNAME, ex: "ens32">
 CONFIG_NOVA_NETWORK_PRIVIF=<NEXT_MGMNT_IFNAME, ex: "ens33">"
 then execute packstack with this answer file:

“packstack –answer-file=packstack-answers-…txt”  (or packstack –allinone)

reboot the machine using ‘reboot’ command since it updates kernel and other required system files.

Openstack installed and ready

Access dashboard/horizon using:”http://MGMNT_IP/dashboard” (get credentials from keystonerc_admin present in /root and change password under identity->Users), update same in this file

Network configuration (critical part):

vi /etc/sysconfig/network-scripts/ifcfg-br-ex (create if not exist) and add below lines:

"DEVICE=br-ex
 DEVICETYPE=ovs
 TYPE=OVSBridge
 BOOTPROTO=static
 IPADDR=MGMNT_IP
 NETMASK=NETMASK
 GATEWAY=GATEWAY
 ONBOOT=yes

vi /etc/sysconfig/network-scripts/ifcfg-<MGMNT_IF> and add below content (over write existing content):

"DEVICE=<DEVICE_NAME>
 TYPE=OVSPort
 DEVICETYPE=ovs
 OVS_BRIDGE=br-ex
 ONBOOT=yes

restart network interfaces:
service network restart

source keystonerc_admin

openstack-config –set /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini ovs bridge_mappings extnet:br-ex
service network restart
service neutron-openvswitch-agent restart
service neutron-server restart

copy qcow2 image for your testing (download Cirros from net) to /var/lib/glance/images/

source /root/keystonerc_admin
glance image-create –name “Mydebian” –is-public true –disk-format qcow2 –container-format bare –file debian.qcow2 (create qcow2 image to launch instance in openstack)
neutron net-create public_network –provider:network_type vxlan  –router:external –shared
neutron subnet-create –name public_subnet –enable_dhcp=False –allocation-pool=start=10.54.106.84,end=10.54.106.90 –gateway=10.54.106.1 public_network 10.54.106.0/24
neutron net-create private_network
neutron subnet-create –name private_subnet private_network 10.15.15.0/24
neutron router-create router1
neutron router-gateway-set router1 public_network
neutron router-interface-add router1 private_subnet

login to dashboard, goto compute->access&security, select default->manage rules->add rule. add ssh,icmp rules to access instance from outside the tenant network.

in dashboard, goto project->Images, select your image, click launch button to launch instance with flavor and other details. in instance tab, select your instance and mapping floating IPs.

PS: 10.54.106.x is the public IP, change according to your network addresses.


Follow Us

facebook twitter linkedin google plus youtube Glassdoor

Category

Recent Tweets & Comments

Tweets by @AltenCalsoftLabs