Sunday, July 31, 2016

INSTALLATION OF OPENSTACK



OpenStack


OPENSTACK

                OpenStack is a set of software tools for building and managing cloud computing platforms for public and private clouds. Backed by some of the biggest companies in software development and hosting, as well as thousands of individual community members, many think that OpenStack is the future of cloud computing. OpenStack is managed by the OpenStack Foundation, a non-profit that oversees both development and community-building around the project.

 COMPONENTS AND SERVICES



Service
Project name
Description
Dashboard
Horizon
Provides a web-based self-service portal to interact with underlying OpenStack services, such as launching an instance, assigning IP addresses and configuring access controls.
Compute
Nova
Manages the lifecycle of compute instances in an OpenStack environment. Responsibilities include spawning, scheduling and decommissioning of virtual machines on demand.
Networking
Neutron
Enables Network-Connectivity-as-a-Service for other OpenStack services, such as OpenStack Compute. Provides an API for users to define networks and the attachments into them. Has a pluggable architecture that supports many popular networking vendors and technologies.
Storage
Object Storage
Swift
Stores and retrieves arbitrary unstructured data objects via a RESTful, HTTP based API. It is highly fault tolerant with its data replication and scale out architecture. Its implementation is not like a file server with mountable directories.
Block Storage
Cinder
Provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
Shared services
Identity service
Keystone
Provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
Image Service
Glance
Stores and retrieves virtual machine disk images. OpenStack Compute makes use of this during instance provisioning.
Telemetry
Monitors and meters the OpenStack cloud for billing, benchmarking, scalability, and statistical purposes.
Higher-level services
Orchestration
Heat
Orchestrates multiple composite cloud applications by using either the native HOT template format or the AWS CloudFormation template format, through both an OpenStack-native REST API and a CloudFormation-compatible Query API.
Database Service
Trove
Provides scalable and reliable Cloud Database-as-a-Service functionality for both relational and non-relational database engines.



openstack architecture





INSTALLATION OF OPENSTACK


1. add new user named stack – This stack user is the adminstrator of the openstack services.

            To add new user – run the command as root user.

                        adduser stack

2. run the command
                         apt-get install sudo -y


3. Be careful in running the command – please be careful with the syntax. If any error in thsi following command, the system will crash beacause of permission errors. 
                                               
                        echo “stack ALL=(ALL) NOPASSWD:ALL” >> /etc/sudoers

4. Logout the system and login as stack user

5. Run the command (this installs git repo package)
Please ensure that you are as logged in as non-root user (stack user), and not in /root directory.

                        sudo apt-get install git
6. Run the command (This clones updatesd version of dev-stack (which is binary auto-installer package of Openstack)
                        git clone https://git.openstack.org/openstack-dev/devstack
                        ls (this shows a folder named devstack)
                        cd devstack (enter into the folder)

7. create a file called local.conf. To do this run the command,
                        nano local.conf

8. In the file, make the following entry (Contact Your Network Adminstrator for doubts in these values)
            [[local|localrc]]
FLOATING_RANGE=192.168.1.224/27
FIXED_RANGE=10.11.11.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
ADMIN_PASSWORD=root
DATABASE_PASSWORD=root
RABBIT_PASSWORD=root
SERVICE_PASSWORD=root
SERVICE_TOCKEN=root

9. Save this file
10. Run the command (This installs Opentack)
            ./stack.sh
11. If any error occurs, then run the command for uninistallation
            ./unstack.sh
                        1. update the packages
            apt-get update
                                    2. Then reinstall the package
            ./stack.sh


12. Open the browser, http://IP address of your machine, you will get the openstack portal.



13. If you  restart the machine and want to start open stack

            open terminal,
                        su stack
                        cd devstack
                        run ./rejoin.sh

14. Again you can access openstack services in the browser, http://IP address of your machine, 

Thursday, July 28, 2016

OPEN NEBULA INSTALLATION




OPEN NEBULA INSTALLATION ON UBUNTU 14.04




















To test if your host supports virtualization extensions, please run:

grep -E 'svm|vmx' /proc/cpuinfo

If you don’t get any output you probably don’t have virtualization extensions supported/enabled in your server.

Step 1. Installation in the Frontend


Commands prefixed by # are meant to be run as root. Commands prefixed by $ must be run as oneadmin.

1.1. Install the repo


Add the OpenNebula repository:

# wget -q -O- http://downloads.opennebula.org/repo/Ubuntu/repo.key | apt-key add -
# echo "deb http://downloads.opennebula.org/repo/Ubuntu/14.04 stable opennebula" \
> /etc/apt/sources.list.d/opennebula.list

1.2. Install the required packages


# apt-get update
# apt-get install opennebula opennebula-sunstone nfs-kernel-server

1.3. Configure and Start the services


There are two main processes that must be started, the main OpenNebula daemon: oned, and the graphical user interface: sunstone.

Sunstone listens only in the loopback interface by default for security reasons. To change it edit /etc/one/sunstone-server.conf and change :host: 127.0.0.1 to :host: 0.0.0.0.

Now we must restart the Sunstone:

# /etc/init.d/opennebula-sunstone restart

1.4. Configure SSH Public Key


OpenNebula will need to SSH passwordlessly from any node (including the frontend) to any other node.

To do so run the following commands:

# su - oneadmin
$ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

Add the following snippet to ~/.ssh/config so it doesn’t prompt to add the keys to the known_hosts file:

$ cat << EOT > ~/.ssh/config
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
EOT
$ chmod 600 ~/.ssh/config

Step 2. Installation in the Nodes


2.1. Install the repo


Add the OpenNebula repository:

# wget -q -O- http://downloads.opennebula.org/repo/Ubuntu/repo.key | apt-key add -
# echo "deb http://downloads.opennebula.org/repo/Ubuntu/14.04 stable opennebula" > \
/etc/apt/sources.list.d/opennebula.list

2.2. Install the required packages


# apt-get update
# apt-get install opennebula-node nfs-common bridge-utils

2.3. Configure the Network


[Warning : Backup all the files that are modified in this section before making changes to them.]

You will need to have your main interface, typically eth0, connected to a bridge. The name of the bridge should be the same in all nodes.

If you were using DHCP for your eth0 interface, replace /etc/network/interfaces with:

auto lo
iface lo inet loopback

auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

If you were using a static IP addresses instead, use this other template:

auto lo
iface lo inet loopback

auto br0
iface br0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

After these changes, restart the network:

# /etc/init.d/networking restart

2.4. Configure Qemu


The oneadmin user must be able to manage libvirt as root:

# cat << EOT > /etc/libvirt/qemu.conf
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 0
EOT

Restart libvirt to capture these changes:

# service libvirt-bin restart

Step 3. Basic Usage



All the operations in this section can be done using Sunstone instead of the command line. Point your browser to: http://frontend:9869.

The default password for the oneadmin user can be found in ~/.one/one_auth which is randomly generated on every installation.
open nebula One admin panel






























To interact with OpenNebula, you have to do it from the oneadmin account in the frontend. We will assume all the following commands are performed from that account. To login as oneadmin execute su - oneadmin.