Cloud Computing 24 min read

Step-by-Step Guide to Deploy OpenStack and OpenNebula with One-Click Scripts

This article provides a comprehensive overview of OpenStack and OpenNebula, detailing their purposes, architectures, core components, and key concepts, followed by a complete one‑click shell script that automates the installation and configuration of an OpenStack Pike environment on CentOS 7.

Open Source Linux
Open Source Linux
Open Source Linux
Step-by-Step Guide to Deploy OpenStack and OpenNebula with One-Click Scripts

OpenStack

Purpose: OpenStack is an open‑source cloud computing platform for building and managing public and private clouds, offering services such as compute, storage, networking, and identity.

Architecture: OpenStack follows a distributed architecture composed of core services:

Nova (Compute): Manages and schedules virtual machine instances, providing elastic compute, auto‑scaling and load balancing.

Neutron (Networking): Creates and manages virtual networks, supports SDN, custom topologies, security groups and firewalls.

Cinder (Block Storage): Provides persistent block storage devices for VM data.

Swift (Object Storage): Distributed object storage for large‑scale unstructured data with high availability.

Keystone (Identity): Handles authentication, authorization, SSO and project/role management.

Glance (Image): Stores and serves VM images for instance creation.

Core concepts:

Instance: Virtual machine created on top of the hypervisor.

Network: Flexible virtual networking including subnets, routers and security groups.

Block Storage: Persistent disks managed by Cinder.

Object Storage: Distributed storage provided by Swift.

Image: VM templates managed by Glance.

Project/Tenant: Isolated resource domains with quotas and permissions.

Elastic Scaling: Automatic adjustment of compute resources based on load.

Load Balancing: Distributes traffic across multiple VM instances.

Compute Node: Physical or virtual host running VM instances, managed by Nova.

Control Node: Central management node running core services.

Metadata Service: Provides dynamic instance information such as IP address.

Identity Provider: External authentication sources (LDAP, AD) integrated with Keystone.

OpenNebula

Purpose: OpenNebula is an open‑source cloud management platform for building private and hybrid clouds, offering tools for deployment, monitoring and automation of virtualized infrastructure.

Architecture: Distributed components include:

OpenNebula Core: Handles user requests, resource management and coordination, exposing API and CLI.

Scheduler: Places VM instances on physical hosts based on policies and resource availability.

Virtualization Manager: Interfaces with KVM, VMware, Xen to create, destroy and migrate VMs.

Image Manager: Manages VM images – upload, registration, copy and sharing.

Network Manager: Manages virtual networks, isolation, NAT, load balancing and security groups.

Storage Manager: Manages local, network and object storage resources.

Core concepts:

Virtual Machine: VM instance created from virtualization technology.

Virtualization Resources: Physical hosts, storage and network assets managed by OpenNebula.

Images: VM templates containing OS and applications.

Virtual Networks: Configurable virtual networks with isolation and routing.

Storage Resources: Local, network and object storage for VM disks and data.

User and Permission Management: Role‑based access control for users and projects.

Elasticity and Load Balancing: Automatic scaling and traffic distribution.

Monitoring and Logging: Tracks VM status, resource usage and events.

API and CLI: Programmatic and command‑line interfaces for management.

Below is a comparison table of OpenStack and OpenNebula:

OpenStack vs OpenNebula comparison
OpenStack vs OpenNebula comparison

One‑Click OpenStack Deployment Script

#!/bin/sh
# openstack pike single‑node one‑click install
# environment centos 7.4.1708 x86_64

[[ `uname -r` = *el7* ]] && { echo 'Starting OpenStack Pike installation'; } || { echo 'Run on CentOS 7.4 environment'; exit; }

##########################################
# Parameters
# Get first NIC name and IP
Net=`ip add|egrep global|awk '{ print $NF }'|head -n 1`
IP=`ip add|grep global|awk -F'[ /]+' '{ print $3 }'|head -n 1`
echo "Network interface: $Net"
echo "IP address: $IP"

# Parameters
DBPass=elven2017    # SQL root password
Node=controller     # Node name
Netname=$Net        # NIC name
MyIP=$IP            # IP address
VncProxy=$IP        # VNC proxy external IP
Imgdir=/date/glance # Glance image directory
VHD=/date/nova      # Nova instance path
Kvm=qemu            # QEMU or KVM (requires hardware support)

##########################################
# 1. Basic setup
echo 'Disable SELinux and firewall'
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i '/^SELINUX=.*/c SELINUX=disabled' /etc/selinux/config
sed -i 's/^SELINUXTYPE=.*/SELINUXTYPE=disabled/g' /etc/selinux/config
setenforce 0

echo 'Time synchronization'
/usr/sbin/ntpdate ntp6.aliyun.com
echo "*/3 * * * * /usr/sbin/ntpdate ntp6.aliyun.com  >/dev/null" > /tmp/crontab
crontab /tmp/crontab

echo 'Set hostname'
hostnamectl set-hostname $Node
echo "$SetIP   $Node" >> /etc/hosts

echo 'Configure OpenStack repository'
wget -O /etc/yum.repos.d/Ali-pike.repo http://elven.vip/ks/openstack/Ali-pike.repo
yum clean all && yum makecache

##########################################
# 2. Install packages
function installrpm() {
  echo 'Install OpenStack tools'
  yum install -y python-openstackclient openstack-selinux python2-PyMySQL openstack-utils
  echo 'Install MariaDB'
  yum install -y mariadb mariadb-server mariadb-galera-server expect
  echo 'Install RabbitMQ'
  yum install -y rabbitmq-server erlang socat
  echo 'Install Keystone'
  yum install -y openstack-keystone httpd mod_wsgi memcached python-memcached apr apr-util
  echo 'Install Glance'
  yum install -y openstack-glance python-glance
  echo 'Install Nova'
  yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api openstack-nova-compute
  echo 'Install Neutron'
  yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset
  echo 'Install Dashboard'
  yum install -y openstack-dashboard
}

echo 'Install OpenStack'
installrpm
echo 'Re‑install to avoid download failures'
installrpm

##########################################
# 3. Configuration (selected excerpts)

echo 'Configure MariaDB'
cp /etc/my.cnf.d/openstack.cnf{,.bak}
cat > /etc/my.cnf.d/openstack.cnf <<'EOF'
[mysqld]
bind-address = 0.0.0.0
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
EOF
systemctl enable mariadb.service
systemctl start mariadb.service
# Secure installation using expect (omitted for brevity)

# RabbitMQ setup
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user admin admin
rabbitmqctl set_user_tags admin administrator
rabbitmqctl add_user openstack openstack
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
rabbitmqctl set_user_tags openstack administrator
systemctl restart rabbitmq-server.service

# Keystone setup (keystone.conf generation omitted for brevity)

# Glance service registration
source ./admin-openstack.sh
openstack service create --name glance --description "OpenStack Image" image
openstack endpoint create --region RegionOne image public http://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292

# Nova service registration
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1

# Neutron service registration
openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region RegionOne network public http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696

# Enable and start services
systemctl enable httpd.service openstack-glance-api openstack-glance-registry openstack-nova-api.service openstack-nova-conductor.service openstack-nova-scheduler.service openstack-nova-compute.service neutron-server.service
systemctl start httpd.service openstack-glance-api openstack-glance-registry openstack-nova-api.service openstack-nova-conductor.service openstack-nova-scheduler.service openstack-nova-compute.service neutron-server.service

echo 'Installation complete!'
echo "Database root password: $DBPass"
echo "Access the dashboard at http://$MyIP/dashboard (user: admin, password: admin)"
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AutomationLinuxcloud deploymentOpenStackscriptOpenNebula
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.