April 7, 2019

Install and configure OpenStack Pike with Kolla as a standalone

Kolla is an OpenStack project focused on deploying, maintaining, and upgrading easily production OpenStack clouds following the community best practices. To achieve this goal, Kolla uses two main technologies: Ansible automation scripts and Docker containers. As you will see, it is really easy to deploy and maintain OpenStack using Kolla.
OpenStack Kolla Logo

Prerequisites

For this lab, we will deploy Ocata which is the last stable version of OpenStack on a single machine. This kind of deployment is also known as All-In-One (AIO). Kolla is supported on CentOS, Oracle Linux and Ubuntu.

Linux distribution

We will use a Ubuntu 16.04 VM with 4 vCPU, 8 GB of RAM and 40 GB of disk. Depending on the number of OpenStack services you are willing to install, you may have to add more RAM and more disk space.

Networking

The VM will have two NICs configured with a static IP. The first NIC will have the IP 10.10.20.31/24, the second NIC will have the IP 10.10.20.32/24, and the gateway will be 10.10.20.1/24. We will also need two virtual IPs for HAproxy and we will use 10.10.20.30/24 for the external virtual IP and 10.10.20.33/24 for the internal virtual IP.

Upgrade Ubuntu 16.04 LTS

1- Update the the APT repository.
$ sudo apt-get update
2- Upgrade your system.
$ sudo apt-get upgrade

Configure the network

1- The first interface (ens192 in my case) should have an IP and the second interface (ens224 in my case) should be down.
$ ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       validlft forever preferredlft forever
    inet6 ::1/128 scope host 
       validlft forever preferredlft forever
2: ens192:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:01:1e:8c brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.31/24 brd 10.10.20.255 scope global ens192
       validlft forever preferredlft forever
    inet6 fe80::250:56ff:fe01:1e8c/64 scope link 
       validlft forever preferredlft forever
3: ens224:  mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:50:56:01:1e:8e brd ff:ff:ff:ff:ff:ff
2- Edit the network configuration file.
$ sudo vim /etc/network/interfaces
3- Add the following lines to your network configuration file to get an IP from the DHCP server (you can of course use a static IP if you wish). Replace [second_nic_label] with the label of your interface.
# The secondary network interface
auto [second_nic_label]
iface [second_nic_label] inet static
        address 10.10.20.32
        netmask 255.255.255.0
4- Restart the network.
$ sudo systemctl restart networking
5- Check if your second network card got an IP.
$ sudo ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       validlft forever preferredlft forever
    inet6 ::1/128 scope host 
       validlft forever preferredlft forever
2: ens192:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:01:1e:8c brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.31/24 brd 10.10.20.255 scope global ens192
       validlft forever preferredlft forever
    inet6 fe80::250:56ff:fe01:1e8c/64 scope link 
       validlft forever preferredlft forever
3: ens224:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:01:1e:8e brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.32/24 brd 10.10.20.255 scope global ens224
       validlft forever preferredlft forever
    inet6 fe80::250:56ff:fe01:1e8e/64 scope link 
       validlft forever preferredlft forever

Install Kolla Dependancies

$ sudo apt-get install python-jinja2 python-pip libssl-dev
$ sudo pip install --upgrade pip
$ sudo pip install ansible

Install and configure Kolla

1- Install kolla-ansible.
$ sudo pip install kolla-ansible==6.0.0.0rc2
2- Copy the configurations files.
$ sudo cp -r /usr/local/share/kolla-ansible/etc_examples/kolla /etc/kolla
3- Edit the Kolla configuration.
$ sudo vim /etc/kolla/globals.yml
4- Modify the following values. Modify [first_nic_label], and [second_nic_label] accordingly.
kolla_base_distro: "centos"
kolla_install_type: "binary"
openstack_release: "pike"
kolla_internal_vip_address: "10.10.20.33"
kolla_external_vip_address: "10.10.20.30"
network_interface: "[first_nic_label]"
neutron_external_interface: "[second_nic_label]"
kolla_enable_tls_external: "yes"
kolla_external_fqdn_cert: "{{ nodeconfigdirectory }}/certificates/haproxy.pem"
5- Generate a self-signed TLS certificate for the HAProxy external interface. It will be stored in /etc/kolla/certificates. You can of course also use a signed certificates if you have one.
$ sudo kolla-ansible certificates
6- Use QEMU instead of KVM (you can skip this step if your host supports hardware virtualization).
$ sudo mkdir -p /etc/kolla/config/nova
$ sudo vim /etc/kolla/config/nova/nova-compute.conf
Add the following lines:
[libvirt]
virt_type = qemu
cpu_mode = none
7- If you are deploying a nested environment (your host is a VM), you need to enable promiscuous on your virtual network. If you don't do this, your instances will not have external connectivity.
8- Generate password for the deployment.
$ sudo kolla-genpwd
9- Bootstrap the server.
$ sudo kolla-ansible \
-i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one \
bootstrap-servers
10- Verify if the bootstrap was successful.
localhost: ok=40   changed=20   unreachable=0    failed=0
11- Pull the different Docker images needed by Kolla.
$ sudo kolla-ansible pull

Deploy OpenStack using Kolla

1- Check the environment.
$ sudo kolla-ansible prechecks \
-i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one
2- Verify if the precheck was successful.
localhost: ok=83   changed=1    unreachable=0    failed=0
3- Deploy OpenStack.
$ sudo kolla-ansible deploy \
-i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one
4-Verify if all the containers are up and running.
$ sudo docker ps -a
5- Generate the admin-openrc.sh configuration file.
$ sudo kolla-ansible post-deploy
6- Install the openstack CLI client.
$ sudo pip install python-openstackclient
7- Edit the init-runonce file.
$ sudo vim /usr/local/share/kolla-ansible/init-runonce
8- Modify the public network scheme.
EXT_NET_CIDR='10.10.20.0/24'
EXT_NET_RANGE='start=10.10.20.110,end=10.10.20.254'
EXT_NET_GATEWAY='10.10.20.1'
9- Get the root privileges.
$ sudo -s
10- Load the environment variable needed by the OpenStack CLI
# source /etc/kolla/admin-openrc.sh
11- Initialize the deployment.
# cd /usr/local/share/kolla-ansible/ && ./init-runonce

Access the Horizon console

1- Get the admin user password.
$ sudo grep keystone_admin_password /etc/kolla/passwords.yml
2- Browse to the external virtual IP https://10.10.20.30 and login with the user "admin" and the password from the previous step.
OpenStack Horizon Login Page
At this point you should have a working deployment of OpenStack Ocata. If you want to add more services like Cinder (block storage) or Swift (object storage), please refer to the specific annexes.

Annexes

Kolla management

Destroy the OpenStack deployment

1- Delete all the instances in your OpenStack environment.
2- Destroy the OpenStack deployment.
$ sudo kolla-ansible destroy --yes-i-really-really-mean-it

Stop the deployed containers

1- Go in the tools directory.
$ cd /usr/local/share/kolla-ansible/tools
2- Stop the containers
$ sudo ./stop-containers

Remove the deployed containers

1- Go to the tools directory.
$ cd /usr/local/share/kolla-ansible/tools
2- Remove the containers
$ sudo ./cleanup-containers

Remove the network modification done by Neutron.

1- Go to the tools directory.
$ cd /usr/local/share/kolla-ansible/tools
2- Clean the network.
$ sudo ./cleanup-host

Remove the containers images stored in the local registry.

1- Go to the tools directory.
$ cd /usr/local/share/kolla-ansible/tools
2- Clean the images.
$ sudo ./cleanup-images

April 1, 2019

Qu’est-ce que le cloud computing ?

Le cloud computing consiste à louer des ressources, comme de l’espace de stockage ou des cycles CPU, sur les ordinateurs d’une autre société. Vous ne payez que ce que vous utilisez. La société qui fournit ces services est appelée un fournisseur de cloud. Microsoft, Amazon et Google sont des exemples de fournisseurs.
Le fournisseur de cloud est responsable du matériel physique nécessaire à l’exécution de votre travail, et de maintenir ce matériel à jour. Les services informatiques offerts tendent à varier en fonction du fournisseur de cloud. Toutefois, ils comprennent généralement les éléments suivants :
  • De la puissance de calcul, par exemple des machines virtuelles Windows et Linux
  • Du stockage, par exemple le stockage d’objets
  • Des applications, par exemple des applications de base de données NoSQL ou SQL
  • Une gestion réseau, par exemple la configuration de réseaux virtuels pour vos machines virtuelles
  • De l’analytique, par exemple la visualisation de la télémétrie et des données de performances

Services de cloud computing

Le cloud computing a pour fonction de faciliter la gestion d’une entreprise et d’en accroître l’efficacité, qu’il s’agisse d’une petite entreprise naissante ou d’une grande entreprise. Chaque entreprise est unique et a des besoins qui lui sont propres. Pour répondre à ces besoins, les fournisseurs de cloud computing offrent un large éventail de services.
Vous devez avoir une compréhension de base de certains des services fournis. Examinons brièvement les deux services les plus courants offerts par tous les fournisseurs de cloud – puissance de calcul et stockage.

Puissance de calcul

Que vous le sachiez ou non, vous utilisez de la puissance de calcul quotidiennement. Si vous envoyez un e-mail, surfez sur un site web ou consultez la météo sur votre appareil mobile, du matériel effectue le traitement informatique en arrière-plan.
Quand vous générez des solutions de cloud computing, vous pouvez choisir la manière dont vous souhaitez accomplir le travail en fonction de vos ressources et de vos besoins. Par exemple, si vous souhaitez exercer davantage de contrôle et de responsabilités sur la maintenance, vous pouvez créer une machine virtuelle. Une machine virtuelle est l’émulation d’un système d’exploitation d’ordinateur et de composants matériels. Elle apparaît à l’utilisateur comme un ordinateur physique exécutant Windows ou Linux. Avec le cloud, vous pouvez disposer d’une machine virtuelle prête à l’emploi en quelques minutes, et non dans un délai de plusieurs jours ou semaines.
Jauge de puissance de calcul

Que sont les conteneurs ?

Les conteneurs fournissent un environnement d’exécution cohérent et isolé aux applications. Le projet open source Docker est une des principales plateformes de gestion de conteneurs. Les conteneurs Docker constituent une approche légère et efficace pour le déploiement d’applications, car ils permettent de déployer indépendamment différents composants de l’application dans des conteneurs distincts. Plusieurs conteneurs peuvent résider sur une même machine et être déplacés d’une machine vers une autre. La portabilité du conteneur facilite considérablement le déploiement d’applications dans plusieurs environnements, localement ou dans le cloud, bien souvent sans changement de ces applications.

Qu’est-ce que l’informatique Serverless ?

L’informatique serverless vous permet d’exécuter du code d’application sans avoir à créer, configurer ou gérer un serveur. L’informatique Serverless vous permet de vous concentrer exclusivement sur le comportement de votre application. Elle est idéale pour les tâches d’automatisation. Par exemple, vous pouvez créer un processus serverless qui envoie automatiquement un e-mail de confirmation une fois qu’un client effectue un achat en ligne.

Stockage

La plupart des appareils lisent et/ou écrivent des données. Voici quelques exemples :
  • Récupération d’informations météorologiques
  • Prise d’une photo
  • Envoi d’un e-mail
  • Dépôt d’un message vocal
Dans tous ces cas de figure, les données sont lues (par exemple la météo) ou écrites (par exemple la prise d’une photo). Le type de données est différent dans chacun de ces cas.
Jauge de stockage
Les fournisseurs de cloud offrent généralement des services capables de gérer tous ces types de données. Par exemple, si vous souhaitez stocker du texte, vous pouvez utiliser un fichier sur disque ou adopter une approche plus structurée, comme l’utilisation d’une base de données relationnelle.

Résumé

Chaque entreprise a des exigences et des besoins différents. Le cloud computing est flexible et économique, ce qui peut être intéressant pour chaque entreprise, qu’il s’agisse d’une petite start-up ou d’une grande entreprise.

Azure AD Connect : Commande PowerShell

Commande PowerShell pour Azure AD Connect
Importer le module  :
Afficher la planification des synchro :
Désactiver les synchro :
Activer les synchro :
Forcer une synchro totale
Forcer une synchro partielle/delta

March 28, 2019

How to install OpenStack on a single Ubuntu Server virtual machine

If you want to install OpenStack, but don't want to have to dedicate multiple machines for the project, here's how to do that with a single Ubuntu Server virtual machine.

OpenStack has become the de facto standard in private cloud server platforms. If you've ever considered spinning up OpenStack, you know that it is not only an administrative challenge, but it also requires considerable hardware—to the tune of around five servers. However, if you have a powerful enough virtual machine, you can run OpenStack on a single Ubuntu Server.

The requirements

  • Virtual machine on a real ESXi/KVM/Xen/etc. hypervisor, or a bare metal server with virtualization support
  • 14 GB of RAM (minimum)
  • 100 GB of hard disk space (minimum)
  • An updated Ubuntu 16.04 LTS server

Update and install dependencies

First, you must update Ubuntu. Open a terminal window and issue the commands:
sudo apt-get update
​sudo apt-get upgrade
Once those commands have completed, you'll need to install git. To do this, issue the command:
sudo apt-get install git
Allow that installation to complete.

Clone devstack

We're going to use git to clone devstack. To do this, go back to your terminal window and issue the following two commands:
cd /
​sudo git clone https://git.openstack.org/openstack-dev/devstack master
Next, we have to copy the sample configuration file and set a password to be used for automated deployment. To complete this task, issue the following commands:
cd devstack
​sudo cp samples/local.conf local.conf

Now we must set the automated deployment password. Open the local.conf file with the command:
sudo nano local.conf
Search for the password variable section and ensure it reflects the following (YOURPASSWORD is the actual password you want to use):
ADMIN_PASSWORD=YOURPASSWORD
​MYSQL_PASSWORD=$ADMIN_PASSWORD
​RABBIT_PASSWORD=$ADMIN_PASSWORD
​SERVICE_PASSWORD=$ADMIN_PASSWORD

Create a user and start the installation

It's time to run a few scripts. The first script will create a new user for devstack. The command to run this script is:
sudo /devstack/tools/create-stack-user.sh

Once the script completes, you'll need to change the permissions of the devstack folder with the command:
sudo chown -R stack:stack /devstack
It's time to run the installation script—this must be run as the stack user by first issuing the command sudo su stack. After you change to the stack user, kick off the install with the command /devstack/stack.sh. This command will take at least 30 minutes to complete.
When the command finally completes, you will be given an IP address (the address of the server), as well as two usernames (the admin password was created in the local.conf file). Open a browser, point it to http://SERVER_IP_ADDRESS/dashboard, and log in with the given credentials. You will be presented with the OpenStack Dashboard (Figure A).
Congratulations! You're ready to create and deploy.

How to Install Docker CE on CentOS 8 and RHEL 8

  Docker  is a daemon-based container engine which allows us to deploy applications inside containers.  Docker is available in two versions,...