Managing virtual machines (VMs) in Red Hat Enterprise Linux 5.4 with the VM management tools virt-manager and virsh...
makes it easier to get a handle on your Kernel-based Virtual Machine (KVM) environments.
Red Hat Enterprise Linux 5.4 is the first enterprise Linux distribution that natively supports KVM. In part one of this series, I covered how to set up Red Hat Enterprise Linux 5.4 as a KVM host. Part two explains how to create VMs in a host. Here, in part three, I discuss managing virtual machines using virt-manager and virsh.
Understanding VM management tools in Red Hat Enterprise Linux 5.4 begins with libvirt -- the virtualization library that allows VM management on host platforms, even if the VMs are in a KVM environment or reside on top of a Xen hypervisor.
There are two VM management tools that communicate with libvirt: the graphical tool virt-manager and the command line tool virsh. The purpose of each of these VM management tools is completely different, however. While virt-manager was designed as a graphical interface to make managing virtual machines easy, virsh was created to give users full control over VM management.
Managing virtual machines with virt-manager
Because virt-manager makes VM management simple, it has a limited set of management actions -- mainly related to VM operational states and hardware management.
The virt-manager management tasks are offered on the following three tabs:
- The Console tab grants access to the VM console and allows users to work directly on the VM.
- The Overview tab permits users to monitor the current VM operational status and resource usage.
- The hardware tab controls the VM hardware settings. Options include VM memory and storage allocation and changing the network settings.
There are three buttons above the tabs that manage the VM operational status. From here, an administrator can start, stop or temporarily pause a machine. Also, if a KVM environment is configured for virtual machine live migration, this option is accessible through the Virtual Machine > Migrate menu.
Performing advanced management tasks using virsh
Managing virtual machines with virsh is completely different. As mentioned before, virsh is designed to manage every VM feature through a master command and subcommands. For a complete overview of the commands, type virsh help. You may notice that there are a lot, however, there is help for each command -- just enter virsh help
The learning curve for virsh is steep because there are so many commands. Once you've gained a strong command foundation, however, it's easy to appreciate virsh's versatility.
Sander van Vugt is an independent trainer and consultant based in the Netherlands. Van Vugt is an expert in Linux high availability, virtualization and performance and has completed several projects that implement all three. He is also the writer of various Linux-related books, such as Beginning the Linux Command Line, Beginning Ubuntu Server Administration and Pro Ubuntu Server Administration.