Home > Enterprise Linux Tips > Administrator > Managing RHEL 5.1 VMs with the command line interface
Enterprise Linux Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADMINISTRATOR

Managing RHEL 5.1 VMs with the command line interface


Ronald McCarty
05.13.2008
Rating: -3.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Deploying virtual machines (VMs) eases administrative tasks and decreases the amount of hardware required for an environment to operate; but ease of operating system administration becomes important for Linux administrators only after they have mastered the command line interface for virtualization. This tip covers the command line interface for managing RHEL 5.1 VMs.

Startup and shutdown
Virtual machines can also be gracefully started and shut down using the xm command. For example, to stop the www virtual machine use: xm shutdown www. To restart the www virtual machine, xm create www can be used. A reboot can also be issued with: xm reboot www. The shutdown is clean using the shutdown parameter. In the rare circumstance a virtual machine hangs, a forced shutdown can be achieved with xm destroy - for example, xm destroy www.

Poking around
Whenever inheriting an existing system , it is important to get a feel for this system. It would be a good idea to learn about its configurations and the location of all machines in it. We will cover here how RedHat, through its Xen xm commands, provides several useful parameters.

The xm uptime command shows how long the hypervisor (host) has been up, as well as all virtual machines currently active on the system:

The xm list command provides additional insight into the hypervisor and virtual machines:

For this particular output, we see the logical IDs of the system, the amount of real (physical) memory assigned to the hypervisor and virtual machines, and the number of virtual processors assigned. The state of each system is also displayed (running:r, blocked:b, paused:p, or shutdown:s)

The virtual machine configuration files are stored in /etc/xen. Each virtual machine will have a configuration file matching that of the virtual machine name. For example, on this system:

Examing the www virtual machine file shows...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


the following:

To view this coding, click here.

This config file shows memory, virtual cpus, the Ethernet MAC address, etc., that are used by the virtual machine.

Additional information about the particular hypervisor can also be gleaned using the info parameter:

To view this info parameter, click here.

Additional commands
A few additional commands are very specific and may not be useful in day-to-day operations. However, they can be useful in troubleshooting.

The first, xm top, displays a breakdown of networking and cpu utilization of the hypervisor and the virtual machines. Xm top is interactive so you can see additional information on the screen by pressing N (networks), V (virtual CPUs), or S (sort order). The S actually changes the column you are sorting on starting at its far left (name), then cycles to the right.

The xm dmesg will print out the xm dmesg buffer. The buffer mimicks the normal Unix/Linux dmesg behavior; however, it is specific to Xen. You can also clear this buffer with the -c parameter added: xm -c dmesg.

Troubleshooting virtual machines often requires an analysis of the logs associated with the virtualization. To see Xen's log file, use xm log or cat /var/log/xen/xend.log.

Summary
As this article demonstrates, an administrator can manage Xen using the command line interface. These commands allow systems to be managed in many circumstances without having to manage the individual virtual machine from the "inside."

About the author: Ronald McCarty is the founder and CEO of the technology services company Your Net Guard. His work has been published widely in networking, systems and security.


Rate this Tip
To rate tips, you must be a member of SearchEnterpriseLinux.com.
Register now to start rating these tips. Log in if you are already a member.




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.



Enterprise Linux Web Server & Application Server
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts