OpenStack

How to Install Your Own Cloud Platform with OpenStack in RHEL/CentOS 7

How to Install Your Own Cloud Platform with OpenStack in RHEL/CentOS 7 &-8211; this Article or News was published on this date:2019-05-28 17:34:59 kindly share it with friends if you find it helpful

OpenStack is a free and open-source software platform which provides IAAS (infrastructure-as-a-service) for public and private clouds.

OpenStack platform consists of several inter-related projects that control hardware, storage, networking resources of a datacenter, such as: Compute, Image Service, Block Storage, Identity Service, Networking, Object Storage, Telemetry, Orchestration and Database.

The administration of those components can be managed through the web-based interface or with the help of OpenStack command line.

Install OpenStack in CentOS 7Install OpenStack in CentOS 7

Install OpenStack in CentOS 7 and RHEL 7

This tutorial will guide you on how you can deploy your own private cloud infrastructure with OpenStack installed on a single node in CentOS 7 or RHEL 7 or Fedora distributions by using rdo repositories, although the deployment can be achieved on multiple nodes.

Requirements

  1. Minimal Installation of CentOS 7
  2. Minimal Installation of RHEL 7

Step 1: Initial System Configurations

1. Before you begin preparing the node in order to deploy your own virtual cloud infrastructure, first login with root account and assure that the system is up to date.

2. Next, issue the ss -tulpn command to list all running services.

- ss -tulpn
Install OpenStack in CentOS 7List All Running Linux Services

List All Running Linux Services

3. Next, identify, stop, disable and remove unneeded services, mainly postfix, NetworkManager and firewalld. At the end the only daemon that would be running on your machine should be sshd.

- systemctl stop postfix firewalld NetworkManager
- systemctl disable postfix firewalld NetworkManager
- systemctl mask NetworkManager
- yum remove postfix NetworkManager NetworkManager-libnm

4. Completely disable Selinux policy on the machine by issuing the below commands. Also edit /etc/selinux/config file and set SELINUX line from enforcing to disabled as illustrated on the below screenshot.

- setenforce 0
- getenforce
- vi /etc/selinux/config
Install OpenStack in CentOS 7Disable SELinux

Disable SELinux

5. On the next step using the hostnamectl command to set your Linux system hostname. Replace the FQDN variable accordingly.

- hostnamectl set-hostname cloud.centos.lan
Install OpenStack in CentOS 7Set Linux System Hostname

Set Linux System Hostname

6. Finally, install ntpdate command in order to synchronize time with a NTP server on your premises near your physical proximity.

- yum install ntpdate 

Step 2: Install OpenStack in CentOS and RHEL

7. OpenStack will be deployed on your Node with the help of PackStack package provided by rdo repository (RPM Distribution of OpenStack).

In order to enable rdo repositories on RHEL 7 run the below command.

- yum install https://www.rdoproject.org/repos/rdo-release.rpm 

On CentOS 7, the Extras repository includes the RPM that actives the OpenStack repository. Extras is already enabled, so you can easily install the RPM to setup the OpenStack repository:

- yum install -y centos-release-openstack-mitaka
- yum update -y

8. Now it’s time to install PackStack package. Packstack represents a utility which facilitates the deployment on multiple nodes for different components of OpenStack via SSH connections and Puppet modules.

Install Packstat package in Linux with the following command:

- yum install  openstack-packstack

9. On the next step generate an answer file for Packstack with the default configurations which will be later edited with the required parameters in order to deploy a standalone installation of Openstack (single node).

The file will be named after the current day timestamp when generated (day, month and year).

- packstack --gen-answer-file='date +"%d.%m.%y"'.conf
- ls
Install OpenStack in CentOS 7Generate Packstack Answer Configuration File

Generate Packstack Answer Configuration File

10. Now edit the generated answer configuration file with a text editor.

- vi 13.04.16.conf

and replace the following parameters to match the below values. In order to be safe replace the passwords fields accordingly.

CONFIG_NTP_SERVERS=0.ro.pool.ntp.org

Please consult http://www.pool.ntp.org/en/ server list in order to use a public NTP server near your physical location.

Install OpenStack in CentOS 7Add NTP Server in Packstack

Add NTP Server in Packstack

CONFIG_PROVISION_DEMO=n
Install OpenStack in CentOS 7Add Provision in Packstack

Add Provision in Packstack

CONFIG_KEYSTONE_ADMIN_PW=your_password  for Admin user
Install OpenStack in CentOS 7Add Admin Account in Packstack

Add Admin Account in Packstack

Access OpenStack dashboard via HTTP with SSL enabled.

CONFIG_HORIZON_SSL=y
Install OpenStack in CentOS 7Enable HTTPS for OpenStack

Enable HTTPS for OpenStack

The root password for MySQL server.

CONFIG_MARIADB_PW=mypassword1234
Install OpenStack in CentOS 7Set MySQL Root Password in OpenStack

Set MySQL Root Password in OpenStack

Setup a password for nagiosadmin user in order to access Nagios web panel.

CONFIG_NAGIOS_PW=nagios1234
Install OpenStack in CentOS 7Set Nagios Admin Password

Set Nagios Admin Password

11. After you finished editing save and close the file. Also, open SSH server configuration file and uncomment PermitRootLogin line by removing the front hashtag as illustrated on the below screenshot.

- vi /etc/ssh/sshd_config
Install OpenStack in CentOS 7Enable SSH Root Login

Enable SSH Root Login

Then restart SSH service to reflect changes.

- systemctl restart sshd

Step 3: Start Openstack Installation Using Packstack Answer File

12. Finally start Openstack installation process via the answer file edited above by running the below command syntax:

- packstack --answer-file 13.04.16.conf
Install OpenStack in CentOS 7Openstack Installation in CentOS

Openstack Installation in Linux

13. Once the installation of OpenStack components is successfully completed, the installer will display a few lines with the local dashboard links for OpenStack and Nagios and the required credentials already configured above in order to login on both panels.

Install OpenStack in CentOS 7OpenStack Installation Completed

OpenStack Installation Completed

The credentials are also stored under your home directory in keystonerc_admin file.

14. If for some reasons the installation process ends with an error regarding httpd service, open /etc/httpd/conf.d/ssl.conf file and make sure you comment the following line as illustrated below.

-Listen 443 https
Install OpenStack in CentOS 7Disable HTTPS SSL Port

Disable HTTPS SSL Port

Then restart Apache daemon to apply changes.

- systemctl restart httpd.service

Note: In case you still can’t browse Openstack web panel on port 443 restart the installation process from beginning with the same command issued for the initial deployment.

- packstack --answer-file /root/13.04.16.conf

Step 4: Remotely Access OpenStack Dashboard

15. In order to access OpenStack web panel from a remote host in your LAN navigate to your machine IP Address or FQDN/dashboard via HTTPS protocol.

Due to the fact that you’re using a Self-Signed Certificate issued by an untrusted Certificate Authority an error should be displayed on your browser.

Accept the error and login to the dashboard with the user admin and the password set on CONFIG_KEYSTONE_ADMIN_PW parameter from answer file set above.

https://192.168.1.40/dashboard 
Install OpenStack in CentOS 7OpenStack Login Dashboard

OpenStack Login Dashboard

Install OpenStack in CentOS 7Openstack Projects

Openstack Projects

16. Alternatively, if you opted to install Nagios component for OpenStack, you can browse Nagios web panel at the following URI and login with the credentials setup in answer file.

https://192.168.1.40/nagios 
Install OpenStack in CentOS 7Nagios Login Dashboard

Nagios Login Dashboard

Install OpenStack in CentOS 7Nagios Linux Monitoring Interface

Nagios Linux Monitoring Interface

That’s all! Now you can start setup your own internal cloud environment. Now follow the next tutorial that will explain how to link the server physical NIC to openstack bridge interface and manage Openstack from web panel.

How to Configure OpenStack Network to Enable Access to OpenStack Instances

How to Configure OpenStack Network to Enable Access to OpenStack Instances &-8211; this Article or News was published on this date:2019-05-28 17:32:57 kindly share it with friends if you find it helpful

This tutorial will guide you on how you can configure OpenStack networking service in order to allow access from external networks to OpenStack instances.

Requirements

  1. Install OpenStack in RHEL and CentOS 7

Step 1: Modify Network Interface Configuration Files

1. Before starting to create OpenStack networks from dashboard, first we need to create an OVS bridge and modify our physical network interface to bind as a port to OVS bridge.

Thus, login to your server terminal, navigate to network interfaces directory scripts and use the physical interface as an excerpt to setup OVS bridge interface by issuing the following commands:

- cd /etc/sysconfig/network-scripts/
- ls  
- cp ifcfg-eno16777736 ifcfg-br-ex
Setup OVS Bridge Interface in OpenStackSetup OVS Bridge Interface in OpenStack

Setup OVS Bridge Interface in OpenStack

2. Next, edit and modify the bridge interface (br-ex) using a text editor as illustrated below:

- vi ifcfg-br-ex

Interface br-ex excerpt:

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
IPV6_AUTOCONF="no"
IPV6_DEFROUTE="no"
IPV6_FAILURE_FATAL="no"
NAME="br-ex"
UUID="1d239840-7e15-43d5-a7d8-d1af2740f6ef"
DEVICE="br-ex"
ONBOOT="yes"
IPADDR="192.168.1.41"
PREFIX="24"
GATEWAY="192.168.1.1"
DNS1="127.0.0.1"
DNS2="192.168.1.1"
DNS3="8.8.8.8"
IPV6_PEERDNS="no"
IPV6_PEERROUTES="no"
IPV6_PRIVACY="no"
Setup OVS Bridge Interface in OpenStackConfigure Bridge Network Interface for OpenStack

Configure Bridge Network Interface for OpenStack

3. Do the same with the physical interface (eno16777736), but make sure it looks like this:

- vi ifcfg-eno16777736

Interface eno16777736 excerpt:

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
IPV6_AUTOCONF="no"
IPV6_DEFROUTE="no"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
DEVICE="eno16777736"
ONBOOT="yes"
TYPE=”OVSPort”
DEVICETYPE=”ovs”
OVS_BRIDGE=”br-ex”
Setup OVS Bridge Interface in OpenStackConfigure Physical Network Interface for OpenStack

Configure Physical Network Interface for OpenStack

Important: While editing interfaces cards make sure you replace the physical interface name, IPs and DNS servers accordingly.

4. Finally, after you’ve modified edited both network interfaces, restart network daemon to reflect changes and verify the new configurations using ip command.

- systemctl restart network.service
- ip a
Setup OVS Bridge Interface in OpenStackVerify Network Configuration

Verify Network Configuration

Step 2: Create a New OpenStack Project (Tenant)

5. On this step we need to use Openstack dashboard in order to further configure our cloud environment.

Login to Openstack web panel (dashboard) with admin credentials and go to Identity -> Projects -> Create Project and create a new project as illustrated below.

Setup OVS Bridge Interface in OpenStackCreate New OpenStack Project

Create New OpenStack Project

Setup OVS Bridge Interface in OpenStackAdd OpenStack New Project Details

Add OpenStack New Project Details

6. Next, navigate to Identity -> Users -> Create User and create a new user by filling all the fields with the required information.

Assure that this new user has the Role assigned as a _member_ of the newly created tenant (project).

Setup OVS Bridge Interface in OpenStackCreate New User in OpenStack Project

Create New User in OpenStack Project

Step 3: Configure OpenStack Network

7. After the user has been created, log out admin from dashboard and log in with the new user in order to create two networks (internal network and external).

Navigate to Project -> Networks -> Create Network and setup the internal network as follows:

Network Name: internal
Admin State: UP
Create Subnet: checked

Subnet Name: internal-sfnews
Network Address: 192.168.254.0/24
IP Version: IPv4
Gateway IP: 192.168.254.1

DHCP: Enable

Use the below screenshots as a guide. Also, replace the Network Name, Subnet Name and IP addresses with your own custom settings.

Setup OVS Bridge Interface in OpenStackLogin as User to OpenStack Dashboard

Login as User to OpenStack Dashboard

Setup OVS Bridge Interface in OpenStackCreate Network for OpenStack

Create Network for OpenStack

Setup OVS Bridge Interface in OpenStackCreate Network Subnet for OpenStack

Create Network Subnet for OpenStack

Setup OVS Bridge Interface in OpenStackEnable DHCP for OpenStack

Enable DHCP for OpenStack

8. Next, use the same steps as above to create the external network. Make sure the IP address space for external network is in the same network range as your uplink bridge interface IP address range in order to work properly without extra routes.

Therefore, if the br-ex interface has 192.168.1.1 as a default gateway for 192.168.1.0/24 network, the same network and gateway IPs should be configured for external network too.

Network Name: external
Admin State: UP
Create Subnet: checked

Subnet Name: external-sfnews
Network Address: 192.168.1.0/24
IP Version: IPv4
Gateway IP: 192.168.1.1

DHCP: Enable
Setup OVS Bridge Interface in OpenStackCreate External Network for OpenStack

Create External Network for OpenStack

Setup OVS Bridge Interface in OpenStackCreate Subnet for External Network

Create Subnet for External Network

Setup OVS Bridge Interface in OpenStackEnable DHCP for External Network

Enable DHCP for External Network

Again, replace the Network Name, Subnet Name and IP addresses according to your own custom configurations.

9. On the next step we need to log in OpenStack dashboard as admin and mark the external network as External in order to be able to communicate with the bridge interface.

Thus, login with admin credentials and move to Admin -> System-> Networks, click on the external network, check the External Network box and hit on Save Changes to apply the configuration.

Setup OVS Bridge Interface in OpenStackLogin as Admin in OpenStack Dashboard

Login as Admin in OpenStack Dashboard

Setup OVS Bridge Interface in OpenStackSelect External Network

Select External Network

Setup OVS Bridge Interface in OpenStackMake Network as External Network

Make Network as External Network

Setup OVS Bridge Interface in OpenStackExternal Network Settings Updated

External Network Settings Updated

When done, logout from admin user and log in with the custom user again to proceed to the next step.

10. Finally, we need to create a router for our two networks in order to move packets back and forth. Go to Project -> Network -> Routers and hit on Create Router button. Add the following settings for the router.

Router Name: a descriptive router name
Admin State: UP
External Network: external 
Setup OVS Bridge Interface in OpenStackCreate Network Router in OpenStack

Create Network Router in OpenStack

11. Once the Router has been created you should be able to see it in the dashboard. Click on the router name, go to Interfaces tab and hit on Add Interface button and a new prompt should appear.

Select the internal subnet, leave the IP Address field blank and hit on Submit button to apply changes and after a few seconds your interface should become Active.

Setup OVS Bridge Interface in OpenStackAdd New Network Interface in OpenStack

Add New Network Interface in OpenStack

Setup OVS Bridge Interface in OpenStackConfigure Network Interface

Configure Network Interface

12. In order to verify OpenStack network settings, go to Project -> Network -> Network Topology and a network map will be presented as illustrated on the below screenshot.

Setup OVS Bridge Interface in OpenStackVerify OpenStack Network Topology

Verify OpenStack Network Topology

That’s all! Your OpenStack network is now functional and ready for virtual machines traffic. On the next topic we’ll discuss how to create and launch an OpenStack image instance.