Installation d’un cluster multi-noeuds OpenStack Ussuri sur des serveurs dédiés

Merouane Agar
5 min readFeb 10, 2021

--

Canonical offre la possibilité de créer un cluster multi-noeuds OpenStack avec MicroStack

MicroStack fournit un déploiement OpenStack à un ou plusieurs nœuds qui peut s’exécuter directement sur votre poste de travail.

MicroStack est un OpenStack en un clin d’œil, ce qui signifie que tous les services OpenStack et les bibliothèques de prise en charge sont regroupés dans un seul package qui peut être facilement installé, mis à niveau ou supprimé. MicroStack comprend tous les composants clés d’OpenStack: Keystone, Nova, Neutron, Glance et Cinder.

Architecture cible

3 x Serveurs dédiés kimsufi KS-6 :

  • CPU : Intel i5–750 4c/4t 2,67GHz
  • RAM : 16Go DDR3 1333 MHz
  • 1xNIC: 100 Mbps
  • Disc : 2To

Système d’exploitation : Ubuntu Server 20.04 LTS

Installer MicroStack à partir du branche egde sur les 3 serveurs (openstack, nova1, nova2)

ubuntu@openstack:~$ sudo snap install microstack --devmode --edge
microstack (edge) ussuri from Canonical✓ installed

Initialiser MicroStack sur le premier serveur (openstack) en mode cluster avec le rôle ‘control’ ~ 30min

ubuntu@openstack:~$ sudo microstack.init 
Would you like to configure clustering? (yes/no) [default=no] > yes
2021-02-09 14:22:50,730 - microstack_init - INFO - Configuring clustering ...
Which role would you like to use for this node: "control" or "compute"? > control
Please enter the ip address of the controlnode[default=Your IP] > Enter
...............
...............
2021-02-09 14:22:58,365 - microstack_init - INFO - Setting up as a
Would you like to setup extra services? (yes/no) [default=no] > no
ubuntu@openstack:~$ microstack.openstack service list+----------------------------------+-----------+-----------+
| ID | Name | Type |
+----------------------------------+-----------+-----------+
| 0a7aab5bbffc4bc6b41e49b2d396891f | nova | compute |
| 34310498d886415bb6d09be634706fc1 | keystone | identity |
| 6efee8cdbba4486ea8e62d24bb1adca7 | cinderv3 | volumev3 |
| 77a9e59a84684fac911101bac038e0e8 | neutron | network |
| 77bfc5fc0deb4ef59ea843a77fb7a6fc | glance | image |
| aa503adaae2d41ecbff5674ffe8b9e88 | cinderv2 | volumev2 |
| c00ea05dba394398a8d16a3b91e07564 | placement | placement |
+----------------------------------+-----------+-----------+

Sur le serveur de contrôle (openstack) , générez une chaîne de connexion dont le nœud de calcul potentiel aura besoin pour rejoindre le cluster:

ubuntu@openstack:~$ sudo microstack add-computeUse the following connection string to add a new compute node to the cluster (valid for 20 minutes from this moment):
hKhob3N0bmFtZaw5MS4x.....

Initialiser MicroStack avec la chaîne de connexion précédemment générée sur les serveurs (nova1, nova2)

ubuntu@nova1:~$ sudo microstack init --auto --compute --join hKhob3N0bmFtZaw5MS4x.....microstack_init — INFO — Configuring clustering …
microstack_init — INFO — Setting up as a compute node.
microstack_init — INFO — Configuring networking …
microstack_init — INFO — Opening horizon dashboard up to *
microstack_init — INFO — Disabling local rabbit …
microstack_init — INFO — Disabling local MySQL …
microstack_init — INFO — Disabling the Placement service…
microstack_init — INFO — Disabling nova control plane services …
microstack_init — INFO — Configuring nova compute hypervisor …
microstack_init — INFO — Checking virtualization extensions presence on the
microstack_init — INFO — Hardware virtualization is supported — KVM will be used for Nova instances
microstack_init — INFO — Configuring the Spice HTML5 console service… microstack_init — INFO — Creating security group rules …
microstack_init — INFO — Disabling Cinder services…
microstack_init — INFO — restarting libvirt and virtlogd …
microstack_init — INFO — Complete. Marked microstack as initialized!

Vérifier que les 3 hypervisors sont opérationnel avec le statut UP

ubuntu@openstack:~$ microstack.openstack hypervisor list
+----+-----------------+-----------------+----------------+-------+
| ID | Hypervisor Host | Hypervisor Type | Host IP | State |
+----+-----------------+-----------------+----------------+-------+
| 1 | openstack | QEMU | 91.121.85.XX | up |
| 2 | nova1 | QEMU | 91.121.184.XX | up |
| 3 | nova2 | QEMU | 91.121.222.XXX | up |
+----+-----------------+-----------------+----------------+-------+

OpenStack Web interface

Le mot de passe de l’utilisateur admin peut être obtenu de cette manière

ubuntu@openstack:~$ sudo snap get microstack config.credentials.keystone-password
lP5lIs1kPlQWfVxM07DxLwZzjRdwU0Aq

La Web UI est disponible sur l’@ du serveur Openstack sur le port 80

Vérification

Créer trois instances cirros dans sur les 3 hypervisors :

ubuntu@openstack:~$ microstack launch cirros \
--name cirros-1 \
--availability-zone nova:openstack
Launching server ...
Allocating floating ip ...
Server cirros-1 launched! (status is BUILD)
Access it with `
ssh -i /home/ubuntu/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.173`
-------------------------------------------
ubuntu@openstack:~$ microstack launch cirros \
--name cirros-2 \
--availability-zone nova:nova1
Launching server ...
Allocating floating ip ...
Server cirros-1 launched! (status is BUILD)
Access it with `
ssh -i /home/ubuntu/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.118`
-------------------------------------------
ubuntu@openstack:~$ microstack launch cirros \
--name cirros-3 \
--availability-zone nova:nova2
Launching server ...
Allocating floating ip ...
Server cirros-1 launched! (status is BUILD)
Access it with `
ssh -i /home/ubuntu/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.32`
You can also visit the OpenStack dashboard at
http://10.20.20.1:80

Installer le client standard openstack

ubuntu@openstack:~$ sudo apt install python3-pip python3-devubuntu@openstack:~$ sudo pip3 install python-openstackclient

Télécharger le fichier OpenStack RC

Copier le fichier dans $HOME de l’utilisateur, puis charger les variables

ubuntu@openstack:~$ source admin-openrc.sh 
Please enter your OpenStack Password for project admin as user admin: Yourpassword
ubuntu@openstack:~$ openstack hypervisor list
+----+-----------------+-----------------+----------------+-------+
| ID | Hypervisor Host | Hypervisor Type | Host IP | State |
+----+-----------------+-----------------+----------------+-------+
| 1 | openstack | QEMU | 91.121.85.22 | up |
| 2 | nova1 | QEMU | 91.121.184.81 | up |
| 3 | nova2 | QEMU | 91.121.222.119 | up |
+----+-----------------+-----------------+----------------+-------+

Prochain étape :

  • Installer les autres composant d’OpenStack
  • Installer Ceph

--

--

No responses yet