ENTERPRISE

Managing Xen : Xen Management User Interface—xm

6/11/2012 11:34:24 AM

xm is a management tool that communicates with the Xen hypervisor through xend—the Xen daemon. Running xm commands requires administrative privileges on the system as it uses the privileged communication channel between xend and the Hypervisor. xm is also designed to perform its functions in an asynchronous way.

Executing an xm command will immediately return to the caller, but the actual operation may not be complete. Some of the domain commands may actually take quite a long time to complete. The only way to determine whether the command is successfully completed is to print out the list periodically and check it. The two most fundamental operations that we use xm for are to create a domain and to list the state of all the domains in the current Xen environment. The state field in the list of domains has one of the five possible states for a domain:

  • r—running: Lists domains currently active on a CPU.

  • b—blocked: Lists domains that are blocked. This happens when the vcpu is waiting for an external event to happen for this domain.

  • p—paused: Lists domains that are suspended. The paused domain will still consumes allocated resources such as memory, but is not eligible for scheduling by the Xen hypervisor.

  • s—shutdown: Lists domains that are in process of shutting down.

  • c—crashed: Lists domains that are crashed.

The normal listing of domains is in a table format that is not very easy for other tools to parse. therefore xm also provides a long option to list the domain information in an S‑Expression format that can be easily parsed by other tools.

Time for Action—Xen Manager

You need not install xm separately. On Fedora Core, installing Xen will include the installation of various Xen tools. We will now demonstrate some of the common tasks performed with xm.

  1. Print a list of the running domains in the current Xen environment.

    # xm list

  2. Print detailed information about the dom0 in the current Xen environment.

    # xm list Domain-0 long

  3. Print detailed information about a domain in the current Xen environment. The listing is quite long and is therefore broken up into the following two screenshots.

    # xm list -long centos-domU
    							

  4. Pause a running domU in the current Xen environment.

    # xm pause ubuntu_feisty_domU

    List the domains to make sure it has paused:

    # xm list

  5. Unpause the previously paused domU:

    # xm unpause ubuntu_feisty_domU

    List the domains to make sure the domain has been unpaused.

    # xm list

  6. Save the state of a running domU in the current Xen environment to the specified file. The following will save the state to the disk file and remove it from the list of running domains.

    # xm save ubuntu_feisty_domU feisty.save

    List the domains to make sure the saved domain is no longer displayed in the list of running domains:

    # xm list

  7. Restore a domain from the saved state. This will restore the domain from the file with the state information and put the domain back in a running state.

    # xm restore feisty.save

    List the domains to make sure the domain is once again displayed in the list of running domains:

    # xm list

  8. Check the Xen kernel buffer messages. The following screenshot shows a partial listing from my machine.

    # xm dmesg

  9. Print the host information for the current Xen environment.

    # xm info

  10. Print the Xen log. The following screenshot shows a partial listing from the Xen log on my machine.

    # xm log

  11. Monitor the Xen domains in real time similar to the Unix top utility.

    # xm top

  12. List all the block devices used by a domain:

    # xm block-list ubuntu_feisty_domU

  13. List all the block devices used by a domain in detail:

    # xm block-list ubuntu_feisty_domU --long

  14. List all the network interfaces used by a domain:

    # xm network-list ubuntu_feisty_domU

  15. List all the network interfaces used by a domain in detail:

    # xm network-list ubuntu_feisty_domU

  16. Display the uptime for all the domains in your Xen environment.

    # xm uptime

  17. Reboot a domain. This does not re-read the Xen configuration file for that domain. If you want to reload the configuration for that domain, you need to use a halt command followed by a create command.

    # xm reboot ubuntu_feisty_domU
  18. Suspend a domain:

    # xm suspend ubuntu_feisty_domU
  19. Resume a suspended domain:

    # xm resume ubuntu_feisty_domU
  20. Rename a running domain:

    # xm rename ubuntu_feisty_domU prabhakar_domU
  21. Connect to domain console:

    # xm console ubuntu_feisty_domU
  22. Shut down a domain:

    # xm shutdown ubuntu_feisty_domU
What Just Happened?

xm is a tool that is provided with the Xen installation. It is the main interface for the management of Xen domains. It is very useful to get comfortable using xm as it is guaranteed to be available on any system that is running Xen. In this section we explored the various management tasks that can be performed using xm.

Xm also provides the ability to perform other management functions :

  • Virtual devices: Adds and removes virtual devices while the guest domain is running. You can attach and detach both storage devices and network devices using xm.

  • Security: Manages security policies in Xen.

  • Migration: Migrates the guest domain.

There are also other less common management related operations you can perform with xm. Please check the latest Xen documentation or the xm manual page for details on these options.

Other  
  •  Managing Xen : Xen Domain Configuration Files
  •  Visual Studio 2010 : Introducing the Visual Studio Extensibility - Deploying Visual Studio Extensions
  •  Visual Studio 2010 : Introducing the Visual Studio Extensibility - Building a Visual Studio Package
  •  Advanced FAQ Corner, May 2012
  •  The drive toward DSLs : Taking a DSL apart—what makes it tick?
  •  The drive toward DSLs : Choosing between imperative and declarative DSLs
  •  Visual Studio Team System 2008 : Creating new report (part 2)
  •  Visual Studio Team System 2008 : Creating new report (part 1) - Report server project
  •  Visual Studio Team System 2008 : TFS reports for testing - Bugs
  •  Extra Network Hardware Round-Up (Part 3)
  •  Extra Network Hardware Round-Up (Part 2) - NAS Drives, Media Center Extenders & Games Consoles
  •  Extra Network Hardware Round-Up (Part 1)
  •  Networking Jargon Explained (Part 2)
  •  Networking Jargon Explained (Part 1)
  •  The Micro Revolution
  •  Computing Yourself Fit (Part 4)
  •  Computing Yourself Fit (Part 3)
  •  Computing Yourself Fit (Part 2)
  •  Computing Yourself Fit (Part 1)
  •  Touch Interaction - Multi-Touch: An Evolution
  •  
    Most View
    Microsoft Dynamic CRM 2011 : Creating a New Chart
    Thermaltake Level 10 GTS Snow Edition Desktop Case
    Making Movies On Your Camera (Part 1)
    Acer C7 Chromebook - What Is The Exchange For A Cheap Chrome OS (Part 2)
    Trend Electronics - Solar Gargets
    SQL Server 2005 Security : Authentication and Authorization
    Implementing Security in Windows 7 : Understanding Windows 7 Security
    Core i7-3770K - Born To Run
    SQL Server 2008 : Advanced Stored Procedure Programming and Optimization - Using Dynamic SQL in Stored Procedures
    Audio/Video Gear: Models Are Recommended
    Top 10
    Windows Phone 8 In-Depth Review (Part 6)
    Windows Phone 8 In-Depth Review (Part 5)
    Windows Phone 8 In-Depth Review (Part 4)
    Windows Phone 8 In-Depth Review (Part 3)
    Windows Phone 8 In-Depth Review (Part 2)
    Windows Phone 8 In-Depth Review (Part 1)
    Xiaomi Phone 2 - High-End Specifications In A Surprisingly Cheap Package (Part 5)
    Xiaomi Phone 2 - High-End Specifications In A Surprisingly Cheap Package (Part 4)
    Xiaomi Phone 2 - High-End Specifications In A Surprisingly Cheap Package (Part 3)
    Xiaomi Phone 2 - High-End Specifications In A Surprisingly Cheap Package (Part 2)