OpenStack – Linux Hint https://linuxhint.com Exploring and Master Linux Ecosystem Fri, 29 Jan 2021 03:55:32 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.2 Configure OpenStack Network Service- Step By Step Guide https://linuxhint.com/configure-openstack-network-service/ Tue, 26 Jan 2021 04:05:35 +0000 https://linuxhint.com/?p=87645 OpenStack is an open-source cloud platform that provides infrastructure-as-a-service (IaaS) for private, public, and hybrid cloud computing. OpenStack Foundation manages and develops the OpenStack project. The OpenStack provides a wide range of services for processing, storage, and networking inside a data center.

OpenStack has full capability to deploy virtual machines (VMs) and handle various tasks required for managing a cloud environment. With its horizontal scaling feature, it can spin up more as per requirement.

One of the important features of OpenStack is that it an open-source software. Microstack is a tool for installing the OpenStack environment in a very easy way. If you have previously gone through the custom steps of installing OpenStack, you might see the real pain of customizing and configuring various installation steps. But with Microstack, it is simply 2-3 steps of the process. In this guide, we have used the Microstack based variant of OpenStack. You can use any other way to install OpenStack, but with Microstack, things got very simple.

Let us review some of the major components of OpenStack here:

  1. Nova: Manages various aspects of compute instances on demand. It is the compute engine of OpenStack for managing and deploying VMs.
  2. Neutron: Provides OpenStack networking services. It helps in establishing a communication path between various OpenStack instances.
  3. Swift: Provide storage services for files and objects inside an OpenStack environment.
  4. Horizon: It is a web-based graphical dashboard interface of OpenStack for managing OpenStack’s different operations.
  5. Keystone: It is an identity service for authentication, access control, authorization, and various other services.
  6. Glance: It is an image service of OpenStack for managing virtual machine images. These images can be used as a template for launching new VMs.
  7. Heat: It is basically an orchestration tool of OpenStack for launching multiple composite cloud applications using an orchestration template like HOT (Heat Orchestration Template).

The installation process of OpenStack is very resource and time-consuming. Before we get our hands dirty in configuring the OpenStack service, we assume that you have already installed OpenStack on your system or inside a VM. If not, you can follow our previous guide for installation. In this guide, we have installed the OpenStack using the Microstack from the snap repository.

Configuration of Our Machine:

Operating System: Ubuntu 20.04
RAM: 16 GB
Hard Disk: 160 GB
OpenStack Variant: Microstack.

In this tutorial, we will see how we can configure networking services in OpenStack. To simplify things, we have provided snapshots of various stages of configuration. So let’s jump right into it.

Step 1. Log in to the OpenStack dashboard with the admin account. Once you are logged in, you need to create a new project. Follow the below path:

Identity -> Projects -> Create Project

Step 2. Now, as our project has been created with the name “MyProject1”, we will now have to go to the path:

Identity -> Users -> Create User

And create a new user.

Here we have to give our user a name (“LHuser” in our case) and an optional description for this user. Create a password for this user.
In the primary project menu, select our project (MyProject1). Now finish this step by clicking the “Create User” button.

Step 3. Now we will configure the OpenStack network. First, log out from the admin account and login with the newly created user LHuser. Now navigate to the path:

Project -> Networks → Create Network

I) Internal Network

a) First, we will create an internal network. Our Specification for the internal network is as follows:

Network Name: my_internal_nw
Subnet Name: my_subnet
Network Address: 192.168.2.0/24
Gateway IP: 192.168.2.10
IP Version: IPv4

Also, remember to check the “Enable Admin State.”

b) subnet

c) subnet details

II) External Network
The steps for creating the external network are the same as that of the internal network. The only difference is that the network configuration here depends on the br-ex interface created with OpenStack installation. So use the same network address and gateway IP as that of the br-ex interface. In our case, the specifications are as follow:

Network Name: my_external_nw
Subnet Name: my_subnet_2
Network Address: 10.20.20.0/24
Gateway IP: 10.20.20.1
IP Version: IPv4
Also, check the “Enable Admin State.”

2) Subnet

3. Subnet details

Step 4. After finishing the process of creating networks, log out of the new user account and again login with an admin account. On the OpenStack, dashboard goes to:

1. Admin -> System-> Networks

And select the network named “my_external_nw” and click the “edit network” in the right corresponding to this network.

2. A new window will prompt up. Here simply mark this network as an External network. Click the “Save Changes.” button to apply settings.

Step 5. Now, logout from the admin user and log in with the new user.
Step 6. We will have to create a router for the two networks to create a communication path between these two. Go to

Project -> Network -> Routers

And click the “create router” button.

Step 7. It will ask about router details. Fill them in and select “my_external_nw” as the External Network and click the “create router” button.

Step 8. After the above step, select the router from the router name column, go to the Interfaces tab and click on the “Add Interface” button.

Step 9. A new prompt window will appear. In the subnet dropbox, select the internal subnet “my_subnet.” In the IP Address field, do not fill anything. Now click Submit button to complete this step.

Step 10. Now, as all the steps are finished for configuring the network, we will verify OpenStack network settings. Follow the path:

Project -> Network -> Network Topology

A network map as shown below should appear:

That’s all, Folks. We have successfully configured a basic network configuration on OpenStack. Try to add some flavor to this configuration by adding more networks and creating a communication path between multiple VMs inside OpenStack.

]]>
Install OpenStack on VirtualBox https://linuxhint.com/install_openstack_virtualbox/ Sat, 04 May 2019 07:06:40 +0000 https://linuxhint.com/?p=39623 In this article, I am going to show you how to install OpenStack in a VirtualBox virtual machine for learning OpenStack on your own computer. I am going to install CentOS 7 on a VirtualBox virtual machine and install OpenStack on there. So, let’s get started.

Downloading CentOS 7 ISO Image:

First, you have to download the CentOS 7 ISO installation image from the official website of CentOS 7.

To do that, visit https://www.centos.org/download/ and click on Minimal ISO as marked in the screenshot below.

Now, click on any of the link.

Your browser should prompt you to save the file. Select Save File and click on OK.

CentOS 7 ISO installation media is being downloaded.

Creating a Virtual Machine:

Once the CentOS 7 ISO installation image is downloaded, open VirtualBox and click on Machine > New… as marked in the screenshot below.

Now, type in a name for the VM. Then, select Linux and Red Hat (64-bit) as the Type and Version respectively. Then, click on Next.

You need at least 16 GB of RAM in order to run OpenStack. So, make sure you assign 16 GB (16384 MB) of RAM to your VM. Once you’ve set the memory size, click on Next.

Now, click on Create.

Now, click on Next >.

Now, click on Next >.

Now, set 100 GB as the hard disk size and click on Create.

OpenStack VM should be created. Now, select the OpenStack VM and click on Settings.

Now, select USB Tablet as the Pointing Device from System > Motherboard as marked in the screenshot below.

Now, check Enable Nested VT-x/AMD-v from System > Processor as marked in the screenshot below.

Now, from the Network section, change Attached to to Bridged Adapter, Adapter Type to Paravirtualized Network (virtio-net) and Promiscuous Mode to Allow All.

Now, you have to set the CentOS 7 ISO installation image as the Optical drive. To do that, follow the procedures as marked in the screenshot below.

Now, select the CentOS 7 ISO installation image and click on Open.

Now, click on OK.

The VM is now ready to install CentOS 7.

Installing CentOS 7 on the Virtual Machine:

Now, select the OpenStack VM and click on Start.

The VM should boot from the ISO installation image. Now, select Install CentOS 7 and press <Enter>.

The CentOS 7 GUI installer should start. Now, install CentOS 7 as usual. Make sure to set a root password during installation.

Once CentOS 7 is installed, you should be able to log in as the user root using the password that you’ve set during installation.

Configuring Network:

Now, disable firewalld service with the following command:

# systemctl disable firewalld

Now, stop the firewalld service with the following command:

# systemctl stop firewalld

Now, disable NetworkManager service with the following command:

# systemctl disable NetworkManager

Now, stop NetworkManager service with the following command:

# systemctl stop NetworkManager

Now, enable network service with the following command:

# systemctl enable network

Now, start network service with the following command:

# systemctl start network

Now, check the name of your network interface as follows:

$ ip a

The name of the network interface of my CentOS 7 VM is eth0.

Now, run the following command to configure the network interface eth0 to automatically get IP address via DHCP:

# echo -e 'DEVICE=eth0\nBOOTPROTO=dhcp\n' > /etc/sysconfig/network-scripts/ifcfg-eth0

Now, reboot your CentOS 7 VM as follows:

$ sudo reboot

Once it boots, the network interface eth0 should have an IP address.

Installing OpenStack:

Before you do anything, make sure to set the LANG and LC_ALL environment variables correctly with the following command:

# echo -e "LANG=en_US.utf-8\nLC_ALL=en_US.utf-8\n" > /etc/environment

Now, to make sure all the CentOS 7 packages are up to date, run the following command:

# yum update -y

CentOS packages are being updated.

All the CentOS 7 packages should be updated.

Now, add the OpenStack Rocky package repository with the following command:

# yum install -y centos-release-openstack-rocky

The OpenStack Rocky package repository should be added.

Now, update the CentOS 7 system packages again with the following command:

# yum update -y

All the system packages should be updated.

Now, install PackStack with the following command:

# yum install -y openstack-packstack

PackStack is being installed. It may take a while to complete.

PackStack should be installed.

Now, install all the components of OpenStack on CentOS 7 with the following command:

# packstack --allinone

OpenStack is being installed.

PackStack is configuring required components with Puppet. It will take a long time to complete.

OpenStack is installed.

Testing OpenStack:

You need the IP address of your CentOS 7 machine in order to access OpenStack Horizon dashboard.

To find the IP address of CentOS 7, run the following command:

# ip a

As you can see, the IP address of my CentOS 7 machine is 192.168.21.200. It will be different for you. So, make sure to replace it with yours from now on.

Now, to find the OpenStack Horizon dashboard password, run the following command:

# cat keystonerc_admin | grep PASSWORD

As you can see, df29616110934166 is the password for my OpenStack Horizon dashboard.

Now, from your favorite web browser, visit http://192.168.21.200 and you should see the OpenStack login page. Type in the username admin and the password df29616110934166 (password should be different for you. So, replace it with yours.). Then, click on Sign In.


a
You should be logged in to OpenStack Horizon dashboard. Now, you can configure OpenStack any way you like from here.

So, that’s how you install OpenStack on VirtualBox. Thanks for reading this article.

]]>
Installing OpenStack on CentOS https://linuxhint.com/install_openstack_centos/ Mon, 02 Jul 2018 04:39:25 +0000 https://linuxhint-com.zk153f8d-liquidwebsites.com/?p=27760 OpenStack is a full-fledged cloud management software released by RedHat Inc. It is a wildy complicated project with many satellite projects like Neutron, Glusterfs, Ceph and many more. The reason behind it is that OpenStack is supposed to manage and run your entire cloud set up!

Everything, from telling the hypervisor how much resource to allocate, to managing networking interfaces and virtual adapters, to making block storage and distributed storage available. All of the functionalities are split into modular projects so cloud architects and mix and match the technologies that they need.

People who want to have a quick look at the WebUI, maybe run a few services, or contribute to the OpenStack project may not have an entire rack full of servers at their disposal just to experiment with OpenStack. We will show a way to set up an experimental OpenStack installation. It will be deployed on a single CentOS virtual machine using PackStack which automates the OpenStack installation, making it greatly accessible to individual developers and enthusiasts.

Prerequisites

If you have a beefy computer with well-over 16GB of memory and an Octa core processor you can create a CentOS VM locally with at least 16GB of memory and 4 CPUs allocated to it. Otherwise, you can use services like SSDNodes or DigitalOcean to spin up a virtual machine over cloud and use it to follow along. Cloud servers are usually billed on an hourly rate so you can spin a VM up, experiment for a couple of hours and once you are done with it, you can destroy the VM and the price would hardly touch the $2 ceiling.

To sum up, you need:

  1. A clean installation of CentOS on a VM with 16GB of memory and 2 or more processors.
  2. A network adapter with one static IP address (again usually offered by cloud service providers).
  3. Root privileges over the VM.

WARNING: Don’t try to install OpenStack on your everyday use machines. It makes a wide array of modifications which might break your set up, if you are not careful.

Installing PackStack

PackStack project’s main purpose is to test OpenStack on CentOS and/or RHEL and package it in a neat and easy to install way. It is a community-driven effort sponsored by RedHat Inc. You can read more about the project here.

To begin with, let’s log in with root privileges and verify that the packages are all up to date.

$ sudo yum check-updates
$ sudo yum -y update

Now we can move on to cloning the PackStack repo and installing related packages. First install OpenStack to the Extras repository which is enabled by default on CentOS.

$ sudo yum install -y centos-release-openstack-queens

This installs the queens release. Next we enable the openstack-queens repository.

$ sudo yum-config-manager enable openstack-queens

And update one last time.

$ sudo yum update

Now we can install PackStack installer from the newly added repo, which would later install OpenStack for us.

$ sudo yum install -y openstack-packstack

We are now going to run packstack on this single node, the flag –allinone will be used as shown below, to indicate that it is installed on one node, unlike a typical OpenStack installation which may span entire an data center.

$ sudo packstack --allinone

That’s it! We have a working OpenStack installation automatically configured for us by PackStack.

Note: You may have to wait a while at certain steps like:

Testing if puppet apply is finished: 178.128.194.220_controller.pp …

Which is why we strongly recommend a VPS with 16GB or memory and more that 4 cores at least.

Using OpenStack

To use OpenStack, we can login at our server’s IP as http://ip.address/dashboard as the user admin whose password can be found stored inside /root/keystonerc_admin. If you are using a public cloud server, make sure that your VPS has a public IP so you can access it via browser. If you are using a local virtual machine, we recommend using bridged adapter to get a private IP address that your browser can access.

Once you open the web page, enter the credentials as we described above:

Once that is done, you will be greeted with a dashboard:

In the Identity menu you can create new users and in the Project section you can create new projects and allocate resources like Compute and Storage to that resource. However, there is already a demo user and demo project for us to use. So let’s logout from the admin dashboard and log back in as demo. This user’s login credentials can be found in /root/keystonerc_demo file.

The OS_PASSWORD line shows the password and the OS_USERNAME line shows the user name (demo).Here, you can see the resources your (the demo user’s) projects are taking up.

Let’s create a virtual machine in the current demo project using a pre-existing CirrOS image. For those who don’t know, CirrOS is a really light-weight Linux distribution which is ideal for our experimental use cases.

As the demo user, Go to Compute → Instances from the left hand menu. Then select Launch Instance from the right.

Give it a reasonable name, select the region (Since OpenStack is managing a single node, there’s only one region) and select how many VMs you want to create simultaneously.

Similarly, go to the Source section from the left menu and select CirrOS as your default image with 1GB volume.

And finally for Flavor, select the memory and CPU allocation. Be careful of your VM’s resource constraints in all these steps!

Now, we can Launch Instance. Since it is hiding inside a private network, you can’t directly SSH into it, but you can attach a virtual console to it. In the Actions column select Console from the drop down menu.

The default user name is: cirros and the password is cubswin and indicated in the Log menu of the DemoInstance.

Congratulations! You just launched your first VPS on a cloud that you created using OpenStack. There are several other features including Volumes, Networking and Object Storage. Feel free to explore these once you are familiar with the environment.

]]>