RSS

Category Archives: OpenStack

Allocate Floating IP to OpenStack

Floating IP allows external access from outside networks or internet to an Openstack virtual machine. In order to create floating IPs for your project, login with your user credentials and go to Project -> Compute -> Access & Security -> Floating IPs tab and click on Allocate IP to The Project.

 

2122

 
Leave a comment

Posted by on July 10, 2018 in Linux, OpenStack

 

How to Configure OpenStack Network to Enable Access to OpenStack Instances

How to Configure OpenStack Network to Enable Access to OpenStack Instances

1. 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.

[root@cloud /]# cd /etc/sysconfig/network-scripts/
[root@cloud network-scripts]# ls
1 ifdown-ovs ifup-eth ifup-sit
ifcfg-br-ex ifdown-post ifup-ib ifup-Team
ifcfg-eth0 ifdown-ppp ifup-ippp ifup-TeamPort
ifcfg-lo ifdown-routes ifup-ipv6 ifup-tunnel
ifdown ifdown-sit ifup-isdn ifup-wireless
ifdown-bnep ifdown-Team ifup-ovs init.ipv6-global
ifdown-eth ifdown-TeamPort ifup-plip network-functions
ifdown-ib ifdown-tunnel ifup-plusb network-functions-ipv6
ifdown-ippp ifup ifup-post
ifdown-ipv6 ifup-aliases ifup-ppp
ifdown-isdn ifup-bnep ifup-routes

[root@cloud network-scripts]# cp ifcfg-eth0 ifcfg-br-ex

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

[root@cloud network-scripts]# vi ifcfg-br-ex
HWADDR=00:0C:29:A4:F9:49
TYPE=Ethernet
BOOTPROTO=static
IPADDR=10.100.100.123
PREFIX=24
GATEWAY=10.100.100.1
DNS1=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_PRIVACY=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=”br-ex”
UUID=4c45f763-8c4c-38d1-af88-b7e6283c652f
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999

save and exit

3. We need to do same with physical interface and make sure like as follow:

[root@cloud network-scripts]# vi ifcfg-eth0

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
IPV6_FAILURE_FATAL=no
IPV6_PRIVACY=no
ONBOOT=yes
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-ex

save and exit

4. Restart network

[root@cloud network-scripts]# systemctl restart network.serivce

5. Then we need to do like as follow:

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

1

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

2

3

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

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).

4

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

5

For example:

Network Name: internal
Admin State: UP
Create Subnet: checked
Subnet Name: internal
Network Address: 192.168.1.0/24
IP Version: IPv4
Gateway IP: 192.168.1.1
DHCP: Enable

Also, replace the Network Name, Subnet Name and IP addresses with your own custom settings.

67

Use the same steps as above to create the external network

8910

For example:

Network Name: external
Admin State: UP
Create Subnet: checked
Subnet Name: external
Network Address: 192.168.2.0/24
IP Version: IPv4
Gateway IP: 192.168.2.1
DHCP: Enable

11

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

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.

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

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.

13

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.

14

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.

1516

To verify OpenStack network settings, go to Project -> Network -> Network Topology and a network map will be presented

17

Now OpenStack network is now functional and ready for virtual machines.

 

 
Leave a comment

Posted by on August 4, 2017 in Linux, OpenStack, Virtualization

 

Diff. b/w Stateful / Stateless Services for HA

What is different between stateful and stateless services for High Availability Technologies.

Stateful:

  • An action typically comprises multiple requests
  • Data needs to be replicated and synchronized between redundant services (to preserve state and consistency)
  • For example on Openstack services for stateful  MySQL, RabbitMQ, Cinder Volume, Ceilometer center agent, Neutron L3, DHCP agents, etc.

Stateless:

  • There is no dependency between requests
  • No need for data replication/synchronization. Failed request may need to be restarted on a different node.
  • For example on Openstack for stateless services  Nova-api, nova-conductor, glance-api, keystone-api, neutron-api, nova-scheduler, Apache web server, Cinder Scheduler, etc.
 

