IBM Developer Day | Bengaluru | March 14th Register now
Article
By M. Jones | Updated November 1, 2012 - Published October 31, 2012
CloudData Science
Although server management is historically problematic, virtualization management simplifies some problems but amplifies others. The days of a single operating system on a server are gone, replaced by many operating systems within their virtual machine (VM) containers. This property, called virtual machine density, is advantageous, because less server hardware is needed as more and more VMs occupy smaller numbers of servers. This results in less hardware, lower power, but increased management complexity.
Luckily, solutions exist to ease the problems that server virtualization creates, and open source is leading the way. One such solution, called the Virtual Machine Manager from Red Hat, greatly simplifies the ability to manage VMs (running on the key open source hypervisors) as well as providing introspective capabilities to those VMs to measure their performance and resource utilization.
Virtualization exposes new challenges in managing VMs, their resources, and the underlying resources of the physical host. Instead of a single mapping of operating system to physical host, multiple operating systems now share a physical host’s resources as VMs. Each VM is represented by a container that holds one or more virtual disks and other metadata to describe the configuration and constraints of the VM. Each VM shares the resources of the physical host, which requires not just configuration but an understanding of the utilization of those resources (to ensure a proper density of VMs that optimally use the host and neither tax the available resources nor waste them).
Virtual Machine Manager (virt-manager), is a lightweight application suite that presents a command-line or graphical user interface (GUI) for managing VMs. In addition to providing management capabilities over VMs, virt-manager provides an embedded virtual network computing (VNC) client viewer for a full graphical console of the guest VMs.
virt-manager
As an application suite, virt-manager covers a common set of virtualization management tasks. These tools are listed in Table 1 and represent VM construction, cloning, imaging, and viewing. The virsh utility is not part of the virt-manager package but is invaluable in itself.
virsh
virt-install
virt-clone
virt-image
virt-viewer
virt-manager uses the libvirt virtualization library to manage the available hypervisors. libvirt exposes an application programming interface (API), which is integrated with a large number of open source hypervisors, to enable control and monitoring. libvirt makes available a daemon called libvirtd, which assists in this process (as shown in a simple stack below).
libvirt
libvirtd
The Virtual Machine Manager was developed by Red Hat in the Python language to control the life cycle of VMs, including provisioning, virtual network management, and statistics gathering and reporting as well as providing simple graphical access to the VMs themselves.
To install the virt-manager package, use the package manager for your particular distribution. For Ubuntu, use apt:
apt
$ sudo apt‑get install virt‑manager
The apt command results in around 22MB of disk space being used for the virt-manager application suite. As part of the installation, the libvirt daemon should be running. To verify, use the following command:
$ ps ax | grep libvirtd
That command should show that the libvirtd process is running, with the -d option instructing libvirtd to run as a daemon. Recall that libvirtd is the daemon that permits connectivity from the virt-manager application to the hypervisors and through them the VMs that they host.
-d
To verify that the virt-manager package was installed, and to identify the location of the virt-manager binary, use the which command:
which
$ which virt‑manager
The location of virt-manager is also the home of other applications in the suite (virt-install, virt-image, and so on).
As a final step, use QEMU as your hypervisor, because you can run it on any hardware. As an emulator, it runs a bit slower but does not require the virtualization extensions of new hardware.
$ sudo apt‑get install qemu
Now, use virt-manager to create and monitor a couple of VMs.
The steps in this section create two VMs.
$ wget http://mirror.slitaz.org/iso/4.0/slitaz‑4.0.iso
sudo
$ sudo virt‑manager
slitaz1
This example illustrated a simple method for creating VMs, configuring them, and executing them without a detailed understanding of the underlying hypervisor and the plethora of options that it exposes (for storage and networking management, for example). Although this example used emulation provided by QEMU, the Linux Kernel Virtual Machine (KVM) hypervisor can be used to attain near-bare-metal performance (using hardware support, such as Intel® Virtual Technology [VT]). The ability not only to construct but pause and restart in addition to cloning VMs is also made accessible through the virt-manager application.
Although virt-manager is one prominent user of the libvirt virtualization API, there is a growing ecosystem of tools that use this interface for virtualization management. The virt-manager package provides a convenient GUI for creating and managing VMs over multiple hypervisors and hosts. If you prefer the command line, a number of tools give you the power and control that only the command line can provide.
The virt-install tool provides the capability to provision new VMs. Where virt-manager provided a small number of configuration options for VM construction, virt-install provides an extensive set of configuration options covering installation methods, storage configuration, network configuration, graphics configuration, virtualization options, and a huge list of virtualized device options.
The virt-image tool is similar to the virt-install tool but allows you to define the details of the VM construction process in XML. The XML descriptor file specifies the general metadata for the VM, its domain attributes (CPUs, memory, and so on), and storage configuration.
The virt-clone tool provides a way to clone existing VM images. By clone, I mean a copy of the existing VM, with updated parameters to ensure that the new VM is unique to avoid conflicts (such as media access control [MAC] addressing).
The virt-viewer tool provides a graphical console for a given VM using the VNC protocol. The virt-viewer can attach to VMs running on the local host or on remote hosts.
Finally, the most powerful tool for managing guest domains is the virtualization shell, or virsh. virsh can be used to list VM guests, start and stop them, and create VMs. In short, you can use virsh for full administration of virtualization across hypervisors, exposing features not available in other tools.
Although virt-manager and its associated tools provide a useful environment for managing VMs in a desktop environment, there may be cases where you’d prefer a more feature-rich platform virtualization solution. Red Hat also offers a solution called oVirt, which like virt-manager uses libvirt to manage VMs and the back-end hypervisors. The oVirt solution supports several back-end hypervisors and can even manage enterprise-level storage protocols such as Fibre Channel, iSCSI, and Network File System (NFS). The oVirt solution also exposes enterprise-level features such as high availability and live migration within a homogeneous infrastructure.
oVirt
virt-manager is not just another tool: It’s a step toward open clouds with open APIs and an open cloud stack (desktop, server, data center). The virt-manager and related tools provide both a simple and a powerful environment for managing virtualization on a desktop. Whether you prefer the power and scriptability of the command line or the simplicity of the GUI, virt-manager and its related tools have you covered.
Conference
May 6, 2019
São Paulo
AnalyticsArtificial Intelligence+
September 23, 2019
Meetup
March 27, 2019
Berlin
Back to top