Tip

Managing virtual machines in Red Hat Enterprise Linux 5.4

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

    Requires Free Membership to View

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.

Figure 1
Virt-manager uses three tabs to organize VM management. (Click image for an enlarged view.)

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 . Use virsh help uri, for example, for a full explanation of the virsh uri command.

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.


 

This was first published in December 2009

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.