How to Install Your Own Cloud Platform with OpenStack inCentOS 7

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

To configure hostname:

[root@cloud ~]# hostname
cloud.openstack.lan
[root@cloud ~]# hostname -f
cloud.openstack.lan
[root@cloud ~]# hostname -s
cloud

To check all running services:
[root@cloud ~]# ss -tulpn
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Po rt
udp UNCONN 0 0 127.0.0.1:323 *:* users:((“chronyd”,pid=618,fd=1))
udp UNCONN 0 0 *:5353 *:* users:((“avahi-daemon”,pid=643,fd=12))
udp UNCONN 0 0 *:55073 *:* users:((“avahi-daemon”,pid=643,fd=13))
udp UNCONN 0 0 ::1:323 :::* users:((“chronyd”,pid=618,fd=2))
tcp LISTEN 0 128 *:111 *:* users:((“systemd”,pid=1,fd=50))
tcp LISTEN 0 128 *:22 *:* users:((“sshd”,pid=12309,fd=3))
tcp LISTEN 0 128 127.0.0.1:631 *:* users:((“cupsd”,pid=742,fd=12))
tcp LISTEN 0 100 127.0.0.1:25 *:* users:((“master”,pid=1432,fd=13))
tcp LISTEN 0 128 :::111 :::* users:((“systemd”,pid=1,fd=49))
tcp LISTEN 0 128 :::22 :::* users:((“sshd”,pid=12309,fd=4))
tcp LISTEN 0 128 ::1:631 :::* users:((“cupsd”,pid=742,fd=11))

To stop, disable or remove unwanted services:
[root@cloud ~]# systemctl stop postfix firewalld NetworkManager
[root@cloud ~]# systemctl disable postfix
[root@cloud ~]# systemctl disable firewalld
[root@cloud ~]# systemctl disable NetworkManager
[root@cloud ~]# systemctl mask NetworkManager
Created symlink from /etc/systemd/system/NetworkManager.service to /dev/null.
[root@cloud ~]# yum remove postfix NetworkManager NetworkManager-libnm

To disable Selinux:

[root@cloud ~]# vi /etc/selinux/config

enforcing to disabled

To install ntp for synchronize time with a NTP server

[root@cloud ~]# yum install ntpdate
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Resolving Dependencies
–> Running transaction check
—> Package ntpdate.x86_64 0:4.2.6p5-25.el7.centos will be updated
–> Processing Dependency: ntpdate = 4.2.6p5-25.el7.centos for package: ntp-4.2.6p5-25.el7.centos.x86_64
—> Package ntpdate.x86_64 0:4.2.6p5-25.el7.centos.1 will be an update
–> Running transaction check
Complete!

To Install OpenStack in CentOS:

[root@cloud ~]# yum install https://www.rdoproject.org/repos/rdo-release.rpm
Loaded plugins: fastestmirror, langpacks
rdo-release.rpm | 5.2 kB 00:00:00
Examining /var/tmp/yum-root-VZ95CL/rdo-release.rpm: rdo-release-newton-4.noarch
Marking /var/tmp/yum-root-VZ95CL/rdo-release.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package rdo-release.noarch 0:newton-4 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
rdo-release noarch newton-4 /rdo-release 3.2 k

Transaction Summary
=========================================================================================================
Install 1 Package

Total size: 3.2 k
Installed size: 3.2 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : rdo-release-newton-4.noarch 1/1
Verifying : rdo-release-newton-4.noarch 1/1

Installed:
rdo-release.noarch 0:newton-4

Complete!

[root@cloud ~]# yum install -y centos-release-openstack-mitaka
Loaded plugins: fastestmirror, langpacks
openstack-newton | 2.9 kB 00:00:00
rdo-qemu-ev | 2.9 kB 00:00:00
(1/2): rdo-qemu-ev/x86_64/primary_db | 52 kB 00:00:01
(2/2): openstack-newton/x86_64/primary_db | 854 kB 00:00:08
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Resolving Dependencies
–> Running transaction check
—> Package centos-release-openstack-mitaka.noarch 0:1-5.el7 will be installed
–> Processing Dependency: centos-release-qemu-ev for package: centos-release-openstack-mitaka-1-5.el7.noarch
–> Processing Dependency: centos-release-ceph-hammer for package: centos-release-openstack-mitaka-1-5.el7.noarch
–> Running transaction check
—> Package centos-release-ceph-hammer.noarch 0:1.0-5.el7.centos will be installed
–> Processing Dependency: centos-release-storage-common for package: centos-release-ceph-hammer-1.0-5.el7.centos.noarch
—> Package centos-release-qemu-ev.noarch 0:1.0-1.el7 will be installed
–> Processing Dependency: centos-release-virt-common for package: centos-release-qemu-ev-1.0-1.el7.noarch
–> Running transaction check
—> Package centos-release-storage-common.noarch 0:1-2.el7.centos will be installed
—> Package centos-release-virt-common.noarch 0:1-1.el7.centos will be installed
–> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
centos-release-openstack-mitaka noarch 1-5.el7 extras 5.3 k
Installing for dependencies:
centos-release-ceph-hammer noarch 1.0-5.el7.centos extras 4.5 k
centos-release-qemu-ev noarch 1.0-1.el7 extras 11 k
centos-release-storage-common noarch 1-2.el7.centos extras 4.5 k
centos-release-virt-common noarch 1-1.el7.centos extras 4.5 k

Transaction Summary
=========================================================================================================
Install 1 Package (+4 Dependent packages)

Total download size: 30 k
Installed size: 23 k
Downloading packages:
(1/5): centos-release-ceph-hammer-1.0-5.el7.centos.noarch.rpm | 4.5 kB 00:00:00
(2/5): centos-release-openstack-mitaka-1-5.el7.noarch.rpm | 5.3 kB 00:00:00
(3/5): centos-release-qemu-ev-1.0-1.el7.noarch.rpm | 11 kB 00:00:01
(4/5): centos-release-storage-common-1-2.el7.centos.noarch.rpm | 4.5 kB 00:00:01
(5/5): centos-release-virt-common-1-1.el7.centos.noarch.rpm | 4.5 kB 00:00:02
———————————————————————————————————
Total 8.7 kB/s | 30 kB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : centos-release-virt-common-1-1.el7.centos.noarch 1/5
Installing : centos-release-qemu-ev-1.0-1.el7.noarch 2/5
Installing : centos-release-storage-common-1-2.el7.centos.noarch 3/5
Installing : centos-release-ceph-hammer-1.0-5.el7.centos.noarch 4/5
Installing : centos-release-openstack-mitaka-1-5.el7.noarch 5/5
Verifying : centos-release-storage-common-1-2.el7.centos.noarch 1/5
Verifying : centos-release-openstack-mitaka-1-5.el7.noarch 2/5
Verifying : centos-release-ceph-hammer-1.0-5.el7.centos.noarch 3/5
Verifying : centos-release-virt-common-1-1.el7.centos.noarch 4/5
Verifying : centos-release-qemu-ev-1.0-1.el7.noarch 5/5

Installed:
centos-release-openstack-mitaka.noarch 0:1-5.el7

Dependency Installed:
centos-release-ceph-hammer.noarch 0:1.0-5.el7.centos
centos-release-qemu-ev.noarch 0:1.0-1.el7
centos-release-storage-common.noarch 0:1-2.el7.centos
centos-release-virt-common.noarch 0:1-1.el7.centos

Complete!

[root@cloud ~]# yum install openstack-packstack

[root@cloud ~]# packstack –gen-answer-file=24.02.17.conf
Packstack changed given value to required value /root/.ssh/id_rsa.pub
[root@cloud ~]# ls
24.02.17.conf anaconda-ks.cfg initial-setup-ks.cfg

[root@cloud ~]# vi 24.02.17.conf

# NTP Server
CONFIG_NTP_SERVERS=<NTP_Server_IP>

# Disable Demo Version
CONFIG_PROVISION_DEMO=n

# Set KeyStone Admin Password or Admin user Password
CONFIG_KEYSTONE_ADMIN_PW=mypassword

# Config Horizon over SSL
CONFIG_HORIZON_SSL=y

# Disable Nagios
CONFIG_NAGIOS_INSTALL=n

save and exit

[root@cloud ~]# yum install httpd
Resolving Dependencies
–> Running transaction check
—> Package httpd.x86_64 0:2.4.6-45.el7.centos will be installed
–> Processing Dependency: httpd-tools = 2.4.6-45.el7.centos for package: httpd-2.4.6-45.el7.centos.x86_64

Complete!

To generated answer configuration file with current date:

[root@cloud ~]# packstack –answer-file 24.02.17.conf
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20170224-112443-eqHTim/openstack-setup.log

Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
Pre installing Puppet and discovering hosts’ details [ DONE ]
Preparing pre-install entries [ DONE ]
Installing time synchronization via NTP [ DONE ]
Setting up CACERT [ DONE ]
Preparing AMQP entries [ DONE ]
Preparing MariaDB entries [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries [ DONE ]
Preparing Glance entries [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries [ DONE ]
Preparing Nova API entries [ DONE ]
Creating ssh keys for Nova migration [ DONE ]
Gathering ssh host keys for Nova migration [ DONE ]
Preparing Nova Compute entries [ DONE ]
Preparing Nova Scheduler entries [ DONE ]
Preparing Nova VNC Proxy entries [ DONE ]
Preparing OpenStack Network-related Nova entries [ DONE ]
Preparing Nova Common entries [ DONE ]
Preparing Neutron LBaaS Agent entries [ DONE ]
Preparing Neutron API entries [ DONE ]
Preparing Neutron L3 entries [ DONE ]
Preparing Neutron L2 Agent entries [ DONE ]
Preparing Neutron DHCP Agent entries [ DONE ]
Preparing Neutron Metering Agent entries [ DONE ]
Checking if NetworkManager is enabled and running [ DONE ]
Preparing OpenStack Client entries [ DONE ]
Preparing Horizon entries [ DONE ]
Preparing Swift builder entries [ DONE ]
Preparing Swift proxy entries [ DONE ]
Preparing Swift storage entries [ DONE ]
Preparing Gnocchi entries [ DONE ]
Preparing MongoDB entries [ DONE ]
Preparing Redis entries [ DONE ]
Preparing Ceilometer entries [ DONE ]
Preparing Aodh entries [ DONE ]
Preparing Nagios server entries [ DONE ]
Preparing Nagios host entries [ DONE ]
Preparing Puppet manifests [ DONE ]
Copying Puppet modules and manifests [ DONE ]
Applying 10.100.100.123_controller.pp
Testing if puppet apply is finished: 10.100.100.123_controller.pp [ \ ]
10.100.100.123_controller.pp: [ DONE ]
Applying 10.100.100.123_network.pp
10.100.100.123_network.pp: [ DONE ]
Applying 10.100.100.123_compute.pp
10.100.100.123_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]

**** Installation completed successfully ******

Additional information:
* File /root/keystonerc_admin has been created on OpenStack client host 10.100.100.123. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://10.100.100.123/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* To use Nagios, browse to http://10.100.100.123/nagios username: nagiosadmin, password: password
* The installation log file is available at: /var/tmp/packstack/20170224-112443-eqHTim/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20170224-112443-eqHTim/manifests
[root@cloud ~]#

login

 
Leave a comment

Posted by on March 2, 2017 in Linux, OpenStack, Virtualization