Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| elearning:workbooks:centos:8:avance:l120 [2023/12/08 15:20] – admin | elearning:workbooks:centos:8:avance:l120 [2024/10/01 10:30] (Version actuelle) – created admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| - | Version : **2021.01** | + | Version : **2024.01** |
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| - | ======LCF611 | + | ======LCF612 |
| =====Contenu du Module===== | =====Contenu du Module===== | ||
| - | * **LCF514 | + | * **LCF612 |
| * Contenu du Module | * Contenu du Module | ||
| - | * Support | + | * LAB #1 - Augmentation |
| - | * Rappel | + | * 1.1 - Augmenter la Taille |
| - | * Validation Globale | + | * Augmenter la Taille du Disque |
| - | * Évaluation | + | * Augmenter la Taille de la Partition Système de la VM |
| + | * Augmenter la Taille du Système de Fichiers | ||
| + | * 1.2 - Augmenter la Taille du Disque avec la Commande virsh | ||
| + | * Augmenter la Taille du Disque de la VM | ||
| + | * LAB #2 - Réparation d'un Filesystem Corrompu | ||
| + | * 2.1 - Préparation | ||
| + | * 2.2 - La Commande guestfish | ||
| + | * LAB #3 - Gestion de la VM | ||
| + | * 3.1 La Commande shutdown | ||
| + | * 3.2 La Commande reboot | ||
| + | * 3.3 La Commande suspend | ||
| + | * 3.4 La Commande resume | ||
| + | * 3.5 La Commande dominfo | ||
| + | * 3.6 La Commande autostart | ||
| + | * 3.7 La Commande domuuid | ||
| + | * 3.8 La Commande undefine | ||
| + | * 3.9 La Commande destroy | ||
| + | * LAB #4 - Gestion | ||
| + | * 4.1 - Augmenter les VCPUs et la Mémoire | ||
| + | * 4.2 - Ajouter et Supprimer un Disque Dur | ||
| + | * LAB #5 - Journalisation | ||
| + | * 5.1 - Le Répertoire / | ||
| + | * 5.2 - Le Fichier / | ||
| + | * LAB #6 - Gestion de KVM avec Cockpit | ||
| + | * 6.1 - Installation et Démarrage | ||
| + | * 6.2 - Connexion à l' | ||
| + | * 6.3 - Visualisation | ||
| + | * 6.4 - Démarrage de la VM testvm1 | ||
| + | * 6.5 - Connexion à la VM testvm1 | ||
| + | * LAB #7 - Gestion des Machines Virtuelles avec Cockpit | ||
| + | * 7.1 - Créer un Clone de la VM testvm1 | ||
| + | * 7.2 - Création d'une VM en Mode Graphique à partir d'un ISO | ||
| + | * 7.3 - Création et Suppression d'un Snapshot de la vm testvm2 | ||
| + | * 7.4 - Augmentation des Ressources de la VM testvm2 | ||
| + | * 7.5 - Ajout et Suppression d'un Disque Dur à la VM testvm2 | ||
| + | * LAB #8 - Gestion de KVM avec virt-manager | ||
| + | * 8.1 - Installation | ||
| + | * 8.2 - Connexion à l' | ||
| + | * 8.3 - Démarrage de la VM testvm1 | ||
| + | * 8.4 - Connexion à la VM testvm1 | ||
| + | * 8.5 - Visualisation de la Configuration de la VM testvm1 | ||
| + | * LAB #9 - Gestion des Machines Virtuelles avec virt-manager | ||
| + | * 9.1 - Créer un Clone de la VM testvm1 | ||
| + | * 9.2 - Création d'une VM en Mode Graphique à partir d'un ISO | ||
| + | * 9.3 - Création et Suppression d'un Snapshot de la vm testvm2 | ||
| + | * 9.4 - Augmentation des Ressources de la VM testvm2 | ||
| + | * 9.5 - Ajout et Suppression d'un Disque Dur à la VM testvm2 | ||
| + | * LAB #10 - oVirt | ||
| + | * 10.1 - Procédure d' | ||
| + | * 10.2 - Configuration d' | ||
| + | * 10.3 - Configuration du Stockage | ||
| + | * 10.4 - Création d'un Machine Virtuelle | ||
| + | |||
| + | =====LAB #1 - Augmentation de la Taille du Disque===== | ||
| - | =====Support de Cours===== | + | ====1.1 - Augmenter la Taille du Disque avec la Commande qemu-img==== |
| - | L' | + | ===Augmenter la Taille du Disque |
| - | L' | + | Les images des VMs sont stockées dans le pool **kvm-storagepool** |
| - | | + | < |
| - | * de suivre du travail de chaque participant en termes de temps passé dans chaque module grâce à un reporting détaillé. | + | [root@centos8 ~]# virsh pool-list |
| + | | ||
| + | --------------------------------------- | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| - | L' | + | Consultez le contenu du pool **kvm-storagepool** |
| - | * de télécharger des supports de cours et des LABS au format PDF le dernier jour de la formation, | + | < |
| - | * de refaire les LABS en mode autonome en cas de missions décalées en relation avec le contenu de la formation initiale, | + | [root@centos8 ~]# virsh vol-list kvm-storagepool |
| - | * de rester en contact avec le formateur en cas de problèmes en production liés au contenu du cours, | + | Name Path |
| - | * de consulter les mises à jour du contenu des supports de cours pendant la période de l' | + | -------------------------------------------------------------- |
| - | * d' | + | testvm1-os.qcow2 / |
| + | | ||
| + | </ | ||
| - | =====Rappel du Programme de la Formation===== | + | Consultez ensuite les informations concernant l' |
| - | * **LCF500 | + | < |
| - | * Prérequis | + | [root@centos8 ~]# virsh vol-info / |
| - | * Matériel | + | Name: |
| - | * Logiciels | + | Type: file |
| - | * Internet | + | Capacity: |
| - | * Utilisation de l' | + | Allocation: |
| - | * Programme de la Formation | + | </ |
| - | * Évaluation des Compétences | + | |
| - | * Évaluation des Connaissances en Amont | + | |
| - | * **LCF501 - Gestion des Utilisateurs**. | + | Pour pouvoir redimensionner la taille |
| - | * Présentation | + | |
| - | * / | + | |
| - | * Interrogation des Bases de Données | + | |
| - | * Les Fichiers /etc/group et / | + | |
| - | * Les Fichiers /etc/passwd et / | + | |
| - | * Commandes | + | |
| - | * Groupes | + | |
| - | * groupadd | + | |
| - | * groupdel | + | |
| - | * groupmod | + | |
| - | * newgrp | + | |
| - | * gpasswd | + | |
| - | * Utilisateurs | + | |
| - | * useradd | + | |
| - | * userdel | + | |
| - | * usermod | + | |
| - | * passwd | + | |
| - | * chage | + | |
| - | * Configuration | + | |
| - | * LAB #1 - Gérer les Utilisateurs et les Groupes | + | |
| - | * LAB #2 - Forcer | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | * **LCF502 - Gestion des Paquets**. | + | < |
| - | * LAB #1 - Compiler à partir des sources | + | [root@centos8 ~]# qemu-img resize |
| - | * 1.1 - ./configure | + | Image resized. |
| - | * 1.2 - make | + | </code> |
| - | * 1.3 - make check | + | |
| - | * 1.4 - make install | + | |
| - | * LAB #2 - La commande rpm | + | |
| - | * 2.1 - Configuration | + | |
| - | * 2.2 - Utilisation | + | |
| - | * LAB #3 - La commande dnf | + | |
| - | * 3.1 - Présentation | + | |
| - | * 3.2 - Configuration | + | |
| - | * 3.3 - Dépôts | + | |
| - | * 3.4 - Rechercher des Paquets | + | |
| - | * 3.5 - Obtenir de l' | + | |
| - | * 3.6 - Installer un Paquet | + | |
| - | * 3.7 - Mettre à jour des Paquets | + | |
| - | * 3.8 - Supprimer des Paquets | + | |
| - | * LAB #4 - Les Bibliothèques Partagées | + | |
| - | * 4.1 - Présentation | + | |
| - | * Introduction | + | |
| - | * Stockage | + | |
| - | * ld-linux.so.2 | + | |
| - | * 4.2 - La Commande ldd | + | |
| - | * 4.3 - Le fichier | + | |
| - | * 4.4 - La Commande ldconfig | + | |
| - | * **LCF503 - Gestion des Droits**. | + | Vérifiez ensuite la prise en charge de la modification : |
| - | * Présentation | + | |
| - | * Préparation | + | |
| - | * LAB #1 - Les Droits Unix Simples | + | |
| - | * 1.1 - La Modification des Droits | + | |
| - | * La Commande chmod | + | |
| - | * Mode Symbolique | + | |
| - | * Mode Octal | + | |
| - | * La Commande umask | + | |
| - | * 1.2 - Modifier le propriétaire ou le groupe | + | |
| - | * La Commande chown | + | |
| - | * La Commande chgrp | + | |
| - | * LAB #2 - Les Droits Unix Étendus | + | |
| - | * 2.1 - SUID/SGID bit | + | |
| - | * 2.2 - Inheritance Flag | + | |
| - | * 2.3 - Sticky bit | + | |
| - | * LAB #3 - Les Droits Unix Avancés | + | |
| - | * 3.1 - Les ACL | + | |
| - | * 3.2 - Les Attributs Étendus | + | |
| - | * **LCF504 - Gestion des Disques, des Systèmes de Fichiers et du Swap**. | + | < |
| - | * Périphériques de stockage | + | [root@centos8 ~]# virsh vol-info / |
| - | * Partitions | + | Name: |
| - | * Partitionnement | + | Type: file |
| - | * LAB #1 - Partitionnement de votre Disque avec fdisk | + | Capacity: |
| - | * LAB #2 - Modifier les Drapeaux des Partitions avec fdisk | + | Allocation: |
| - | * Logical Volume Manager (LVM) | + | </ |
| - | * LAB #3 - Volumes Logiques Linéaires | + | |
| - | * Physical Volume (PV) | + | |
| - | * Volume Group (VG) et Physical Extent (PE) | + | |
| - | * Logical Volumes (LV) | + | |
| - | * LAB #4 - Étendre un Volume Logique à Chaud | + | |
| - | * LAB #5 - Snapshots | + | |
| - | * LAB #6 - Suppression des Volumes | + | |
| - | * LAB #7 - Volumes Logiques en Miroir | + | |
| - | * LAB #8 - Modifier les Attributs LVM | + | |
| - | * LAB #9 - Volumes Logiques en Bandes | + | |
| - | * LAB #10 - Gérer les Métadonnées | + | |
| - | * Systèmes de Fichiers Journalisés | + | |
| - | * Présentation | + | |
| - | * Ext3 | + | |
| - | * Gestion d' | + | |
| - | * LAB #11 - Convertir un Système de Fichiers Ext3 en Ext2 | + | |
| - | * LAB #12 - Convertir un Système de Fichiers Ext2 en Ext3 | + | |
| - | * LAB #13 - Placer le Journal sur un autre Partition | + | |
| - | * LAB #14 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3 | + | |
| - | * Ext4 | + | |
| - | * LAB #15 - Créer un Système de Fichiers Ext4 | + | |
| - | * LAB #16 - Ajouter une Étiquette au Système de Fichiers Ext4 | + | |
| - | * LAB #17 - Convertir un Système de Fichiers Ext3 en Ext4 | + | |
| - | * XFS | + | |
| - | * LAB #18 - Créer un Système de Fichiers XFS | + | |
| - | * LAB #19 - Ajouter une Étiquette au Système de Fichiers XFS | + | |
| - | * Autres Systèmes de Fichiers | + | |
| - | * ReiserFS | + | |
| - | * JFS | + | |
| - | * Btrfs | + | |
| - | * Comparaison des Commandes par Système de Fichiers | + | |
| - | * LAB #20 - Créer un Système de Fichiers ISO | + | |
| - | * La Commande mkisofs | + | |
| - | * Systèmes de Fichiers Chiffrés | + | |
| - | * LAB #21 - Créer un Système de Fichiers Chiffré avec LUKS | + | |
| - | * Présentation | + | |
| - | * Mise en Place | + | |
| - | * Ajouter une deuxième Passphrase | + | |
| - | * Supprimer une Passphrase | + | |
| - | * Raid Logiciel | + | |
| - | * LAB #22 - Mise en Place du RAID 5 Logiciel | + | |
| - | * 22.1 - Préparer le disque | + | |
| - | * 22.2 - Créer une Unité RAID | + | |
| - | * 22.3 - Remplacer une Unité Défaillante | + | |
| - | * Le Swap | + | |
| - | * Taille du swap | + | |
| - | * Partitions de swap | + | |
| - | * La Commande swapon | + | |
| - | * La Commande swapoff | + | |
| - | * LAB #23 - Créer un Fichier de Swap | + | |
| - | * **LCF505 - Gestion des Tâches**. | + | ===Augmenter la Taille de la Partition Système de la VM=== |
| - | * LAB #1 - cron | + | |
| - | * 1.1 - Le Fichier / | + | |
| - | * 1.2 - Les Champs Temporels | + | |
| - | * 1.3 - Les crontabs Utilisateurs | + | |
| - | * LAB #2 - anacron | + | |
| - | * 2.1 - Le Fichier / | + | |
| - | * 2.2 - Les Champs Temporels | + | |
| - | * 2.3 - Le Fichier / | + | |
| - | * LAB #3 - at | + | |
| - | * 3.1 - Le Répertoire / | + | |
| - | * **LCF506 - Gestion de l' | + | Démarrez |
| - | | + | |
| - | * Sauvegarde complète | + | |
| - | * Sauvegarde différentielle | + | |
| - | * Sauvegarde incrémentale | + | |
| - | * Sauvegarde décrémentale | + | |
| - | * Outils Classiques de Sauvegarde | + | |
| - | * Préparation | + | |
| - | * La Commande tar | + | |
| - | * Présentation | + | |
| - | * LAB #1 - Travailler avec la Commande tar | + | |
| - | * La Commande GPL tar et la Compression | + | |
| - | * La Commande cpio | + | |
| - | * Présentation | + | |
| - | * LAB #2 - Travailler avec la Commande cpio | + | |
| - | * La Commande dd | + | |
| - | * Présentation | + | |
| - | * LAB #3 - Travailler avec la Commande dd | + | |
| - | * Les Commandes dump et restore | + | |
| - | * Présentation | + | |
| - | * Outils Avancés de Sauvegarde | + | |
| - | * Outils de Sauvegarde Unidirectionnelle | + | |
| - | * Outils de Sauvegarde Multidirectionnelle | + | |
| - | * Outils de Sauvegarde des Partitions | + | |
| - | * LAB #4 - Que Sauvegarder en Priorité ? | + | |
| - | * Sauvegarde de la Liste des Paquets | + | |
| - | * Sauvegarde d'un Mémo sur la Structure du Disque Dur Système | + | |
| - | * Sauvegarde d'un Mémo sur les Points de Montage du Disque Dur Système | + | |
| - | * Sauvegarde du Chargeur de Démarrage | + | |
| - | * GRUB Legacy | + | |
| - | * GRUB 2 avec BIOS | + | |
| - | * GRUB 2 avec EFI | + | |
| - | * Sauvegarde des Dossiers Utilisateurs | + | |
| - | * La Commande Rsync | + | |
| - | * Présentation | + | |
| - | * LAB #5 - Travailler avec la Commande rsync | + | |
| - | * Compression | + | |
| - | * La Commande gzip | + | |
| - | * Présentation | + | |
| - | * LAB #6 - Travaller avec la Commande gzip | + | |
| - | * La Commande bzip2 | + | |
| - | * Présentation | + | |
| - | * LAB #7 - Travailler avec la Commande bzip2 | + | |
| - | * La Commande xz | + | |
| - | * Présentation | + | |
| - | * LAB #8 - Travailler avec la Commande xz | + | |
| - | | + | |
| - | * **LCF507 - Gestion des Processus**. | + | < |
| - | * Présentation | + | [root@centos8 ~]# virsh start testvm1 |
| - | * Les Types de Processus | + | </ |
| - | * LAB #1 - Les Commandes relatives aux Processus | + | |
| - | * 1.1 - La Commande ps | + | |
| - | * 1.2 - La Commande pgrep | + | |
| - | * 1.3 - La Commande pstree | + | |
| - | * 1.4 - La Commande top | + | |
| - | * 1.5 - Les Commandes fg, bg et jobs | + | |
| - | * 1.6 - La Commande wait | + | |
| - | * 1.7 - La Commande nice | + | |
| - | * 1.8 - La Commande renice | + | |
| - | * 1.9 - La Commande nohup | + | |
| - | * 1.10 - La Commande kill | + | |
| - | * 1.11 - La Commande pkill | + | |
| - | * **LCF508 | + | Connectez-vous à la VM grâce à la commande |
| - | * Présentation | + | |
| - | * La Commande dmesg | + | |
| - | * LAB #1 - Surveillance Sécuritaire | + | |
| - | * 1.1 - La Commande last | + | |
| - | * 1.2 - La Commande lastlog | + | |
| - | * 1.3 - La Commande lastb | + | |
| - | * 1.4 - Le Fichier / | + | |
| - | * 1.5 - Gestion des évènements audit | + | |
| - | * Le fichier / | + | |
| - | * auditd | + | |
| - | * auditctl | + | |
| - | * audispd | + | |
| - | * La consultation des événements audit | + | |
| - | * La Commande aureport | + | |
| - | * La Commande ausearch | + | |
| - | * Le fichier / | + | |
| - | * Applications | + | |
| - | * LAB #2 - rsyslog | + | |
| - | * 2.1 - Priorités | + | |
| - | * 2.2 - Sous-systèmes applicatifs | + | |
| - | * 2.3 - / | + | |
| - | * Modules | + | |
| - | * Directives Globales | + | |
| - | * Règles | + | |
| - | * Sous-système applicatif.Priorité | + | |
| - | * Sous-système applicatif!Priorité | + | |
| - | * Sous-système applicatif=Priorité | + | |
| - | * L' | + | |
| - | * n Sous-systèmes avec la même priorité | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | * 5.1 - Consultation des Journaux | + | |
| - | * 5.2 - Consultation des Journaux d'une Application Spécifique | + | |
| - | * 5.3 - Consultation des Journaux depuis le Dernier Démarrage | + | |
| - | * 5.4 - Consultation des Journaux d'une Priorité Spécifique | + | |
| - | * 5.5 - Consultation des Journaux d'une Plage de Dates ou d' | + | |
| - | * 5.6 - Consultation des Journaux en Live | + | |
| - | * 5.7 - Consultation des Journaux avec des Mots Clefs | + | |
| - | * **LCF509 - Gestion des Impressions** | + | < |
| - | * Présentation de Cups | + | [root@centos8 ~]# virsh console testvm1 |
| - | * Protocoles | + | Connected to domain testvm1 |
| - | * Paquets | + | Escape character is ^] |
| - | * Daemon | + | [Return] |
| - | * Le fichier / | + | CentOS Linux 8 |
| - | * Filtres | + | Kernel |
| - | * Backends | + | |
| - | * Journaux | + | |
| - | * Imprimantes | + | |
| - | * LAB #1 - Administration de Cups | + | |
| - | * 1.1 - La Commande lpstat | + | |
| - | * 1.2 - La Commande lpadmin | + | |
| - | * 1.3 - Les Commandes accept et cupsenable | + | |
| - | * 1.4 - Classe d' | + | |
| - | * 1.5 - Le fichier / | + | |
| - | * 1.6 - Le fichier / | + | |
| - | * 1.7 - La Commande cancel | + | |
| - | * 1.8 - La Commande lpmove | + | |
| - | * 1.9 - L' | + | |
| - | * **LCF510 - Gestion du Démarrage et de l' | + | testvm1 login: root |
| - | * Présentation | + | Mot de passe : fenestros |
| - | * BIOS, EFI et OpenFirmware | + | Dernière connexion : |
| - | * Systèmes à base du BIOS | + | </code> |
| - | * Charger | + | |
| - | * Systèmes à base de l'EFI | + | |
| - | * Autres Systèmes | + | |
| - | * Gestionnaire d' | + | |
| - | * GRUB 2 | + | |
| - | * Le fichier | + | |
| - | * Le fichier / | + | |
| - | * Les fichiers du répertoire / | + | |
| - | * Configurer l' | + | |
| - | * Modifier la Configuration de GRUB 2 en Ligne de Commande | + | |
| - | * Chargeurs de Démarrages Alternatifs | + | |
| - | * Systemd-boot | + | |
| - | * U-boot | + | |
| - | * Le Projet Syslinux | + | |
| - | * SYSLINUX | + | |
| - | * EXTLINUX | + | |
| - | * ISOLINUX | + | |
| - | * PXELINUX | + | |
| - | * Isodhpfx | + | |
| - | * Initramfs | + | |
| - | * Examiner l' | + | |
| - | * Le script init | + | |
| - | * Consulter le contenu d'un fichier dans initramfs | + | |
| - | * Processus de Démarrage du Noyau Linux | + | |
| - | * Processus Init | + | |
| - | * Systemd | + | |
| - | * LAB #1 - La Commande systemctl | + | |
| - | * LAB #2 - Fichiers de Configuration | + | |
| - | * 2.1 - Fichiers de Configuration par Défaut | + | |
| - | * 2.2 - Surchargement des Fichiers de Configuration par Défaut | + | |
| - | * LAB #3 - La Commande systemd-analyze | + | |
| - | * LAB #4 - Les Cibles Systemd | + | |
| - | * 4.1 - Contrôler les dépendances d'une Cible | + | |
| - | * 4.2 - La Cible par Défaut | + | |
| - | * LAB #5 - Gestion des Services | + | |
| - | * 5.1 - Gestion des Instances Uniques | + | |
| - | * 5.2 - Gestion d' | + | |
| - | * 5.3 - Interdire la Modification du Statut d'un Service | + | |
| - | * Arrêt Système du Système | + | |
| - | * La Commande shutdown | + | |
| - | * La Commande reboot | + | |
| - | * La Commande halt | + | |
| - | * La Commande poweroff | + | |
| - | * **LCF511 - Gestion des Paramètres et les Ressources du Matériel**. | + | Constatez la taille |
| - | * Présentation des Fichiers Spéciaux | + | |
| - | * LAB #1 - Commandes | + | |
| - | * 1.1 - La Commande lspci | + | |
| - | * 1.2 - La Commande lsusb | + | |
| - | * 1.3 - La Commande dmidecode | + | |
| - | * LAB #2 - La Commande sysctl | + | |
| - | * 2.1 - Répertoire /proc | + | |
| - | * Fichiers | + | |
| - | * Processeur | + | |
| - | * Interruptions système | + | |
| - | * Canaux DMA | + | |
| - | * Plages d' | + | |
| - | * Périphériques | + | |
| - | * Modules | + | |
| - | * Statistiques de l' | + | |
| - | * Partitions | + | |
| - | * Espaces de pagination | + | |
| - | * Statistiques d' | + | |
| - | * Statistiques d' | + | |
| - | | + | |
| - | | + | |
| - | * ide/scsi | + | |
| - | * acpi | + | |
| - | * bus | + | |
| - | * net | + | |
| - | * sys | + | |
| - | * 2.2 - Utilisation de la Commande sysctl | + | |
| - | * LAB #3 - Interprétation des informations dans /proc | + | |
| - | | + | |
| - | * 3.2 - uptime ou w | + | |
| - | * 3.3 - iostat | + | |
| - | * 3.4 - hdparm | + | |
| - | * 3.5 - vmstat | + | |
| - | * 3.6 - mpstat | + | |
| - | * 3.7 - sar | + | |
| - | * Modules usb | + | |
| - | * udev | + | |
| - | * La Commande udevadm | + | |
| - | * Système de fichiers /sys | + | |
| - | * LAB #4 - Limiter les Ressources | + | |
| - | * 4.1 - ulimit | + | |
| - | * 4.2 - Groupes de Contrôle | + | |
| - | * La Limitation de la Mémoire | + | |
| - | * La Commande cgcreate | + | |
| - | * La Commande cgdelete | + | |
| - | * Le Fichier / | + | |
| - | | + | |
| - | | + | < |
| - | | + | [root@testvm1 ~]# lsblk |
| - | * LAB #1 - Modules | + | NAME |
| - | | + | sr0 |
| - | * 2.1 - Déplacer | + | vda 253:0 0 7G 0 disk |
| - | | + | ├─vda1 253:1 |
| - | * 2.3 - Préparer l' | + | ├─vda2 253:2 |
| - | * Le Fichier .config | + | └─vda3 253:3 |
| - | * Le Fichier Makefile | + | </ |
| - | * 2.4 - Paramétrage du noyau | + | |
| - | * 2.5 - Compiler le Noyau | + | |
| - | * 2.6 - Installer le Nouveau Noyau | + | |
| - | * LAB #3 - Gestion des Quotas | + | |
| - | * 3.1 - La Commande quotacheck | + | |
| - | * 3.2 - La Commande edquota | + | |
| - | * 3.3 - La Commande quotaon | + | |
| - | * 3.4 - La Commande repquota | + | |
| - | * 3.5 - La Commande quota | + | |
| - | * 3.6 - La Commande warnquota | + | |
| - | | + | <WRAP center round important> |
| - | | + | **Important** : Notez que, pour le système d' |
| - | * La Commande nmcli | + | </ |
| - | | + | |
| - | * 1.1 - Connections | + | Constatez ensuite l' |
| - | * 1.2 - Résolution des Noms | + | |
| - | * 1.3 - Ajouter | + | [< |
| - | * 1.4 - La Commande hostname | + | [root@testvm1 ~]# df -h |
| - | * 1.5 - La Commande ip | + | Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur |
| - | | + | devtmpfs |
| - | | + | tmpfs 909M |
| - | * La commande | + | tmpfs 909M 8,5M 901M 1% /run |
| - | | + | tmpfs 909M |
| - | | + | / |
| - | | + | / |
| - | | + | tmpfs 182M |
| - | | + | </ |
| - | * LAB #3 - Connexions à Distance | + | |
| - | * 3.1 - Telnet | + | La partition |
| - | * 3.2 - wget | + | |
| - | * 3.3 - ftp | + | < |
| - | | + | root@testvm1 ~]# dnf -y install cloud-utils-growpart gdisk |
| - | | + | </ |
| - | * SSH-1 | + | |
| - | * SSH-2 | + | Le paquet |
| - | * Authentification par mot de passe | + | |
| - | * Authentification | + | * le nom du fichier spécial |
| - | * Configuration du Serveur | + | * le numéro de la partition à augmenter en taille - **3**. |
| - | * Configuration du Client | + | |
| - | * Tunnels SSH | + | < |
| - | * 3.5 - SCP | + | [root@testvm1 ~]# growpart / |
| - | * Présentation | + | / |
| - | * Utilisation | + | </ |
| - | * 3.6 - Mise en Place des Clefs Asymétriques | + | |
| + | <WRAP center round important> | ||
| + | **Important** : Notez que cette commande retourne | ||
| + | </ | ||
| + | |||
| + | Pour palier à ce problème, il convient simplement d' | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# echo $LANG | ||
| + | fr_FR.UTF-8 | ||
| + | [root@testvm1 ~]# unset LANG | ||
| + | [root@testvm1 ~]# echo $LANG | ||
| + | </ | ||
| + | |||
| + | En exécutant de nouveau la commande | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# growpart /dev/vda 3 | ||
| + | CHANGED: partition=3 start=3147776 old: size=7337984 end=10485760 new: size=11532255 end=14680031 | ||
| + | </ | ||
| + | |||
| + | L' | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# lsblk | ||
| + | NAME | ||
| + | sr0 | ||
| + | vda 253:0 0 7G 0 disk | ||
| + | |-vda1 253:1 0 1G 0 part /boot | ||
| + | |-vda2 253:2 0 512M 0 part [SWAP] | ||
| + | `-vda3 253:3 0 5.5G 0 part / | ||
| + | </ | ||
| + | |||
| + | <WRAP center round important> | ||
| + | **Important** : Notez que, pour le système d' | ||
| + | </ | ||
| + | |||
| + | Par contre, l' | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# df -TH | ||
| + | Filesystem | ||
| + | devtmpfs | ||
| + | tmpfs tmpfs | ||
| + | tmpfs tmpfs | ||
| + | tmpfs tmpfs | ||
| + | / | ||
| + | / | ||
| + | tmpfs tmpfs | ||
| + | </ | ||
| + | |||
| + | ===Augmenter la Taille du Système de Fichiers=== | ||
| + | |||
| + | Pour augmenter la taille du système de fichiers se trouvant sur **/ | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# xfs_growfs | ||
| + | meta-data=/ | ||
| + | | ||
| + | | ||
| + | | ||
| + | data | ||
| + | | ||
| + | naming | ||
| + | log =internal log | ||
| + | | ||
| + | realtime =none | ||
| + | data blocks changed from 917248 to 1441531 | ||
| + | </ | ||
| + | |||
| + | Cette fois-ci la sortie de la commande **df** démontre bien l' | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# df -TH | ||
| + | Filesystem | ||
| + | devtmpfs | ||
| + | tmpfs tmpfs | ||
| + | tmpfs tmpfs | ||
| + | tmpfs tmpfs | ||
| + | / | ||
| + | / | ||
| + | tmpfs tmpfs | ||
| + | [root@testvm1 ~]# [ALT GR]+[CTRL]+[)] | ||
| + | [root@centos8 ~]# | ||
| + | </ | ||
| + | |||
| + | ====1.2 - Augmenter la Taille du Disque avec la Commande virsh==== | ||
| + | |||
| + | ===Augmenter la Taille du Disque de la VM=== | ||
| + | |||
| + | La VM **testvm2** est en cours d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh list --all | ||
| + | Id | ||
| + | ------------------------- | ||
| + | 5 testvm2 | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Utilisez la commande | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh domblklist testvm2 | ||
| + | | ||
| + | ------------------------------------------------- | ||
| + | vda / | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Cette fois, utilisez la commande | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh blockresize --domain testvm2 --path / | ||
| + | Block device '/ | ||
| + | </ | ||
| + | |||
| + | <WRAP center round important> | ||
| + | **Important** : Notez que la commande **qemu-img resize** nécessite la spécification de l' | ||
| + | </ | ||
| + | |||
| + | Vérifiez ensuite la prise en charge de la modification : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh vol-info / | ||
| + | Name: | ||
| + | Type: | ||
| + | Capacity: | ||
| + | Allocation: | ||
| + | </ | ||
| + | |||
| + | Connectez-vous à la VM grâce à la commande | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh console testvm2 | ||
| + | Connected to domain testvm2 | ||
| + | Escape character is ^] | ||
| + | </ | ||
| + | |||
| + | Ré-exécutez les mêmes commandes que la dernière fois : | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# dnf -y install cloud-utils-growpart gdisk | ||
| + | ... | ||
| + | |||
| + | [root@testvm1 ~]# unset LANG | ||
| + | |||
| + | [root@testvm1 ~]# growpart / | ||
| + | CHANGED: partition=3 start=3147776 old: size=7337984 end=10485760 new: size=11532255 end=14680031 | ||
| + | |||
| + | [root@testvm1 ~]# lsblk | ||
| + | NAME | ||
| + | sr0 | ||
| + | vda 253:0 0 7G 0 disk | ||
| + | |-vda1 253:1 0 1G 0 part /boot | ||
| + | |-vda2 253:2 0 512M 0 part [SWAP] | ||
| + | `-vda3 253:3 | ||
| + | |||
| + | [root@testvm1 ~]# xfs_growfs / | ||
| + | meta-data=/ | ||
| + | = | ||
| + | | ||
| + | = | ||
| + | data | ||
| + | | ||
| + | naming | ||
| + | log =internal log | ||
| + | | ||
| + | realtime =none | ||
| + | data blocks changed from 917248 to 1441531 | ||
| + | |||
| + | [root@testvm1 ~]# df -TH | ||
| + | Filesystem | ||
| + | devtmpfs | ||
| + | tmpfs tmpfs | ||
| + | tmpfs tmpfs | ||
| + | tmpfs tmpfs | ||
| + | / | ||
| + | / | ||
| + | tmpfs tmpfs | ||
| + | [root@testvm1 ~]# [ALT GR]+[CTRL]+[)] | ||
| + | [root@centos8 ~]# | ||
| + | </ | ||
| + | |||
| + | =====LAB #2 - Réparation d'un Filesystem Corrompu===== | ||
| + | |||
| + | En cas de défaillance de la procédure d' | ||
| + | |||
| + | ====2.1 - Préparation==== | ||
| + | |||
| + | La réparation est effectuée grâce à l' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf install -y libguestfs-tools | ||
| + | Last metadata expiration check: 2:14:42 ago on Sat 04 Sep 2021 02:21:59 EDT. | ||
| + | Package libguestfs-tools-1: | ||
| + | Dependencies resolved. | ||
| + | Nothing to do. | ||
| + | Complete! | ||
| + | </ | ||
| + | |||
| + | Arrêtez la VM testvm1 : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh shutdown testvm1 | ||
| + | Domain testvm1 is being shutdown | ||
| + | </ | ||
| + | |||
| + | ====2.2 - La Commande guestfish==== | ||
| + | |||
| + | Commencez par fixer la valeur de la variable LIBGUESTFS_BACKEND à **direct** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# export LIBGUESTFS_BACKEND=direct | ||
| + | </ | ||
| + | |||
| + | Ajoutez l' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# guestfish -a / | ||
| + | |||
| + | Welcome to guestfish, the guest filesystem shell for | ||
| + | editing virtual machine filesystems and disk images. | ||
| + | |||
| + | Type: ‘help’ for help on commands | ||
| + | ‘man’ to read the manual | ||
| + | ‘quit’ to quit the shell | ||
| + | |||
| + | >< | ||
| + | </ | ||
| + | |||
| + | Initialisez **guestfish** avec la commande **run** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# guestfish -a / | ||
| + | |||
| + | Welcome to guestfish, the guest filesystem shell for | ||
| + | editing virtual machine filesystems and disk images. | ||
| + | |||
| + | Type: ‘help’ for help on commands | ||
| + | | ||
| + | ‘quit’ to quit the shell | ||
| + | |||
| + | >< | ||
| + | </ | ||
| + | |||
| + | Listez ensuite les systèmes de fichiers de la VM : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# guestfish -a / | ||
| + | |||
| + | Welcome to guestfish, the guest filesystem shell for | ||
| + | editing virtual machine filesystems and disk images. | ||
| + | |||
| + | Type: ‘help’ for help on commands | ||
| + | ‘man’ to read the manual | ||
| + | ‘quit’ to quit the shell | ||
| + | |||
| + | >< | ||
| + | >< | ||
| + | /dev/sda1: ext4 | ||
| + | /dev/sda2: swap | ||
| + | /dev/sda3: xfs | ||
| + | </ | ||
| + | |||
| + | Procédez ensuite à la réparation des systèmes de fichiers avec la commande | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# guestfish -a / | ||
| + | |||
| + | Welcome to guestfish, the guest filesystem shell for | ||
| + | editing virtual machine filesystems and disk images. | ||
| + | |||
| + | Type: ‘help’ for help on commands | ||
| + | ‘man’ to read the manual | ||
| + | ‘quit’ to quit the shell | ||
| + | |||
| + | >< | ||
| + | >< | ||
| + | lisf-filesystems: | ||
| + | >< | ||
| + | /dev/sda1: ext4 | ||
| + | /dev/sda2: swap | ||
| + | /dev/sda3: xfs | ||
| + | >< | ||
| + | 0 | ||
| + | >< | ||
| + | 0 | ||
| + | </ | ||
| + | |||
| + | <WRAP center round important> | ||
| + | **Important** : Notez que le code retour de **0** indique qu' | ||
| + | </ | ||
| + | |||
| + | Quittez | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# guestfish -a / | ||
| + | |||
| + | Welcome to guestfish, the guest filesystem shell for | ||
| + | editing virtual machine filesystems and disk images. | ||
| + | |||
| + | Type: ‘help’ for help on commands | ||
| + | | ||
| + | ‘quit’ to quit the shell | ||
| + | |||
| + | >< | ||
| + | >< | ||
| + | lisf-filesystems: | ||
| + | >< | ||
| + | /dev/sda1: ext4 | ||
| + | /dev/sda2: swap | ||
| + | /dev/sda3: xfs | ||
| + | >< | ||
| + | 0 | ||
| + | >< | ||
| + | 0 | ||
| + | >< | ||
| + | </ | ||
| + | |||
| + | Après la réparation du système de fichiers, démarrez le VM **testvm1** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh start testvm1 | ||
| + | Domain testvm1 started | ||
| + | |||
| + | [root@centos8 ~]# | ||
| + | </ | ||
| + | |||
| + | =====LAB #3 - Gestion de la VM===== | ||
| + | |||
| + | ====3.1 La Commande shutdown==== | ||
| + | |||
| + | Comme il a déjà été expliqué, pour arrêter une VM, il convient d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh shutdown testvm1 | ||
| + | Domain testvm1 is being shutdown | ||
| + | |||
| + | [root@centos8 ~]# virsh list | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | |||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | -------------------------- | ||
| + | | ||
| + | | ||
| + | </ | ||
| - | * **LCF514 | + | ====3.2 La Commande reboot==== |
| - | * Contenu | + | |
| - | * Rappel | + | La commande **virsh reboot** permet de re-démarrer une VM : |
| - | * Jour #1 | + | |
| - | * Jour #2 | + | < |
| - | * Jour #3 | + | [root@centos8 ~]# virsh reboot 5 |
| - | * Jour #4 | + | Domain 5 is being rebooted |
| - | * Validation Globale | + | |
| - | * Évaluation | + | [root@centos8 ~]# virsh list --all |
| + | | ||
| + | -------------------------- | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ====3.3 La Commande suspend==== | ||
| + | |||
| + | La commande | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh suspend testvm1 | ||
| + | error: Failed to suspend domain testvm1 | ||
| + | error: Requested operation is not valid: domain is not running | ||
| + | |||
| + | [root@centos8 ~]# virsh start testvm1 | ||
| + | Domain testvm1 started | ||
| + | |||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | | ||
| + | |||
| + | [root@centos8 ~]# virsh suspend testvm1 | ||
| + | Domain testvm1 suspended | ||
| + | |||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ====3.4 La Commande resume==== | ||
| + | |||
| + | La commande **virsh resume** permet d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh resume testvm1 | ||
| + | Domain testvm1 resumed | ||
| + | |||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ====3.5 La Commande dominfo==== | ||
| + | |||
| + | La commande | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh dominfo 11 | ||
| + | Id: 11 | ||
| + | Name: | ||
| + | UUID: | ||
| + | OS Type: hvm | ||
| + | State: | ||
| + | CPU(s): | ||
| + | CPU time: | ||
| + | Max memory: | ||
| + | Used memory: | ||
| + | Persistent: | ||
| + | Autostart: | ||
| + | Managed save: no | ||
| + | Security model: selinux | ||
| + | Security DOI: 0 | ||
| + | Security label: system_u: | ||
| + | </ | ||
| + | |||
| + | ====3.6 La Commande autostart==== | ||
| + | |||
| + | La commande **virsh autostart** permet de configurer la VM de façon à ce que celle-ci démarre automatiquement : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh autostart d436a2df-78b0-474c-833b-3f7af8681052 | ||
| + | Domain d436a2df-78b0-474c-833b-3f7af8681052 marked as autostarted | ||
| + | |||
| + | [root@centos8 ~]# virsh dominfo 11 | ||
| + | Id: 11 | ||
| + | Name: | ||
| + | UUID: | ||
| + | OS Type: hvm | ||
| + | State: | ||
| + | CPU(s): | ||
| + | CPU time: | ||
| + | Max memory: | ||
| + | Used memory: | ||
| + | Persistent: | ||
| + | Autostart: | ||
| + | Managed save: no | ||
| + | Security model: selinux | ||
| + | Security DOI: 0 | ||
| + | Security label: system_u: | ||
| + | </ | ||
| + | |||
| + | Pour annuler l' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh autostart --disable 11 | ||
| + | Domain 11 unmarked as autostarted | ||
| + | |||
| + | [root@centos8 ~]# virsh dominfo 11 | ||
| + | Id: 11 | ||
| + | Name: | ||
| + | UUID: | ||
| + | OS Type: hvm | ||
| + | State: | ||
| + | CPU(s): | ||
| + | CPU time: | ||
| + | Max memory: | ||
| + | Used memory: | ||
| + | Persistent: | ||
| + | Autostart: | ||
| + | Managed save: no | ||
| + | Security model: selinux | ||
| + | Security DOI: 0 | ||
| + | Security label: system_u: | ||
| + | </ | ||
| + | |||
| + | ====3.7 La Commande domuuid==== | ||
| + | |||
| + | La commande **virsh domuuid** permet d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh domuuid testvm1 | ||
| + | d436a2df-78b0-474c-833b-3f7af8681052 | ||
| + | </ | ||
| + | |||
| + | ====3.8 La Commande undefine==== | ||
| + | |||
| + | La commande **virsh undefine** permet de supprimer la configuration d'une VM : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh undefine 5 | ||
| + | Domain 5 has been undefined | ||
| + | |||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | **Important** : Notez que si la VM est en cours d' | ||
| + | </ | ||
| + | |||
| + | ====3.9 La Commande destroy==== | ||
| + | |||
| + | La commande **virsh destroy** permet d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | | ||
| + | |||
| + | [root@centos8 ~]# virsh destroy 5 | ||
| + | Domain 5 destroyed | ||
| + | |||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | |||
| + | [root@centos8 ~]# ls -lh / | ||
| + | total 3.9G | ||
| + | -rw-------. 1 qemu qemu 5.1G Sep 4 06:21 testvm1-os.qcow2 | ||
| + | -rw-------. 1 root root 2.2G Sep 4 06:18 testvm2.qcow2 | ||
| + | |||
| + | [root@centos8 ~]# du -sh / | ||
| + | 1.8G / | ||
| + | 2.2G / | ||
| + | </ | ||
| + | |||
| + | =====LAB #4 - Gestion des Ressources===== | ||
| + | |||
| + | ====4.1 - Augmenter les VCPUs et la Mémoire==== | ||
| + | |||
| + | La façon de modifier les ressources d'une VM en ligne de commande est d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | | ||
| + | |||
| + | [root@centos8 ~]# virsh dominfo 11 | ||
| + | Id: 11 | ||
| + | Name: | ||
| + | UUID: | ||
| + | OS Type: hvm | ||
| + | State: | ||
| + | CPU(s): | ||
| + | CPU time: | ||
| + | Max memory: | ||
| + | Used memory: | ||
| + | Persistent: | ||
| + | Autostart: | ||
| + | Managed save: no | ||
| + | Security model: selinux | ||
| + | Security DOI: 0 | ||
| + | Security label: system_u: | ||
| + | </ | ||
| + | |||
| + | Comme détaillé précédemment, | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# cat / | ||
| + | ... | ||
| + | <memory unit=' | ||
| + | < | ||
| + | <vcpu placement=' | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | Pour modifier la configuration, | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh shutdown 11 | ||
| + | Domain 11 is being shutdown | ||
| + | </ | ||
| + | |||
| + | Editez ensuite les valeurs suivantes dans le fichier de configuration en utilisant la commande | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh edit testvm1 | ||
| + | ... | ||
| + | <memory unit=' | ||
| + | <vcpu placement=' | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | Lors de votre sauvegarde du fichier, le système vous indiquera que le fichier a été modifié : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh edit testvm1 | ||
| + | Domain testvm1 XML configuration edited. | ||
| + | </ | ||
| + | |||
| + | L' | ||
| + | |||
| + | Consultez la valeur de la mémoire dans le fichier **/ | ||
| + | |||
| + | < | ||
| + | ... | ||
| + | <memory unit=' | ||
| + | < | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | Démarrez maintenant la VM **testvm1** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh start testvm1 | ||
| + | Domain testvm1 started | ||
| + | |||
| + | [root@centos8 ~]# virsh list --all | ||
| + | | ||
| + | ------------------------- | ||
| + | 1 | ||
| + | |||
| + | [root@centos8 ~]# virsh dominfo 1 | ||
| + | Id: 1 | ||
| + | Name: | ||
| + | UUID: | ||
| + | OS Type: hvm | ||
| + | State: | ||
| + | CPU(s): | ||
| + | CPU time: | ||
| + | Max memory: | ||
| + | Used memory: | ||
| + | Persistent: | ||
| + | Autostart: | ||
| + | Managed save: no | ||
| + | Security model: selinux | ||
| + | Security DOI: 0 | ||
| + | Security label: system_u: | ||
| + | </ | ||
| + | |||
| + | Pour accorder à la VM le droit d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh setmem testvm1 4194304 | ||
| + | |||
| + | </ | ||
| + | |||
| + | Vérifiez ensuite la prise en compte de l' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# virsh dominfo 1 | ||
| + | Id: 1 | ||
| + | Name: | ||
| + | UUID: | ||
| + | OS Type: hvm | ||
| + | State: | ||
| + | CPU(s): | ||
| + | CPU time: | ||
| + | Max memory: | ||
| + | Used memory: | ||
| + | Persistent: | ||
| + | Autostart: | ||
| + | Managed save: no | ||
| + | Security model: selinux | ||
| + | Security DOI: 0 | ||
| + | Security label: system_u: | ||
| + | </ | ||
| + | |||
| + | ====4.2 - Ajouter et Supprimer un Disque Dur==== | ||
| + | |||
| + | Pour ajouter un disque à une VM, il convient d' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# cd / | ||
| + | </ | ||
| + | |||
| + | Créez un disque d'une taille de 10 Go au format **raw** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 images]# qemu-img create -f raw testvm1-disk2.img 10G | ||
| + | Formatting ' | ||
| + | </ | ||
| + | |||
| + | Attachez ensuite ce disque à la VM **testvm1** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 images]# virsh attach-disk testvm1 --source / | ||
| + | Disk attached successfully | ||
| + | </ | ||
| + | |||
| + | Connectez-vous à la VM avec la commande **virsh console** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 images]# virsh console testvm1 | ||
| + | Connected to domain testvm1 | ||
| + | Escape character is ^] | ||
| + | </ | ||
| + | |||
| + | Contrôlez la présence du disque ajouté : | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# lsblk | ||
| + | NAME | ||
| + | sr0 | ||
| + | vda 253:0 0 7G 0 disk | ||
| + | ├─vda1 253:1 0 1G 0 part /boot | ||
| + | ├─vda2 253:2 0 512M 0 part [SWAP] | ||
| + | └─vda3 253:3 | ||
| + | vdb 253: | ||
| + | </ | ||
| + | |||
| + | Créez une partition sur le disque : | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# fdisk /dev/vdb | ||
| + | |||
| + | Bienvenue dans fdisk (util-linux 2.32.1). | ||
| + | Les modifications resteront en mémoire jusqu' | ||
| + | Soyez prudent avant d' | ||
| + | |||
| + | Le périphérique ne contient pas de table de partitions reconnue. | ||
| + | Création d'une nouvelle étiquette pour disque de type DOS avec identifiant de disque 0xcde64a28. | ||
| + | |||
| + | Commande (m pour l' | ||
| + | Type de partition | ||
| + | | ||
| + | | ||
| + | Sélectionnez (p par défaut) : | ||
| + | |||
| + | Utilisation de la réponse p par défaut. | ||
| + | Numéro de partition (1-4, 1 par défaut) : | ||
| + | Premier secteur (2048-20971519, | ||
| + | Dernier secteur, +secteurs ou +taille{K, | ||
| + | |||
| + | Une nouvelle partition 1 de type « Linux » et de taille 10 GiB a été créée. | ||
| + | |||
| + | Commande (m pour l' | ||
| + | La table de partitions a été altérée. | ||
| + | Appel d' | ||
| + | [ 1518.252446] | ||
| + | Synchronisation des disques. | ||
| + | </ | ||
| + | |||
| + | Créez un système de fichiers de type **ext4** sur la partition : | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# mkfs.ext4 /dev/vdb1 | ||
| + | mke2fs 1.45.6 (20-Mar-2020) | ||
| + | Rejet des blocs de périphérique : | ||
| + | En train de créer un système de fichiers avec 2621184 4k blocs et 655360 i-noeuds. | ||
| + | UUID de système de fichiers=805d3a53-4f8f-43f1-8b2a-bf1c493f33ee | ||
| + | Superblocs de secours stockés sur les blocs : | ||
| + | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 | ||
| + | |||
| + | Allocation des tables de groupe : complété | ||
| + | Écriture des tables d' | ||
| + | Création du journal (16384 blocs) : complété | ||
| + | Écriture des superblocs et de l' | ||
| + | fichiers : complété | ||
| + | </ | ||
| + | |||
| + | Montez le disque et vérifiez que vous pouvez y écrire : | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# mount /dev/vdb1 /mnt | ||
| + | [ 1581.199551] EXT4-fs (vdb1): mounted filesystem with ordered data mode. Opts: (null) | ||
| + | [root@testvm1 ~]# cd /mnt | ||
| + | [root@testvm1 mnt]# touch test | ||
| + | [root@testvm1 mnt]# ls | ||
| + | lost+found | ||
| + | </ | ||
| + | |||
| + | Détachez-vous de la VM : | ||
| + | |||
| + | < | ||
| + | [root@testvm1 ~]# [ALT GR]+[CTRL]+[)] | ||
| + | [root@centos8 images]# | ||
| + | </ | ||
| + | |||
| + | Détachez ensuite le disque **vdb** de la VM : | ||
| + | |||
| + | < | ||
| + | [root@centos8 images]# virsh detach-disk testvm1 vdb | ||
| + | Disk detached successfully | ||
| + | </ | ||
| + | |||
| + | Reconnectez-vous à la VM et exécutez la commande **lsblk**. Notez que celle-ci génère des erreurs dues au fait que le disque n'a pas été démonté avant d' | ||
| + | |||
| + | < | ||
| + | [root@testvm1 mnt]# lsblk | ||
| + | [ 1879.523849] EXT4-fs error (device vdb1): ext4_find_entry: | ||
| + | [ 1879.536586] EXT4-fs error (device vdb1): ext4_find_entry: | ||
| + | [ 1879.550137] EXT4-fs error (device vdb1): ext4_find_entry: | ||
| + | NAME | ||
| + | sr0 | ||
| + | vda 253:0 0 7G 0 disk | ||
| + | ├─vda1 253:1 0 1G 0 part /boot | ||
| + | ├─vda2 253:2 0 512M 0 part [SWAP] | ||
| + | └─vda3 253:3 0 5,5G 0 part / | ||
| + | </ | ||
| + | |||
| + | Démontez donc le disque : | ||
| + | |||
| + | < | ||
| + | [root@testvm1 mnt]# cd .. | ||
| + | [root@testvm1 /]# umount /mnt | ||
| + | [ 1921.363728] Buffer I/O error on dev vdb1, logical block 1081344, lost sync page write | ||
| + | [ 1921.372593] JBD2: Error -5 detected when updating journal superblock for vdb1-8. | ||
| + | [ 1921.381098] Aborting journal on device vdb1-8. | ||
| + | [ 1921.386369] Buffer I/O error on dev vdb1, logical block 1081344, lost sync page write | ||
| + | [ 1921.395319] JBD2: Error -5 detected when updating journal superblock for vdb1-8. | ||
| + | </ | ||
| + | |||
| + | Exécutez de nouveau la commande **lsblk**. Vous verrez qu'il n'y a plus d' | ||
| + | |||
| + | < | ||
| + | [root@testvm1 /]# lsblk | ||
| + | NAME | ||
| + | sr0 | ||
| + | vda 253:0 0 7G 0 disk | ||
| + | ├─vda1 253:1 0 1G 0 part /boot | ||
| + | ├─vda2 253:2 0 512M 0 part [SWAP] | ||
| + | └─vda3 253:3 0 5,5G 0 part / | ||
| + | [root@testvm1 /]# [ALT GR]+[CTRL]+[)] | ||
| + | [root@centos8 images]# | ||
| + | </ | ||
| + | |||
| + | =====LAB #5 - Journalisation===== | ||
| + | |||
| + | ====5.1 - Le Répertoire / | ||
| + | |||
| + | Le répertoire **/ | ||
| + | |||
| + | < | ||
| + | [root@centos8 images]# cd / | ||
| + | [root@centos8 qemu]# ls -l | ||
| + | total 56 | ||
| + | -rw-------. 1 root root 4037 Sep | ||
| + | -rw-------. 1 root root 4005 Sep 4 04:40 guestfs-xt170t6ii8uce35y.log | ||
| + | -rw-------. 1 root root 37531 Sep 4 07:04 testvm1.log | ||
| + | -rw-------. 1 root root 7179 Sep 4 06:18 testvm2.log | ||
| + | |||
| + | [root@centos8 qemu]# more testvm1.log | ||
| + | 2021-09-03 12: | ||
| + | module_el8.4.0+885+5e18b468 (CentOS Buildsys < | ||
| + | :57, ), qemu version: 4.2.0qemu-kvm-4.2.0-48.module_el8.4.0+783+f8734d30, | ||
| + | : 4.18.0-305.7.1.el8.i2tch.x86_64, | ||
| + | LC_ALL=C \ | ||
| + | PATH=/ | ||
| + | HOME=/ | ||
| + | XDG_DATA_HOME=/ | ||
| + | XDG_CACHE_HOME=/ | ||
| + | XDG_CONFIG_HOME=/ | ||
| + | QEMU_AUDIO_DRV=none \ | ||
| + | / | ||
| + | -name guest=testvm1, | ||
| + | -S \ | ||
| + | -object secret, | ||
| + | vm1/ | ||
| + | -machine pc-q35-rhel8.2.0, | ||
| + | -cpu Broadwell-IBRS, | ||
| + | tsc-adjust=on, | ||
| + | =on, | ||
| + | y=on, | ||
| + | -m 3072 \ | ||
| + | -overcommit mem-lock=off \ | ||
| + | --More--(3%) | ||
| + | |||
| + | [root@centos8 qemu]# cat guestfs-7w7bnjy7ro65665z.log | ||
| + | 2021-09-04 08: | ||
| + | LC_ALL=C \ | ||
| + | PATH=/ | ||
| + | HOME=/ | ||
| + | XDG_DATA_HOME=/ | ||
| + | XDG_CACHE_HOME=/ | ||
| + | XDG_CONFIG_HOME=/ | ||
| + | QEMU_AUDIO_DRV=none \ | ||
| + | TMPDIR=/ | ||
| + | / | ||
| + | -name guest=guestfs-7w7bnjy7ro65665z, | ||
| + | -S \ | ||
| + | -object secret, | ||
| + | -machine pc-i440fx-rhel7.6.0, | ||
| + | -cpu host \ | ||
| + | -m 1280 \ | ||
| + | -overcommit mem-lock=off \ | ||
| + | -smp 1, | ||
| + | -uuid e6a0f63c-b33e-4ba0-bf03-9e4b9c9dd6a2 \ | ||
| + | -display none \ | ||
| + | -no-user-config \ | ||
| + | -nodefaults \ | ||
| + | -chardev socket, | ||
| + | -mon chardev=charmonitor, | ||
| + | -rtc base=utc, | ||
| + | -global kvm-pit.lost_tick_policy=delay \ | ||
| + | -no-hpet \ | ||
| + | -no-reboot \ | ||
| + | -no-acpi \ | ||
| + | -boot strict=on \ | ||
| + | -kernel / | ||
| + | -initrd / | ||
| + | -append ' | ||
| + | -device virtio-scsi-pci, | ||
| + | -device virtio-serial-pci, | ||
| + | -blockdev ' | ||
| + | -blockdev ' | ||
| + | -device scsi-hd, | ||
| + | -blockdev ' | ||
| + | -blockdev ' | ||
| + | -blockdev ' | ||
| + | -blockdev ' | ||
| + | -device scsi-hd, | ||
| + | -chardev socket, | ||
| + | -device isa-serial, | ||
| + | -chardev socket, | ||
| + | -device virtserialport, | ||
| + | -object rng-random, | ||
| + | -device virtio-rng-pci, | ||
| + | -sandbox on, | ||
| + | -msg timestamp=on | ||
| + | 2021-09-04 08: | ||
| + | 2021-09-04 08: | ||
| + | 2021-09-04T08: | ||
| + | 2021-09-04 08: | ||
| + | </ | ||
| + | |||
| + | ====5.2 - Le Fichier / | ||
| + | |||
| + | Dans le fichier **/ | ||
| + | |||
| + | < | ||
| + | [root@centos8 qemu]# cat / | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: cpu 0, msr b3801001, primary cpu cloc | ||
| + | k | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: using sched offset of 369654777578829 | ||
| + | 1 cycles | ||
| + | Sep 1 05:47:57 centos8 kernel: clocksource: | ||
| + | | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-guest: stealtime: cpu 0, msr 13bc2c080 | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-guest: PV spinlocks enabled | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: cpu 1, msr b3801041, secondary cpu cl | ||
| + | ock | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-guest: stealtime: cpu 1, msr 13bc6c080 | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: cpu 2, msr b3801081, secondary cpu cl | ||
| + | ock | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-guest: stealtime: cpu 2, msr 13bcac080 | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: cpu 3, msr b38010c1, secondary cpu cl | ||
| + | ock | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-guest: stealtime: cpu 3, msr 13bcec080 | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: cpu 4, msr b3801101, secondary cpu cl | ||
| + | ock | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-guest: stealtime: cpu 4, msr 13bd2c080 | ||
| + | Sep 1 05:47:57 centos8 kernel: kvm-clock: cpu 5, msr b3801141, secondary cpu cl | ||
| + | ock | ||
| + | --More-- | ||
| + | </ | ||
| + | |||
| + | =====LAB #6 - Gestion de KVM avec Cockpit===== | ||
| + | |||
| + | ==== 6.1 - Installation et Démarrage==== | ||
| + | |||
| + | Cockpit est la nouvelle interface de gestion du serveur de RHEL8 / CentOS8. Celui-ci est installé par défaut. Par contre, le module supplémentaire pour gérer des machines virtuelles ne l'est pas. Installez donc le paquet **cockpit-machines** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf install cockpit-machines | ||
| + | Last metadata expiration check: 0:34:02 ago on Thu 09 Sep 2021 01:47:52 EDT. | ||
| + | Dependencies resolved. | ||
| + | ====================================================================================== | ||
| + | | ||
| + | ====================================================================================== | ||
| + | Installing: | ||
| + | | ||
| + | Installing dependencies: | ||
| + | | ||
| + | |||
| + | Transaction Summary | ||
| + | ====================================================================================== | ||
| + | Install | ||
| + | |||
| + | Total download size: 825 k | ||
| + | Installed size: 995 k | ||
| + | Is this ok [y/N]: y | ||
| + | </ | ||
| + | |||
| + | Activez-et démarrez le socket | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# systemctl start --now cockpit.socket | ||
| + | [root@centos8 ~]# systemctl status cockpit.socket | ||
| + | ● cockpit.socket - Cockpit Web Service Socket | ||
| + | | ||
| + | | ||
| + | Docs: man: | ||
| + | | ||
| + | Process: 19235 ExecStartPost=/ | ||
| + | Process: 19227 ExecStartPost=/ | ||
| + | Tasks: 0 (limit: 100949) | ||
| + | | ||
| + | | ||
| + | |||
| + | Sep 09 02:24:42 centos8.ittraining.loc systemd[1]: Starting Cockpit Web Service Socke> | ||
| + | Sep 09 02:24:42 centos8.ittraining.loc systemd[1]: Listening on Cockpit Web Service S> | ||
| + | [q] | ||
| + | </ | ||
| + | |||
| + | Le cas échéant, ajoutez une règle dans le pare-feu afin de pouvoir utiliser **cockpit** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# firewall-cmd --add-service=cockpit --permanent | ||
| + | Warning: ALREADY_ENABLED: | ||
| + | success | ||
| + | </ | ||
| + | |||
| + | ==== 6.2 - Connexion à l' | ||
| + | |||
| + | Ouvrez la connexion **CentOS8_VNC_10.0.2.46** dans l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur le bouton **Advanced** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur le bouton **Accept the Risk and Continue** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Entrez les coordonnées de connexion **root / fenestros** et cliquez sur le bouton **Log in** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | La section **Overview** vous donne des informations sur le système d' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====6.3 - Visualisation de la Configuration de la VM testvm1==== | ||
| + | |||
| + | Cliquez ensuite sur **Virtual Machines** dans la colonne de gauche : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez maintenant sur le lien **3 Storage pools** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Pour consulter les informations concernant le storage pool **kvm-storagepool**, | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez ensuite sur les liens **Virtual machines** > **Networks** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | En cliquant sur le lien **default** vous obtiendrez des informations concernant le pont configuré : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====6.4 - Démarrage de la VM testvm1==== | ||
| + | |||
| + | Cliquez ensuite sur le lien **Virtual machines** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur le lien **testvm1** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur le bouton **Run** pour démarrer la VM : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====6.5 - Connexion à la VM testvm1==== | ||
| + | |||
| + | Descendez la fenêtre et cliquez sur le lien **Console** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | A l'issu du démarrage, connectez-vous à la VM : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | =====LAB #7 - Gestion des Machines Virtuelles avec Cockpit===== | ||
| + | |||
| + | ====7.1 - Création d'un Clone de la VM testvm1==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====7.2 - Création d'une VM en Mode Graphique à partir d'un ISO==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | ====7.3 - Création et Suppression d'un Snapshot de la vm testvm2==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | ====7.4 - Augmentation des Ressources de la VM testvm2==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | ====7.5 - Ajout et Suppression d'un Disque Dur à la VM testvm2==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | <WRAP center round todo 50%> | ||
| + | **A Faire** : Supprimez la machine virtuelle testvm2. Assurez-vous que votre machine virtuelle **testvm1** soit arrêtée. | ||
| + | </ | ||
| + | |||
| + | =====LAB #8 - Gestion de KVM avec virt-manager===== | ||
| + | |||
| + | ==== 8.1 - Installation==== | ||
| + | |||
| + | L' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf provides virt-manager | ||
| + | Last metadata expiration check: 1:14:32 ago on Thu 09 Sep 2021 11:19:54 CEST. | ||
| + | virt-manager-2.2.1-4.el8.noarch : Desktop tool for managing virtual machines via | ||
| + | : libvirt | ||
| + | Repo : appstream | ||
| + | Matched from: | ||
| + | Provide | ||
| + | |||
| + | [root@centos8 ~]# dnf install virt-manager | ||
| + | </ | ||
| + | |||
| + | ====8.2 - Connexion à l' | ||
| + | |||
| + | Exécutez ensuite | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur **testvm1** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====8.3 - Démarrage | ||
| + | |||
| + | Cliquez sur l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====8.4 - Connexion à la VM testvm1==== | ||
| + | |||
| + | A l'issu du démarrage, connectez-vous à la machine virtuelle : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====8.5 - Visualisation de la Configuration de la VM==== | ||
| + | |||
| + | Cliquez sur l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez ensuite sur **CPUs** dans la colonne de gauche pour visualiser les détails des vCPUs de la machine virtuelle : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | =====LAB #9 - Gestion des Machines Virtuelles avec virt-manager===== | ||
| + | |||
| + | ====9.1 - Création d'un Clone de la VM testvm1==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====9.2 - Création d'une VM en Mode Graphique à partir d'un ISO==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | ====9.3 - Création et Suppression d'un Snapshot de la vm testvm2==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | ====9.4 - Augmentation des Ressources de la VM testvm2==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | ====9.5 - Ajout et Suppression d'un Disque Dur à la VM testvm2==== | ||
| + | |||
| + | A l'aide de l' | ||
| + | |||
| + | <WRAP center round todo 50%> | ||
| + | **A Faire** : Supprimez la machine virtuelle testvm2. Assurez-vous que votre machine virtuelle **testvm1** soit arrêtée. | ||
| + | </ | ||
| + | |||
| + | =====LAB #10 - oVirt===== | ||
| + | |||
| + | ====10.1 - Procédure d' | ||
| + | |||
| + | Cette procédure prend 60 minutes. | ||
| + | |||
| + | Connectez-vous à la VM **10.0.2.46** : | ||
| + | |||
| + | < | ||
| + | root@computeXX: | ||
| + | trainee@10.0.2.46' | ||
| + | Activate the web console with: systemctl enable --now cockpit.socket | ||
| + | |||
| + | Last login: Thu Feb 16 14:15:27 2023 from 10.0.2.1 | ||
| + | [trainee@centos8 ~]$ | ||
| + | </ | ||
| + | |||
| + | Devenez root et mettez à jour les paquets installés : | ||
| + | |||
| + | < | ||
| + | [trainee@centos8 ~]$ su - | ||
| + | Password: fenestros | ||
| + | [root@centos8 ~]# dnf update -y | ||
| + | </ | ||
| + | |||
| + | Téléchargez et installez le paquet **ovirt-release44.rpm** afin de configurer le dépôt des paquets : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf -y install https:// | ||
| + | </ | ||
| + | |||
| + | Activez le module **javapackages-tools** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf module -y enable javapackages-tools | ||
| + | CentOS-$stream - Ceph Pacific | ||
| + | CentOS Linux 8 - PowerTools | ||
| + | determining the fastest mirror (13 hosts).. done.674 | ||
| + | Latest oVirt 4.4 Release | ||
| + | Extra Packages for Enterprise Linux 8 2.4 MB/s | 13 MB | ||
| + | CentOS-8 - Gluster 8 60 kB/s | 42 kB | ||
| + | virtio-win builds roughly matching what will be shipped in upcoming RHEL 80 kB/s | 205 kB | ||
| + | Copr repo for EL8_collection owned by sbonazzo | ||
| + | Copr repo for gluster-ansible owned by sac 10 kB/s | 7.3 kB | ||
| + | CentOS-8 - Advanced Virtualization | ||
| + | CentOS-8 - oVirt 4.4 496 kB/s | 1.2 MB | ||
| + | CentOS-8 - OpsTools - collectd | ||
| + | CentOS-8 - OpsTools - collectd - vault 340 kB/s | 149 kB | ||
| + | CentOS-8 - NFV OpenvSwitch | ||
| + | CentOS-8 - OpenStack victoria | ||
| + | Dependencies resolved. | ||
| + | ============================================================================================================================================================================ | ||
| + | | ||
| + | ============================================================================================================================================================================ | ||
| + | Enabling module streams: | ||
| + | | ||
| + | |||
| + | Transaction Summary | ||
| + | ============================================================================================================================================================================ | ||
| + | |||
| + | Complete! | ||
| + | </ | ||
| + | |||
| + | Activez le module **pki-deps** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf module -y enable pki-deps | ||
| + | Last metadata expiration check: 0:02:46 ago on Thu 16 Feb 2023 14:46:17 CET. | ||
| + | Dependencies resolved. | ||
| + | ============================================================================================================================================================================ | ||
| + | | ||
| + | ============================================================================================================================================================================ | ||
| + | Enabling module streams: | ||
| + | | ||
| + | |||
| + | Transaction Summary | ||
| + | ============================================================================================================================================================================ | ||
| + | |||
| + | Complete! | ||
| + | </ | ||
| + | |||
| + | Dernièrement, | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf module -y enable postgresql: | ||
| + | Last metadata expiration check: 0:03:45 ago on Thu 16 Feb 2023 14:46:17 CET. | ||
| + | Dependencies resolved. | ||
| + | ============================================================================================================================================================================ | ||
| + | | ||
| + | ============================================================================================================================================================================ | ||
| + | Enabling module streams: | ||
| + | | ||
| + | |||
| + | Transaction Summary | ||
| + | ============================================================================================================================================================================ | ||
| + | |||
| + | Complete! | ||
| + | </ | ||
| + | |||
| + | Procédez de nouveau à une mise-à-jour des paquets : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf -y update | ||
| + | </ | ||
| + | |||
| + | Installez maintenant les paquets **vim**, **tmux** et **ovirt-engine** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# dnf -y install vim tmux ovirt-engine | ||
| + | </ | ||
| + | |||
| + | Dernièrement, | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# echo " | ||
| + | </ | ||
| + | |||
| + | ====10.2 - Configuration d' | ||
| + | |||
| + | La configuration prend 60 minutes. | ||
| + | |||
| + | Lancez un terminal tmux : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# tmux | ||
| + | </ | ||
| + | |||
| + | Dans le terminal tmux, exécutez la commande **engine-setup** et répondez aux questions en suivant l' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# engine-setup | ||
| + | [ INFO ] Stage: Initializing | ||
| + | [ INFO ] Stage: Environment setup | ||
| + | Configuration files: / | ||
| + | Log file: / | ||
| + | Version: otopi-1.9.6 (otopi-1.9.6-1.el8) | ||
| + | [ INFO ] Stage: Environment packages setup | ||
| + | [ INFO ] Stage: Programs detection | ||
| + | [ INFO ] Stage: Environment setup (late) | ||
| + | [ INFO ] Stage: Environment customization | ||
| + | |||
| + | --== PRODUCT OPTIONS ==-- | ||
| + | |||
| + | Configure Cinderlib integration (Currently in tech preview) (Yes, No) [No]: No | ||
| + | Configure Engine on this host (Yes, No) [Yes]: Yes | ||
| + | |||
| + | Configuring ovirt-provider-ovn also sets the Default cluster' | ||
| + | Non-Default clusters may be configured with an OVN after installation. | ||
| + | Configure ovirt-provider-ovn (Yes, No) [Yes]: Yes | ||
| + | Configure WebSocket Proxy on this host (Yes, No) [Yes]: Yes | ||
| + | |||
| + | * Please note * : Data Warehouse is required for the engine. | ||
| + | If you choose to not configure it on this host, you have to configure | ||
| + | it on a remote host, and then configure the engine on this host so | ||
| + | that it can access the database of the remote Data Warehouse host. | ||
| + | Configure Data Warehouse on this host (Yes, No) [Yes]: Yes | ||
| + | Configure VM Console Proxy on this host (Yes, No) [Yes]: Yes | ||
| + | Configure Grafana on this host (Yes, No) [Yes]: Yes | ||
| + | |||
| + | --== PACKAGES ==-- | ||
| + | |||
| + | [ INFO ] Checking for product updates... | ||
| + | [ INFO ] No product updates found | ||
| + | |||
| + | --== NETWORK CONFIGURATION ==-- | ||
| + | |||
| + | Host fully qualified DNS name of this server [centos8.ittraining.loc]: | ||
| + | [WARNING] Failed to resolve centos8.ittraining.loc using DNS, it can be resolved only locally | ||
| + | |||
| + | Setup can automatically configure the firewall on this system. | ||
| + | Note: automatic configuration of the firewall may overwrite current settings. | ||
| + | Do you want Setup to configure the firewall? (Yes, No) [Yes]: Yes | ||
| + | [ INFO ] firewalld will be configured as firewall manager. | ||
| + | |||
| + | --== DATABASE CONFIGURATION ==-- | ||
| + | |||
| + | Where is the DWH database located? (Local, Remote) [Local]: Local | ||
| + | |||
| + | Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications. | ||
| + | Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: | ||
| + | Where is the Engine database located? (Local, Remote) [Local]: | ||
| + | |||
| + | Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications. | ||
| + | Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: | ||
| + | |||
| + | --== OVIRT ENGINE CONFIGURATION ==-- | ||
| + | |||
| + | Engine admin password: fenestros | ||
| + | Confirm engine admin password: fenestros | ||
| + | [WARNING] Password is weak: The password fails the dictionary check - it is based on a dictionary word | ||
| + | Use weak password? (Yes, No) [No]: Yes | ||
| + | Application mode (Virt, Gluster, Both) [Both]: Both | ||
| + | Use default credentials (admin@internal) for ovirt-provider-ovn (Yes, No) [Yes]: Yes | ||
| + | |||
| + | --== STORAGE CONFIGURATION ==-- | ||
| + | |||
| + | Default SAN wipe after delete (Yes, No) [No]: No | ||
| + | |||
| + | --== PKI CONFIGURATION ==-- | ||
| + | |||
| + | Organization name for certificate [ittraining.loc]: | ||
| + | |||
| + | --== APACHE CONFIGURATION ==-- | ||
| + | |||
| + | Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications. | ||
| + | Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]: Yes | ||
| + | |||
| + | Setup can configure apache to use SSL using a certificate issued from the internal CA. | ||
| + | Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]: | ||
| + | |||
| + | --== SYSTEM CONFIGURATION ==-- | ||
| + | |||
| + | |||
| + | --== MISC CONFIGURATION ==-- | ||
| + | |||
| + | Please choose Data Warehouse sampling scale: | ||
| + | (1) Basic | ||
| + | (2) Full | ||
| + | (1, 2)[1]: 1 | ||
| + | Use Engine admin password as initial Grafana admin password (Yes, No) [Yes]: | ||
| + | |||
| + | --== END OF CONFIGURATION ==-- | ||
| + | |||
| + | [ INFO ] Stage: Setup validation | ||
| + | [WARNING] Less than 16384MB of memory is available | ||
| + | |||
| + | --== CONFIGURATION PREVIEW ==-- | ||
| + | |||
| + | Application mode : both | ||
| + | Default SAN wipe after delete | ||
| + | Host FQDN : centos8.ittraining.loc | ||
| + | Firewall manager | ||
| + | Update Firewall | ||
| + | Set up Cinderlib integration | ||
| + | Configure local Engine database | ||
| + | Set application as default page : True | ||
| + | Configure Apache SSL : True | ||
| + | Engine database host : localhost | ||
| + | Engine database port : 5432 | ||
| + | Engine database secured connection | ||
| + | Engine database host name validation | ||
| + | Engine database name : engine | ||
| + | Engine database user name : engine | ||
| + | Engine installation | ||
| + | PKI organization | ||
| + | Set up ovirt-provider-ovn | ||
| + | Grafana integration | ||
| + | Grafana database user name : ovirt_engine_history_grafana | ||
| + | Configure WebSocket Proxy : True | ||
| + | DWH installation | ||
| + | DWH database host : localhost | ||
| + | DWH database port : 5432 | ||
| + | DWH database secured connection | ||
| + | DWH database host name validation | ||
| + | DWH database name : ovirt_engine_history | ||
| + | Configure local DWH database | ||
| + | Configure VMConsole Proxy : True | ||
| + | |||
| + | Please confirm installation settings (OK, Cancel) [OK]: OK | ||
| + | [ INFO ] Stage: Transaction setup | ||
| + | [ INFO ] Stopping engine service | ||
| + | [ INFO ] Stopping ovirt-fence-kdump-listener service | ||
| + | [ INFO ] Stopping dwh service | ||
| + | [ INFO ] Stopping vmconsole-proxy service | ||
| + | [ INFO ] Stopping websocket-proxy service | ||
| + | [ INFO ] Stage: Misc configuration (early) | ||
| + | [ INFO ] Stage: Package installation | ||
| + | [ INFO ] Stage: Misc configuration | ||
| + | [ INFO ] Upgrading CA | ||
| + | [ INFO ] Initializing PostgreSQL | ||
| + | [ INFO ] Creating PostgreSQL ' | ||
| + | [ INFO ] Configuring PostgreSQL | ||
| + | [ INFO ] Creating PostgreSQL ' | ||
| + | [ INFO ] Configuring PostgreSQL | ||
| + | [ INFO ] Creating CA: / | ||
| + | [ INFO ] Creating CA: / | ||
| + | [ INFO ] Updating OVN SSL configuration | ||
| + | [ INFO ] Updating OVN timeout configuration | ||
| + | [ INFO ] Creating/ | ||
| + | [ INFO ] Setting up ovirt-vmconsole proxy helper PKI artifacts | ||
| + | [ INFO ] Setting up ovirt-vmconsole SSH PKI artifacts | ||
| + | [ INFO ] Configuring WebSocket Proxy | ||
| + | [ INFO ] Creating/ | ||
| + | [ INFO ] Creating a user for Grafana | ||
| + | [ INFO ] Creating/ | ||
| + | [ INFO ] Creating default mac pool range | ||
| + | [ INFO ] Adding default OVN provider to database | ||
| + | [ INFO ] Adding OVN provider secret to database | ||
| + | [ INFO ] Setting a password for internal user admin | ||
| + | [ INFO ] Install selinux module / | ||
| + | [ INFO ] Generating post install configuration file '/ | ||
| + | [ INFO ] Stage: Transaction commit | ||
| + | [ INFO ] Stage: Closing up | ||
| + | [ INFO ] Starting engine service | ||
| + | [ INFO ] Starting dwh service | ||
| + | [ INFO ] Starting Grafana service | ||
| + | [ INFO ] Restarting ovirt-vmconsole proxy service | ||
| + | |||
| + | --== SUMMARY ==-- | ||
| + | |||
| + | [ INFO ] Restarting httpd | ||
| + | Please use the user ' | ||
| + | Web access is enabled at: | ||
| + | http:// | ||
| + | https:// | ||
| + | Internal CA 00: | ||
| + | SSH fingerprint: | ||
| + | [WARNING] Less than 16384MB of memory is available | ||
| + | Web access for grafana is enabled at: | ||
| + | https:// | ||
| + | Please run the following command on the engine machine centos8.ittraining.loc, | ||
| + | systemctl restart ovirt-engine | ||
| + | |||
| + | --== END OF SUMMARY ==-- | ||
| + | |||
| + | [ INFO ] Stage: Clean up | ||
| + | Log file is located at / | ||
| + | [ INFO ] Generating answer file '/ | ||
| + | [ INFO ] Stage: Pre-termination | ||
| + | [ INFO ] Stage: Termination | ||
| + | [ INFO ] Execution of setup completed successfully | ||
| + | </ | ||
| + | |||
| + | Notez les deux URLs : | ||
| + | |||
| + | < | ||
| + | Please use the user ' | ||
| + | Web access is enabled at: | ||
| + | http:// | ||
| + | https:// | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | Web access for grafana is enabled at: | ||
| + | https:// | ||
| + | </ | ||
| + | |||
| + | Re-démarrez le service **ovirt-engine** : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# systemctl restart ovirt-engine | ||
| + | </ | ||
| + | |||
| + | Dans votre Gateway, éditez le fichier /etc/hosts : | ||
| + | |||
| + | < | ||
| + | trainee@gateway: | ||
| + | Password: Fenestr0$ | ||
| + | root@gateway: | ||
| + | root@gateway: | ||
| + | 127.0.0.1 localhost | ||
| + | 10.0.2.40 gateway.ittraining.loc gateway | ||
| + | 10.0.2.46 centos8.ittraining.loc centos8 | ||
| + | 10.0.2.47 windows10.ittraining.loc windows10 | ||
| + | 10.0.2.50 kubemaster.ittraining.loc kubemaster | ||
| + | 10.0.2.51 kubenode01.ittraining.loc kubenode01 | ||
| + | 10.0.2.52 kubenode02.ittraining.loc kubenode02 | ||
| + | 10.0.2.53 ansible.ittraining.loc ansible | ||
| + | 10.0.2.54 targeta.ittraining.loc targeta | ||
| + | 10.0.2.55 targetb.ittraining.loc targetb | ||
| + | 10.0.2.56 manager.ittraining.loc manager | ||
| + | 10.0.2.57 worker01.ittraining.loc worker01 | ||
| + | 10.0.2.58 worker02.ittraining.loc worker02 | ||
| + | 10.0.2.59 puppetmaster.ittraining.loc puppetmaster | ||
| + | 10.0.2.60 puppetslave01.ittraining.loc puppetslave01 | ||
| + | 10.0.2.61 puppetslave02.ittraining.loc puppetslave02 | ||
| + | |||
| + | # The following lines are desirable for IPv6 capable hosts | ||
| + | ::1 | ||
| + | ff02::1 ip6-allnodes | ||
| + | ff02::2 ip6-allrouters | ||
| + | </ | ||
| + | |||
| + | En utilisant le navigateur de votre Gateway, allez à l' | ||
| + | |||
| + | Entrez dans les **Settings** du navigateur web et recherchez la chaine **cert** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez ensuite sur **View Certificates** puis sur **Authorities** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur le bouton **Import** et importez le fichier **pki-resource**. Cochez les deux options et cliquez sur le bouton **OK** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Re-démarrez le navigateur web puis allez à l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur **Not logged in** et ensuite **Log in** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Connectez-vous avec **admin** et **fenestros** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur **Administration Portal** dans **Portals** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Editez le fichier **/ | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# vi / | ||
| + | [root@centos8 ~]# cat / | ||
| + | 127.0.0.1 | ||
| + | ::1 | ||
| + | 10.0.2.46 | ||
| + | </ | ||
| + | |||
| + | Naviguez à **Compute** > **Hosts** et ajoutez **centos8.ittraining.loc** | ||
| + | |||
| + | ====10.3 - Configuration du Stockage==== | ||
| + | |||
| + | Vérifiez que le serveur NFS soit installé : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# systemctl status nfs-server | ||
| + | ● nfs-server.service - NFS server and services | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Vérifiez ensuite la présence du groupe **kvm** et de l' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# getent group kvm | ||
| + | kvm: | ||
| + | [root@centos8 ~]# getent passwd vdsm | ||
| + | vdsm: | ||
| + | </ | ||
| + | |||
| + | Créez les répertoires **/ | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# mkdir -p / | ||
| + | </ | ||
| + | |||
| + | Modifiez le propriétaire et le groupe des répertoires : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# chown -R 36:36 / | ||
| + | [root@centos8 ~]# chown -R 36:36 / | ||
| + | [root@centos8 ~]# chown -R 36:36 / | ||
| + | </ | ||
| + | |||
| + | Modifiez les permissions des répertoires : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# chmod 0755 / | ||
| + | [root@centos8 ~]# chmod 0755 / | ||
| + | [root@centos8 ~]# chmod 0755 / | ||
| + | </ | ||
| + | |||
| + | CRéez ensuite le fichier **/ | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# vi / | ||
| + | [root@centos8 ~]# cat / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Activez et démarrez le serveur NFS : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# systemctl enable --now nfs-server | ||
| + | Created symlink / | ||
| + | </ | ||
| + | |||
| + | Vérifiez l' | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# exportfs -rvv | ||
| + | exporting *:/ | ||
| + | exporting *:/ | ||
| + | exporting *:/ | ||
| + | </ | ||
| + | |||
| + | Ajoutez les règles du pare-feu : | ||
| + | |||
| + | < | ||
| + | [root@centos8 ~]# firewall-cmd --add-service={nfs, | ||
| + | success | ||
| + | [root@centos8 ~]# firewall-cmd --reload | ||
| + | success | ||
| + | [root@centos8 ~]# firewall-cmd --permanent --zone public --add-port 80/tcp | ||
| + | success | ||
| + | [root@centos8 ~]# firewall-cmd --permanent --zone public --add-port 443/tcp | ||
| + | success | ||
| + | [root@centos8 ~]# firewall-cmd --reload | ||
| + | success | ||
| + | </ | ||
| + | |||
| + | Naviguez à **Storage** > **Domains** > **New Domain** et ajoutez **/ | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Ajoutez ensuite les exports NFS **/ | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Patientez jusqu' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ====10.4 - Création d'un Machine Virtuelle==== | ||
| + | |||
| + | Retournez dans votre Gateway et téléchargez une image iso de la distribution Debian : | ||
| + | |||
| + | < | ||
| + | trainee@gateway: | ||
| + | </ | ||
| + | |||
| + | Cliquez ensuite sur **Storage** > **Disks** > **Upload** > **Start** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Choisissez l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Constatez la présence de l'iso dans la liste : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur **Compute** > **Virtual Machines** > **New** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Remplissez le formulaire en suivant l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur le bouton **Create**, remplisez la taille et cliquez sur le bouton **OK** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur le bouton **Show Advanced Options** puis **System** et modifiez **Memory Size** à 2048 MB : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur **Boot Options** et cochez **Attach CD** et cliquez sur le bouton **OK** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur la flèche à droite de **Run** et cliquez sur **Run Once** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Développez **Console** et cochez VNC. Choisissez le clavier **fr** et cliquez sur le bouton **OK** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| - | =====Validation des Acquis===== | ||
| - | Veuillez passer la Validation Globale des Acquis de la formation. Vérifiez ensuite que vous avez validé tous les modules du cours. | ||
| - | =====Évaluation de la Formation===== | ||
| - | Afin de valider votre formation, veuillez compléter l’Évaluation de la Formation. | ||
| ----- | ----- | ||
| - | Copyright © 2022 Hugh Norris. Document non-contractuel. Le programme peut être modifié sans préavis. | + | Copyright © 2024 Hugh Norris |