redhat:virtualization-redhat:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
redhat:virtualization-redhat:start [2017/09/09 17:33] – [Vorbereitungen zu starten des Virt-Managers] michaelredhat:virtualization-redhat:start [2020/04/01 10:59] – [KVM Hypervisor on Red Hat / CentOS 8.x] michael
Line 1: Line 1:
-====== KVM Hypervisor unter Redhat / CentOS ====== +====== KVM Hypervisor on Red Hat / CentOS 8.x ====== 
-**KVM** ist eine Open Source Hardware Virtualisierungslösung, welche dazu gebraucht werden kann; um mehrere Linux basierende oder auch Windows basierende Systeme parallel auf einem Host zu betreiben. KVM ist typischerweise bekannt als sogenannte "**Kernel based Virtual Machine**"Dies ist soweil nach der Installation des Pakages das KVM Module beim nächsten Boot mit dem Kernel geladen wird und so einen //normalen Linux Server// in einen fast Baremetal-Hypervisor verwandeltNun werde ich beschreiben, wie genau so ein [[https://de.wikipedia.org/wiki/Kernel-based_Virtual_Machine|KVM Hypervisor]] aufgesetzt wird und wie man ihn anschliessend verwalten kann.+ 
 +**KVM** is an open source hardware virtualization solution which can be used to run several Linux-based or Windows-based systems in parallel on one host 
 + 
 +KVM is known as a so-called "**Kernel based Virtual Machine**"This is because after installing the packagethe KVM module is loaded with the kernel at the next boot, turning a //normal Linux server// into a bare metal hypervisor 
 + 
 +Now I will describe how to set up such a [[https://de.wikipedia.org/wiki/Kernel-based_Virtual_Machine|KVM Hypervisor]] and how to manage it afterwards. 
 + 
 + 
 +  * [[redhat:virtualization-redhat:kvm-installation-centos7|OLD - KVM Installation on CentOS / Red Hat 7.x]] 
 + 
 + 
 +---- 
 + 
 +<WRAP center round important 100%> 
 +<wrap em>Before we start, verify support for **Virtual Technology** of the CPU by issueing the following command:</wrap>
  
-<wrap em>Bevor mit der Installation des Hypervisors begonnen wird, solle immer zuerst überprüfen; ob die aktuelle Maschine überhaupt eine Virtualisierung unterstützt. Dies wird folgendermassen überprüft:</wrap> 
 <code> <code>
-grep -E '(vmx|svm)' /proc/cpuinfo+lscpu grep Virtualization
 </code> </code>
 +<sxh bash; gutter: false;>
 +Virtualization:      VT-x
 +Virtualization type: full
 +</sxh>
  
-Wenn man nun den Output **vmx** oder **svn** bekommt ist alles in OrdnungWenn nichts kommt kann auf diesem Host nicht Visualisiert werden.+The output of the above command shows that, our server kvm-virtualization-01.recipes.com supports Virtualization.
  
-----+However, if the above command returns no result on your server then,
  
 +  - ''In case of bare-metal machine, you have to enable the VT support from system BIOS.''
 +  - ''In case of virtual machine, you have to enable the VT support from VM's CPU Settings.''
 +</WRAP>
  
-===== Installation KVM ===== + 
-Jetzt kann die Installation von KVM durchgeführt werdenAls erstes werden dafür die benötigten Pakages installiert.+ 
 + 
 +===== Installing KVM ===== 
 + 
 + 
 +In CentOS 8 / RHEL 8, virtualization components including KVM and QEMU hypervisors are bundled in virt moduleTherefore, it is really simple now to configure a KVM virtualization host in CentOS 8. 
 + 
 +<WRAP center box 100%> 
 +We are installing virt module using dnf command.
  
 <code> <code>
- yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils+dnf install -y @virt
 </code> </code>
 +</WRAP>
 +
 +<WRAP center box 100%>
 +We are also installing virt-install package, because it provides some very useful command line tools.
 +
 +<code>
 +# dnf install -y virt-install
 +</code>
 +
 +</WRAP>
 +
 +
 +<WRAP center box 100%>
 +Validate all the components on your KVM host can support virtualization.
 +
 +<code>
 +# virt-host-validate
 +</code>
 +
 +<sxh bash; gutter: false;>
 +  QEMU: Checking for hardware virtualization                                 : PASS
 +  QEMU: Checking if device /dev/kvm exists                                   : PASS
 +  QEMU: Checking if device /dev/kvm is accessible                            : PASS
 +  QEMU: Checking if device /dev/vhost-net exists                             : PASS
 +  QEMU: Checking if device /dev/net/tun exists                               : PASS
 +  QEMU: Checking for cgroup 'memory' controller support                      : PASS
 +  QEMU: Checking for cgroup 'memory' controller mount-point                  : PASS
 +  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
 +  QEMU: Checking for cgroup 'cpu' controller mount-point                     : PASS
 +  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
 +  QEMU: Checking for cgroup 'cpuacct' controller mount-point                 : PASS
 +  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
 +  QEMU: Checking for cgroup 'cpuset' controller mount-point                  : PASS
 +  QEMU: Checking for cgroup 'devices' controller support                     : PASS
 +  QEMU: Checking for cgroup 'devices' controller mount-point                 : PASS
 +  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
 +  QEMU: Checking for cgroup 'blkio' controller mount-point                   : PASS
 +  QEMU: Checking for device assignment IOMMU support                         : PASS
 +  QEMU: Checking if IOMMU is enabled by kernel                               : WARN (IOMMU appears to be disabled in kernel. Add intel_iommu=on to kernel cmdline arguments)
 +
 +</sxh>
 +
 +</WRAP>
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
 Nach erfolgreicher Installation müssen die Services gestartet & aktiviert werden. Nach erfolgreicher Installation müssen die Services gestartet & aktiviert werden.
Line 25: Line 105:
 # systemctl enable libvirtd # systemctl enable libvirtd
 </code> </code>
 +
 +
 +
 +
 +
  
 Nun sollte überprüft werden, ob KVM erfolgreich seine beiden Core-Module laden konnte. Nun sollte überprüft werden, ob KVM erfolgreich seine beiden Core-Module laden konnte.
Line 49: Line 134:
 </WRAP> </WRAP>
  
----- 
  
 ===== Vorbereitungen zu starten des Virt-Managers ===== ===== Vorbereitungen zu starten des Virt-Managers =====
Line 68: Line 152:
 </WRAP> </WRAP>
  
-----+
 ===== Starten des Virt Managers ===== ===== Starten des Virt Managers =====
  
Line 133: Line 217:
 # ip addr show br0 # ip addr show br0
 </code> </code>
 +
  
 ===== Start Creating Virtual Machines. ===== ===== Start Creating Virtual Machines. =====
-Now Create Virtual Machine either from the command line using '**virt-install**' command or from GUI (**virt-manager**)+Create Virtual Machine either from the command line using '**virt-install**' command or from GUI (**virt-manager**)
  
-Now let’s Create a virtual machine of ''**Windows Server 2012 R2**'' using virt-manager.+<WRAP center box 100%> 
 +''**Now let’s Create a virtual machine** of **Windows Server 2012 R2** using virt-manager.''
  
-Start the “virt-manager”+  - Start the “virt-manager” 
 +  - Go to the File Option, click on ''New Virtual Machine'' <WRAP clear/> {{:redhat:virtualization-redhat:virt-manger-2.jpg?nolink|}} 
 +  - We will be using ISO file as installation media. In the next step Specify the path of ISO file.{{:redhat:virtualization-redhat:virt-manger-3.jpg?nolink|}} 
 +  - Click on Forward. And specify the Compute Resources : RAM and CPU as per your setup. {{:redhat:virtualization-redhat:virt-manger-4.jpg?nolink|}} 
 +  - Click on Forward to proceed further. Then specify the storage Size of Virtual Machine, In my case I am using 25G.{{:redhat:virtualization-redhat:virt-manger-5.jpg?nolink|}} 
 +  - In the Next step Specify the Name of Virtual Machine and select network as **Bridge br0**{{:redhat:virtualization-redhat:virt-manger-6.jpg?nolink|}} 
 +  - Click on Finish to start the installation. {{:redhat:virtualization-redhat:virt-manger-7.png?nolink|}}
  
-Go to the File Option, click on ''New Virtual Machine''+''<wrap em>Follow the screen instructions and complete the installation.</wrap>''
  
-{{:redhat:virtualization-redhat:virt-manger-2.jpg?nolink|}} +</WRAP>
- +
-We will be using ISO file as installation media. In the next step Specify the path of ISO file. +
- +
-{{:redhat:virtualization-redhat:virt-manger-3.jpg?nolink|}} +
- +
-Click on Forward. +
- +
-Specify the Compute Resources : RAM and CPU as per your setup. +
- +
-{{:redhat:virtualization-redhat:virt-manger-4.jpg?nolink|}} +
- +
-Click on Forward to proceed further. +
- +
-Specify the storage Size of Virtual Machine, In my case I am using 25G. +
- +
-{{:redhat:virtualization-redhat:virt-manger-5.jpg?nolink|}} +
- +
-In the Next step Specify the Name of Virtual Machine and select network as **Bridge br0** +
- +
-{{:redhat:virtualization-redhat:virt-manger-6.jpg?nolink|}} +
- +
-Click on Finish to start the installation. +
- +
-{{:redhat:virtualization-redhat:virt-manger-7.png?nolink|}} +
- +
-Follow the screen instructions and complete the installation.+
  
  
Line 182: Line 248:
 The above **virt-install** command consitst of following options : The above **virt-install** command consitst of following options :
  
-  * **–name** = <Name of the Virtual Machine> +  * ''**–name** = <Name of the Virtual Machine>'' 
-  * **–file** = <Location where our virtual machine disk file will be stored > +  * ''**–file** = <Location where our virtual machine disk file will be stored >'' 
-  * **–file-size** = < Size of the Virtual Machine, in my case it is 20GB > +  * ''**–file-size** = < Size of the Virtual Machine, in my case it is 20GB >'' 
-  * **–nonsparse** = < Allocate the whole storage while creating> +  * ''**–nonsparse** = < Allocate the whole storage while creating>'' 
-  * **–graphics** = < Specify the graphical tool for interactive installation, in above example I am using spice > +  * ''**–graphics** = < Specify the graphical tool for interactive installation, in above example I am using spice >'' 
-  * **–vcpu** = < Number of virtual CPU for the Machine > +  * ''**–vcpu** = < Number of virtual CPU for the Machine >'' 
-  * **–ram** = < RAM size for the virtual Machine > +  * ''**–ram** = < RAM size for the virtual Machine >'' 
-  * **–cdrom** = < Virtual CD ROM which specify the installation media like ISO file > +  * ''**–cdrom** = < Virtual CD ROM which specify the installation media like ISO file >'' 
-  * **–network** = < it is used to specify which network we will use for the virtual machine, in this example I am bridge interface> +  * ''**–network** = < it is used to specify which network we will use for the virtual machine, in this example I am bridge interface>'' 
-  * **–os-type** = < Operating system type like linux and window> +  * ''**–os-type** = < Operating system type like linux and window>'' 
-  * **–os-variant**= <KVM maintains the OS variants like ‘fedora18′, ‘rhel6’ and ‘winxp’ , this option is optional and if you not sure about OS variant you can mentioned it as generic>+  * ''**–os-variant**= <KVM maintains the OS variants like ‘fedora18′, ‘rhel6’ and ‘winxp’ , this option is optional and if you not sure about OS variant you can mentioned it as generic>''
  
  
-Open now the Virt Viewer //(on Windoff)// and follow the instruction to complete the installation.+Open now the Virt Viewer //(on Windows)// and follow the instruction to complete the installation.
  
 {{:redhat:virtualization-redhat:ubuntu-16-04-virt-install.jpg?nolink|}} {{:redhat:virtualization-redhat:ubuntu-16-04-virt-install.jpg?nolink|}}
Line 207: Line 273:
 That’s it, basic installation and configuration of KVM hypervisor is completed. That’s it, basic installation and configuration of KVM hypervisor is completed.
  
----- 
  
 <WRAP center box 100%> <WRAP center box 100%>
Line 214: Line 279:
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
 +  * ''Cockpit''
   * ''https://www.virtualizor.com/''   * ''https://www.virtualizor.com/''
   * ''https://github.com/ArchipelProject/Archipel/wiki''   * ''https://github.com/ArchipelProject/Archipel/wiki''
Line 226: Line 292:
  
  
----- 
  
 ===== Redhat Dokumentation zum Thema ===== ===== Redhat Dokumentation zum Thema =====
  • redhat/virtualization-redhat/start.txt
  • Last modified: 2020/09/02 12:37
  • by michael