32 private links
In this 4th part of our KVM series, we are discussing KVM environment management using CLI. We use ‘virt-install’ CL tool to create and configure virtual machines, virsh CL tool to create and configure storage pools and qemu-img CL tool to create and manage disk images.
How do I setup and manage a virtualized environment with Kernel based Virtual Machine (KVM) in CentOS or Red Hat Enterpise Linux version 6 server on IBM server? Can you provide step-by-step commands of how to install and manage Virtual Machines (VMs) on a physical server using KVM for RHEL/CentOS version 6.4?
Tutorial details
Difficulty Advanced (rss)
Root privileges Yes
Requirements VT enabled server
Estimated completion time 1h
KVM is part of RHEL and CentOS Linux. You can easily install the same using the following commands. Please note that only the package names have changed in RHEL/CentOS 6.x. If you are using RHEL / CentOS 5.x, read our previous CentOS / Redhat (RHEL) v.5.x KVM Virtulization guide for more information.
Let’s assume you have a physical machine running a Linux system, and you would like to convert this system into a virtual KVM/QEMU machine, keeping everything as close to the original as possible. What follows is my approach.
The first thing we need is a raw image file which mirrors the exact layout of the physical hard drive in our physical server.
In our example scenario, the physical box has one hard drive at /dev/sda with a /boot Partition on /dev/sda2 and a physical LVM volume on /dev/sda3. This LVM volume houses a volume group with two logical volumes, one of them housing the root partition /, and the other one being unused. Also, /dev/sda1 is unused. Grub is installed into the Master Boot Record.
1 libvirt Wiki
1.1 General project documentation
1.2 Books
1.3 Configuration Management
1.4 Conversion
1.5 Guest Management
1.5.1 Concepts
1.5.2 CGroups
1.5.3 CPU
1.5.4 KVM / QEMU
1.5.5 Guest device Configuration
1.5.6 Virtio
1.6 libguestfs / guestfish
1.7 Networking
1.7.1 Concepts
1.7.2 Detailed networking pieces
1.8 Perl
1.9 Provisioning
1.9.1 Cobbler
1.9.2 Foreman
1.10 Remote Management
1.10.1 CIM
1.10.2 QPID
1.11 Security
1.11.1 Host Security
1.11.2 SSH
1.11.3 Transport Layer Security (TLS)
1.12 Storage
1.12.1 iSCSI
1.12.2 QCow2 disk encryption
1.12.3 Disk and Memory Snapshots
1.13 Third Party Libvirt Applications
1.14 Other
1.14.1 Images
1.15 Getting started with the Wiki
Today, nearly every modern computing-related company uses directly or indirectly a virtualization software. As seen with the recent Cloud computing trend, it is a sector that recently exploded in popularity and it is now accessible to everyone.
There are now a LOT of alternatives to virtualize an OS :
Isolation : OpenVZ, VServer, LXC, UML, BSD jails, Solaris zones…
Paravirtualization : Xen
Full virtualization : VMWare Player/Workstation/ESX/ESXi, KVM/Qemu, Virtualbox, Bochs…
When having to deal with a large pack of machines for building packages, testing software on multiple OSes or optimally use a powerful server with lots of RAM, you rapidly should, if not have to, realize that Virtual Machines can make your life significantly easier. It was the case for us.
This is a collection of notes I took while setting up a virtual machine host which has several guest virtual machines running on Ubuntu 8.10.
The virsh command can be used to mange local or remote guest operating systems. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains.