XenSource
Skip navigation links
Overview Expand Overview
Products Expand Products
Solutions Expand Solutions
Support Services Expand Support Services
Partners Expand Partners
About Us Expand About Us
How to Buy
XenSource : Documentation :

XenServer Administrator's Guide

Release 4.0.1

Xen®, XenSource™, XenEnterprise™, XenServer™, XenExpress™, XenCenter™ and logos are either registered trademarks or trademarks of XenSource, Inc. in the United States and/or other countries. Other company or product names are for informational purposes only and may be trademarks of their respective owners.

This product contains an embodiment of the following patent pending intellectual property of XenSource, Inc.:

  1. United States Non-Provisional Utility Patent Application Serial Number 11/487,945, filed on July 17, 2006, and entitled “Using Writeable Page Tables for Memory Address Translation in a Hypervisor Environment”.
  2. United States Non-Provisional Utility Patent Application Serial Number 11/879,338, filed on July 17, 2007, and entitled “Tracking Current Time on Multiprocessor Hosts and Virtual Machines”.

October 2007


Table of Contents

1. Overview
1.1. XenServer Hosts and Resource Pools
1.2. Networking
1.3. Storage
1.4. Command Line Interface
1.5. How this Guide Relates to Other Documentation
2. XenServer Hosts and Resource Pools
2.1. Requirements for creating Resource Pools
2.2. Creating a Resource Pool
2.3. Adding shared storage
2.4. Installing and managing VMs on shared storage
2.5. Removing a XenServer Host from a Resource Pool
2.6. Coping with machine failures
2.6.1. Slave failures
2.6.2. Master failures
3. Networking
3.1. Configuring networks for XenServer Hosts
3.2. Configuring virtual network interfaces for VMs
3.3. Modifying physical network configuration after installation
3.3.1. Hostname
3.3.2. DNS servers
3.3.3. Network interface configuration
3.3.4. IP address changes in Resource Pools
3.4. Virtual network QoS settings (XenEnterprise only)
4. Storage
4.1. Storage Repository types
4.1.1. Local Disks
4.1.2. Shared Network Attached Storage - NFS
4.1.3. Shared iSCSI SANs
4.1.4. FC SANs
4.1.5. Storage Configuration Examples
4.1.6. Summary
4.2. Virtual disk QoS settings (XenEnterprise only)
5. Command line interface
5.1. Basic xe syntax
5.2. Special characters and syntax
5.3. Command types
5.3.1. Parameter types
5.3.2. Low-level param commands
5.3.3. Low-level list commands
5.4. xe command reference
5.4.1. CD commands
5.4.2. Console commands
5.4.3. Event commands
5.4.4. Host (XenServer Host) commands
5.4.5. Log commands
5.4.6. Network commands
5.4.7. Patch commands
5.4.8. PBD commands
5.4.9. PIF commands
5.4.10. Pool commands
5.4.11. Storage Manager commands
5.4.12. SR commands
5.4.13. Task commands
5.4.14. Template commands
5.4.15. User commands
5.4.16. VBD commands
5.4.17. VDI commands
5.4.18. VIF commands
5.4.19. VLAN commands
5.4.20. VM commands
5.5. xe compatibility mode
6. Troubleshooting
6.1. XenServer Host logs
6.2. XenServer Host crashes
6.3. Troubleshooting connections between XenCenter and the XenServer Host
6.4. Special debug boot options
Index

Chapter 1. Overview

This document is an administrator's guide to XenServer™, the platform virtualization solution from XenSource™. It describes the tasks involved in configuring a XenServer deployment -- in particular, how to set up storage, networking and resource pools, and how to administer XenServer Hosts using the xe command line interface (CLI).

This section summarizes the rest of the guide so that you can find the information you need. The following topics are covered:

  • XenServer Hosts and resource pools

  • XenServer network configuration

  • XenServer storage configuration

  • XenServer command line interface

1.1. XenServer Hosts and Resource Pools

A resource pool is a connected group of XenServer Hosts that, combined with shared storage, provides a platform on which VMs run. VMs can be started on different hosts within the resource pool, and can even be live migrated between pool hosts in order to minimize downtime.

The Hosts and Resource Pools chapter introduces the concept of resource pools and describes how to:

  • add and remove hosts from pools;
  • create shared storage and attach it to a pool;
  • start VMs on different hosts within a pool;
  • live migrate running VMs between hosts within a pool.

1.2. Networking

The Networking chapter introduces physical and virtual network concepts, describing how to:

  • configure physical networking on XenServer Hosts and resource pools;
  • create virtual network interfaces for VMs, and bridge these to physical networks;
  • work with VLANs.

1.3. Storage

The Storage chapter introduces physical and virtual storage concepts, describing how to:

  • create shared and local storage repositories on a variety of different substrates (including iSCSI, NFS and Fibre Channel);
  • create virtual disk images within storage repositories as part of the process of installing VMs;
  • manage and administer storage repositories.

1.4. Command Line Interface

The Command Line Interface chapter introduces "xe": a powerful CLI that facilitates administration of all aspects of XenServer, including host configuration, storage, networking and VMs. The CLI guide describes:

  • the syntax of xe commands;
  • using xe in both on- and off-host modes on both Windows and Linux;
  • using xe to query the parameters of physical and virtual objects, including hosts, networks, storage repositories, virtual disks and VMs;
  • using xe to configure XenServer deployments (including host, network, storage and VM configuration).

1.5. How this Guide Relates to Other Documentation

This document is primarily aimed at system administrators, who need to configure and administer XenServer deployments. Other documentation shipped with this release includes:

  • XenServer Installation Guide provides a high level overview of XenServer, along with step-by-step instructions on installing XenServer Hosts and the XenCenter management console;
  • XenServer Virtual Machine Installation Guide describes how to install Linux and Windows VMs on top of a XenServer deployment. As well as installing new VMs from install media (or via the VM templates provided with the XenServer release), this guide also explains how to create VMs from existing physical machines, via a process called P2V.
  • XenServer Software Development Kit Guide presents an overview of the XenServer SDK -- a selection of code samples that demonstrate how to write applications that interface with XenServer Hosts.
  • XenAPI Specification provides a programmer's reference guide to the XenServer API.
  • Release Notes provides a list of known issues that affect this release.

Chapter 2. XenServer Hosts and Resource Pools

A Resource Pool comprises multiple XenServer Host installations, bound together into a single managed entity which can host Virtual Machines. When combined with shared storage, a Resource Pool enables VMs to be started on any XenServer Host which has sufficient memory and then dynamically moved between XenServer Hosts while running with minimal downtime (XenMotion). If an individual XenServer Host suffers a hardware failure, then the Administrator can restart the failed VMs on another XenServer Host in the same Resource Pool.

This chapter describes how Resource Pools can be created through a series of examples using the xe command line interface (CLI). A simple NFS-based shared storage configuration is presented and a number of simple VM management examples are discussed. Procedures for dealing with physical node failures are also described.

A pool always has at least one physical node, known as the “master”. Other physical nodes join existing pools and are described as “slaves”. Only the master node exposes an administration interface (used by XenCenter and the CLI); the master will forward commands to individual slaves as necessary.

2.1. Requirements for creating Resource Pools

A Resource Pool is an aggregate of one or more homogeneous XenServer Hosts, up to a maximum of 16. The definition of homogeneous is:

  • each CPU is from the same vendor (in particular AMD-V and Intel VT CPUs cannot be mixed);

  • each CPU is the same model (except for stepping); and

  • each CPU has the same feature flags.

In addition to being homogeneous, an individual XenServer Host can only join a Resource Pool if:

  • it has a static IP address (either manually assigned or via DHCP);

  • it is not a member of an existing Resource Pool;

  • it has a clock synchronized to the pool master server (e.g. via NTP);

  • it has no shared storage configured; and

  • there are no running or suspended VMs on the XenServer Host;

XenServer Hosts in Resource Pools may contain different numbers of physical network interfaces. Local storage repositories may also exist, of varying size. In practice, it is often difficult to obtain multiple hosts with the exact same CPUs, and so minor variations are permitted. If you are sure that it is acceptable in your environment for hosts with varying CPUs to be part of the same Resource Pool, then the pool joining operation may be forced.

Note

The requirement for a XenServer Host to have a static IP address to be part of a Resource Pool also applies to the servers providing the shared NFS or iSCSI storage.

Although not a strict technical requirement for creating a Resource Pool, the advantages of pools (e.g. the ability to dynamically choose on which XenServer Host to run a VM and to dynamically move a VM between XenServer Hosts) are only available if the Pool has one or more shared Storage Repositories. As a rule of thumb, you should postpone creating a pool of XenServer Hosts until shared storage is available. Once shared storage has been added, we recommend you to move existing VMs whose disks are in local storage into shared storage. This can be done using the xe vm-copy command or XenCenter.

2.2. Creating a Resource Pool

Resource Pools can be created using either the XenCenter management console or the CLI.

To join hosts “a” and “b” into a Resource Pool via the CLI

  1. Open a host text console on the XenServer Host on host “b”.

  2. Command host “b” to join the pool on host “a” by: xe pool-join master-address=a master-username=root master-password=password.

    The master-address must be set to the fully-qualified domain name of host “a” and the password must be the administrator password set when host “a” was installed.

2.3. Adding shared storage

For a complete list of supported shared storage types, see the Storage chapter. This section demonstrates how shared storage (represented as a "Storage Repository") can be created on an existing NFS server.

Adding NFS shared storage to a Resource Pool via the CLI

  1. Open a host text console on any XenServer Host in the pool.

  2. Create the Storage Repository on server:/path by: xe sr-create content-type=user type=nfs name-label="Example SR" shared=true device-config-server=server device-config-serverpath=path.

    The device-config-server refers to the hostname of the NFS server and device-config-serverpath refers to the path on the server. Since shared is set to true, the shared storage will be automatically connected to every host in the pool and any hosts that subsequently join will also be connected to the storage. The UUID of the created Storage Repository will be printed on the screen.

  3. Find the UUID of the pool by: xe pool-list.

  4. Set the shared storage as the pool-wide default by: xe pool-param-set uuid=pool-uuid default-SR=sr-uuid.

    Since the shared storage has been set as the pool-wide default, all future VMs will have their disks created on shared storage by default.

2.4. Installing and managing VMs on shared storage

Installing a Debian Etch (4.0) VM

  1. Open a host text console on any XenServer Host in the pool.

  2. Create the Debian VM by: xe vm-install template="Debian Etch 4.0" new-name-label=etch.

    When the command completes, the Debian VM will be ready to start.

  3. Start the Debian VM with: xe vm-start vm=etch.

    The server will choose a XenServer Host from the pool to start the VM. If the on is provided then the VM will start on the specified XenServer Host. If the requested XenServer Host is unable to start the VM then the command will fail. To request that a VM always started on a particular XenServer Host, set the affinity parameter of the VM to the UUID of the desired XenServer Host using the xe vm-param-set command. Once set, the system will start the VM there if it can; if it cannot, it will default to choosing from the set of possible XenServer Hosts.

  4. Use XenMotion to move the Debian VM to host “b” with: xe vm-migrate vm=etch host=b --live.

    When this command returns, the VM will have been relocated to host “b”. During this process the VM keeps running to minimize the amount of downtime.

2.5. Removing a XenServer Host from a Resource Pool

When a XenServer Host is removed (“ejected”) from a pool, the machine is reinitialized and left in a state equivalent to a fresh install. It is important not to eject a XenServer Host from a pool if there is important data on the local disks. The local iSCSI IQN of the host is also re-initialized to a random value.

To remove host “b” from a Resource Pool via the CLI

  1. Open a host text console on any XenServer Host in the pool.

  2. Find the UUID corresponding to host “b” using: xe host-list.

  3. Command host “b” to leave the pool by: xe pool-eject host-uuid=uuid.

    The host will be ejected and left in a freshly-installed state.

Warning

Do not eject a host from a Resource Pool if it contains important data stored on its local disks. All of the data will be erased upon ejection from the pool. If you wish to preserve this data, copy the VM to shared storage on the pool first, or use the xe vm-copy CLI command.

When a slave host containing locally stored VMs is ejected from a pool, those VMs will still be present in the pool database and visible to the other hosts. They will not start until the virtual disks associated with them have been changed to point at shared storage which can be seen by other hosts in the pool, or simply removed. It is for this reason that you are strongly advised to move any local storage to shared storage upon joining a pool, so that individual hosts can be ejected (or physically fail) without loss of data.

2.6. Coping with machine failures

Machine failures come in two varieties: master failures and slave failures. These will be considered separately.

2.6.1. Slave failures

Master nodes detect the failures of slaves by receiving regular heartbeat messages. If no heartbeat has been received for 30 seconds then the master assumes the slave is dead. There are two ways to recover from this problem:

  1. Repair the dead slave (e.g. by physically rebooting it). When the connection to the slave is restored the master will mark the slave as alive again.

  2. Instruct the master to forget about the slave node using the xe host-forget. Once the slave has been forgotten all the VMs which were running there will be marked as offline and can be restarted on other hosts. Note it is very important to ensure that the host is actually offline otherwise VM data corruption may result.

When a slave host fails, there may be VMs still registered in the “running” state. If you are sure that the slave host is definitely down, and that the VMs have not been brought up on another host in the pool, use the xe vm-reset-powerstate command to forcibly halt the VMs. See Section 5.4.20.20, “vm-reset-powerstate” for more details.

2.6.2. Master failures

Every member of a Resource Pool contains all the information necessary to take over the role of master if required. When a master node fails, the following sequence of events occurs:

  1. The slaves realize that communication has been lost and each retry for sixty seconds

  2. Each slave then puts itself into emergency mode, whereby the slave XenServer Hosts will now accept only the pool-emergency commands (xe pool-emergency-reset-master and xe pool-emergency-transition-to-master).

If the master comes back up at this point, it will reestablish communication with its slaves, they will leave emergency mode, and operation will return to normal.

If the master is really dead, though, you should choose one of the slaves and issue to it the command xe pool-emergency-transition-to-master. Once it has become the master, issue the command xe pool-recover-slaves and the slaves will now point to the new master.

If you repair or replace the server that was the original master, you can simply bring it up, install the XenServer Host software, and add it to the pool. Since the XenServer Hosts in the pool are enforced to be homogeneous, there is no real need to make the replaced server the master.

When a slave host is transitioned to being a master, you should also check that the default pool storage repository is set to an appropriate value. This can be done using the xe pool-param-list command and verifying that the default-SR is pointing to a valid storage repository.

Chapter 3. Networking

This chapter discusses how the physical network devices on the XenServer Host are hooked up with the virtual network devices present in VMs so that VMs can be connected properly both to each other and to external networks.

XenServer Host networks are virtual ethernet switches. Each network may be connected to an external interface (with or without a VLAN tag) or it may be entirely virtual, internal to an individual XenServer Host. When a XenServer Host is installed, one network is created per physical NIC. When a XenServer Host is added to a Resource Pool, these default networks are merged so that all physical NICs with the same device name are attached to the same network. Typically you would only add a new network if you wished to create an internal network or set up a new VLAN using an existing NIC.

When a new VM is installed via the CLI, it is not attached to any networks; virtual interfaces must be created as a second step. When using XenCenter, the New VM wizard will lead you through the process of creating virtual interfaces.

XenServer supports up to four physical network interfaces per XenServer Host, and each VM supports up to seven virtual network interfaces.

The xe CLI can be used to create, destroy and modify three types of server-side objects which represent networking entities. These objects are:

  • A PIF represents a physical interface on a XenServer Host. Separate VLANs are assigned separate PIFs, so multiple PIFs can be associated with a single network interface card.

  • A VIF represents a virtual interface on a Virtual Machine.

  • A network is a virtual ethernet switch. This object has a name and description for the network, a globally unique UUID, and the collection of VIFs and PIFs connected to the network.

3.1. Configuring networks for XenServer Hosts

You can also create additional internal networks (that is, networks that are not connected to a physical network interface but are internal to the XenServer Host). These serve to connect VMs to each other without connecting them to the outside world.

Also, you can create additional networks if you add additional physical NICs to the machine. When a new NIC is added to a machine, you need to create network configuration files for the new interface manually, then add the new network as described below. See Section 3.3, “Modifying physical network configuration after installation”.

To add a new network, or remove a network using XenCenter, refer to the online Help.

To add a new network via the CLI

  1. Open a host text console on any XenServer Host in the pool.

  2. Create the network by: xe network-create name-label=mynetwork.

    The UUID of the network will be printed on the terminal. This network is not connected to anything and therefore is entirely virtual.

To connect a network to an external VLAN via the CLI

  1. Open a host text console on any XenServer Host in the pool.

  2. Find the UUID of a physical NIC on which to create the VLAN interface by: xe pif-list.

    The UUIDs and device names of all physical NICs and existing VLANs are printed on the terminal.

  3. Create the VLAN interface with tag “5” by: xe vlan-create network-uuid=uuid pif-uuid=uuid vlan=5.

    The UUID is printed on the terminal.

3.2. Configuring virtual network interfaces for VMs

To add a new virtual interface to a VM called windows via the CLI

  1. Open a host text console on any XenServer Host in the pool.

  2. Find the UUID of a VM named “windows” by: xe vm-list params=uuid name-label=windows.

    The UUID is printed on the terminal.

  3. Add the virtual interface to a VM called “windows” by: xe vif-create vm-uuid=uuid network-uuid=uuid device=0.

    The device is a number which uniquely identifies the virtual NIC (0, 1, 2, etc.) to a VM. The UUID of the new virtual interface will be printed on the terminal. Note that if the VM is online, the interface will not have been plugged in.

To hotplug a new virtual interface into a VM called “windows” via the CLI

  1. Open a host text console on any XenServer Host in the pool.

  2. Plug the VIF by: xe vif-plug uuid=vif-uuid.

    For this to work the VM must have the XenSource Tools installed.

3.3. Modifying physical network configuration after installation

The initial setup of physical network hardware is done during the initial product installation. Any changes you wish to make to this base configuration after the installation must be done by logging into the XenServer Host and changing the network configuration files.

3.3.1. Hostname

Edit the /etc/sysconfig/network file to change the hostname parameter to match your system hostname.

HOSTNAME=servername
				

3.3.2. DNS servers

DNS servers are defined in the /etc/resolv.conf file. To add additional name-servers or change existing name-server definitions, edit the file. Name-server entries in the file have the form

nameserver 192.168.1.34
nameserver 192.168.1.33
			

3.3.3. Network interface configuration

Network interface configurations are defined in files stored in the /etc/sysconfig/network-scripts directory. Each network interface has its own file with the name ifcfg-device_name. There is a device file for the physical card itself and another for the Linux bridge associated with this device. For example, the first network interface card is named eth0, and its associated bridge is xenbr0, so the network configuration information would be found in the files /etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network-scripts/ifcfg-xenbr0.

When XenServer Host is installed on a machine with multiple NICs, only the interface selected as the management NIC will be configured with an IP address. The NIC configurations for the additional interfaces will be present in /etc/sysconfig/network-scripts directory. If you wish to use other NICs, you need to add the line

	IPADDR=<ip address>
			

to the appropriate ifcfg-xenbrn file

If you add a new network interface to a XenServer Host, copy an existing pair of ifcfg-ethn and ifcfg-xenbrn files and edit them appropriately.

If a network interface is configured to get its network parameters from a DHCP server, its ifcfg files might be something like the following:

	DEVICE=eth1
	ONBOOT=yes
	TYPE=Ethernet
	HWADDR=00:15:60:95:4f:d0
	BRIDGE=xenbr1
	check_link_down() { return 1 ; }
			
	DEVICE=xenbr1
	ONBOOT=yes
	TYPE=Bridge
	DELAY=0
	STP=off
	BOOTPROTO=dhcp
	check_link_down() { return 1 ; }
			

If a network interface is configured with static network parameters, it needs to have IP address, gateway, and netmask specified explicitly in its ifcfg-xenbrn file:

	DEVICE=xenbr1
	BOOTPROTO=none
	ONBOOT=yes
	TYPE=Bridge
	NETMASK=255.255.255.0
	IPADDR=10.100.2.6
	GATEWAY=10.100.2.1
	PEERDNS=yes
	DELAY=0
	STP=off
	check_link_down() { return 1 ; }
			

The ONBOOT tells the system to enable the network device when the computer is booted up. To disable an existing network interface, edit its ifcfg file to that the ONBOOT parameter is set to no:

	ONBOOT=no
			

You can also disable an existing NIC by renaming or deleting its ifcfg file.

In order to activate the configuration file changes, you will need to restart the networking service by executing service network restart from the host console, and then restarting the host agent by running xe-toolstack-restart. See Section 3.3.4, “IP address changes in Resource Pools” for further required action if the management interface has been altered.

3.3.4. IP address changes in Resource Pools

XenServer hosts in Resource Pools use a single management IP address to communicate with the other hosts in the same pool. Thus, extra care is required when changing the IP address of hosts in an existing pool.

To change the IP address of a slave host

  1. Follow the above instructions (Section 3.3, “Modifying physical network configuration after installation”) to set the underlying network configuration files.

  2. If the physical interface to be used as the management interface has changed, edit the /etc/xensource-inventory file on the host and alter the MANAGEMENT_INTERFACE variable to reflect the new interface used. Make sure that you use the bridge interface (e.g. xenbr0) and not the physical NIC interface in this variable.

  3. Restart the API service on the host by executing xe-toolstack-restart.

  4. Confirm that the slave host has successfully reconnected to the master host by running xe host-list and checking that all the other XenServer hosts in the pool are visible.

Altering the IP address of the master host is slightly more difficult, since each of the slave hosts uses its advertised IP address to communicate with it, and will not know how to contact the master if its IP address changes. Where possible, ensure that you have a dedicated IP address for a pool master which is not likely to change in the lifetime of the pool.

To change the IP address of a master host

  1. Follow the instructions to change the IP address of a slave host (above).

  2. When you restart the API service on the master host, all the slaves will drop into an “emergency” mode when they fail to contact the master.

  3. On the master host, run the xe pool-recover-slaves CLI command, which will contact each of the slaves which are in emergency mode and inform them of the new IP address. Refer to the documentation on coping with pool failures (Section 2.6.2, “Master failures”) for more information.

3.4. Virtual network QoS settings (XenEnterprise only)

In XenEnterprise, virtual networks have an optional i/o priority Quality of Service (QoS) setting for maximum network transfer rate (in KB/s). This setting can be made to existing virtual networks with the CLI as described in this section.

The first parameter is qos_algorithm_type. This parameter needs to be set to the value ratelimit, which is the only type of QoS algorithm supported for virtual networks in this release.

The QoS parameters themselves are set with key/value pairs assigned to the qos_algorithm_params parameter. For virtual networks, qos_algorithm_params takes a kbps key, set to a valid number of kilobytes per second.

For example, the following CLI commands set the virtual networks's VIF to be limited to 100kb/s transfer rate:

xe vif-param-set uuid=<VIF UUID> qos_algorithm_type=ratelimit
xe vif-param-set uuid=<VIF UUID> qos_algorithm_params:kbps=100
		

Chapter 4. Storage

XenServer provides support for a broad range of storage hardware. The term Storage Repository (SR) is used to describe a particular storage target, on which Virtual Disk Images (VDIs) are stored. A VDI is a disk abstraction that contains the contents of a disk as presented to a virtual machine. XenServer defines an interface to storage hardware that allows VDIs to be supported on a large number of SR types, including local disks, NFS filers, Fibre Channel disks and shared iSCSI LUNs. The SR abstraction allows advanced storage features such as thin provisioning, VDI snapshots, and fast cloning to be exposed on storage targets that support them.

In working with the XenServer CLI, there are four classes of object that are used to describe, configure, and manage storage:

  • Storage Repository (SR): is a storage target, containing virtual disks. The SR object provides XE with a set of mechanisms to use to manage disks on that particular type of storage, and allows provisioning operations, such as creating a new virtual disk, to be mapped onto a wide variety of storage types. For example, virtual disks may be stored as logical volumes on a local disk, or they may be stored as VHD files on an NFS server. SR implementations provide operations for creating, destroying, resizing, cloning, connecting, locking, and discovering the individual Virtual Disk Images (VDIs) that they contain.

    A storage repository is a persistent, on-disk data structure. So the act of "creating" a new SR is similar to that of formatting a disk -- for most SR types, creating a new SR involves erasing any existing data on the specified storage target. SRs are long-lived, and may in some cases be shared among XenServer hosts, or moved between them.CLI operations to manage storage repositories are described in Section Section 5.4.12, “SR commands”.

  • Physical Block Device (PBD): A PBD represents the interface between a physical host and an attached SR. PBDs are connector objects that allow a given SR to be mapped to a host. Importantly, PBDs store the device config fields that are used to connect to and interact with a given storage target. In the case of NFS, for instance, this device config includes the IP of the NFS server and the associated mount path. PBD objects manage the run-time attachment of a given SR to a given host. CLI operations relating to PBDs are described in Section Section 5.4.8, “PBD commands”.

  • Virtual Disk Image (VDI): A VDI is an on-disk representation of a virtual disk provided to a guest VM. It is the fundamental unit of virtualized storage in XenServer.

    Similar to SRs, VDIs are persistent, on-disk objects that exist independently of XenServer. CLI operations to manage VDIs are presented in Section Section 5.4.17, “VDI commands”.

  • Virtual Block Device (VBD): A VBD is a connector object (similar to the PBD described above), that allows mappings between VDIs and VMs. In addition to providing a mechanism to attach (or "plug") a VDI into a VM, VBDs allow the fine-tuning of parameters regarding QoS, statistics, and the bootability of a given VDI. CLI operations relating to VBDs are described in Section Section 5.4.16, “VBD commands”.

The remainder of this section describes the common types of storage that are supported by XenServer, their type-specific device configuration options, and some best practices for managing storage in XenServer environments.

4.1. Storage Repository types

This section provides a brief description of the common physical storage types that XenServer supports.

4.1.1. Local Disks

By default, XenServer uses the local disk on the physical host on which it is installed. The Linux Logical Volume Manager (LVM) is used to manage VM storage. In this case a VDI is implemented as a LVM logical volume of the specified size.

Local LVM-based storage is high-performance and allows virtual disks to be dynamically resized. Virtual disks are fully allocated as an isolated volume on the underlying physical disk and so there is a minimum of storage virtualization overhead imposed. As such, this is a good option for high-performance storage, but lacks the flexibility of file-based storage options described below.

In addition to storing disks on an LVM-managed volume, local disks may be used to serve VDIs stored in the Microsoft VHD format. This may be configured through the XenServer CLI. VHD support is described in Section 4.1.2, “Shared Network Attached Storage - NFS”.

By definition, local disks are not shared across pools of XenServer hosts. As a consequence, VMs whose VDIs are stored in SRs on local disks are not agile; they may not be moved or migrated between hosts in a pool.

Supported device-config parameters for the local LVM SR type and the local VHD SR type are:

  • device - The path to the device on which the SR should be stored.

4.1.2. Shared Network Attached Storage - NFS

The NFS filer is a ubiquitous form of storage infrastructure that is available in many deployments. XenServer allows existing NFS servers to be immediately used as a storage repository for virtual disks (VDIs). VDIs are stored in the Microsoft VHD format, which is ideally suited to NFS environments. Moreover, as NFS SRs are shared, VDIs stored in them allow VMs to be started on any host in a Resource Pool and be live migrated between them using XenMotion.

Configuring an NFS SR is very easy. You just provide the hostname or IP address of the NFS server and the path to a directory that will be used to contain the SR. The NFS server must be configured to export the specified path to all hosts in the pool, otherwise the creation of the SR or the plugging of the PBD record will fail.

VDIs stored on NFS are sparse by default: the image file is allocated as the VM writes data into the disk. This has the considerable benefit that VM image files take up only as much space on the NFS filer as is required: If a 100GB VDI is allocated for a new VM and an OS is installed, the VDI file will only reflect the size of the OS data that has been written to the disk, typically only a few gigabytes.

VHD files may also be chained, allowing two VDIs to share common data. In cases where a NFS-based VM is cloned, the resulting VMs will share the common on-disk data at the time of cloning. Each will proceed to make its own changes in an isolated copy-on-write version of the VDI. This feature allows NFS-based VMs to be quickly cloned from templates -- facilitating very fast provisioning and deployment of new VMs.

As VHD-based images involve extra metadata to provide sparseness and chaining, the format is not as high-performance as LVM-based storage is. In cases where performance really matters, it is well worth forcibly allocating the sparse regions of an image file. This will improve performance at the cost of consuming addition disk space on the filer.

XenServer's NFS and VHD implementation assume that they have full control over the SR directory on the NFS server. Administrators are advised not to modify the contents of this directory as this may risk corrupting the contents of VDIs.

In considering best practice for NFS performance it is worth considering that XenServer has been tuned for enterprise filers that use non-volatile RAM to provide fast acknowledgments of write requests while maintaining a high degree of protection from failure. For reference, XenServer has been tested extensively against Network Appliance FAS270c and FAS3020c filers, using Data OnTap 7.2.2.

In situations where XenServer is used with lower-end filers, it will err on the side of caution by waiting for all writes to be acknowledged before passing acknowledgments on to guest VMs. This will incur a noticeable performance cost, and may be remedied by setting the filer to present the SR mount point as an asynchronous mode export. Asynchronous exports, however acknowledge writes that are not actually on disk, and so administrators should consider the risks of failure carefully in these situations.

Supported device-config parameters for the NFS SR type are:

  • server - The IP address or DNS name of the NFS server.

  • serverpath - The path on the server in which the SR should reside.

4.1.3. Shared iSCSI SANs

In addition to NFS, XenServer provides support for shared SRs on iSCSI LUNs, using the open-iSCSI software iSCSI initiator. Shared iSCSI support is implemented based on the Linux Volume Manager (LVM) and provides the same performance benefits that were provided by LVM in the local disk case. iSCSI-based SRs enable VM agility -- VMs may be started on any host in a pool and migrated between them. However, iSCSI-based VDIs do not provide support for sparse provisioning or fast cloning.

Each XenServer is automatically configured with a single iSCSI software adapter and assigned a random adapter initiator IQN. The initiator IQN is an iSCSI id that uniquely identifies the host when connecting to an iSCSI target. Most targets provide access control via IQN lists and it is therefore important to ensure that all hosts always retain a unique IQN value. The host IQN value can be adjusted manually using XenCenter or via the CLI:

xe host-param-set uuid=[VALID_HOST_ID] other-config-iscsi_iqn=[NEW_INITIATOR_IQN]

Warning

Do not change the host adapter IQN while there are still iSCSI SRs attached. It may result in failed attempts to connect to new targets or to connect existing SR entries.

The XenServer only supports a single iSCSI adapter to be configured. The adapter can connect to multiple different iSCSI targets and target IQNs in parallel, however it does not support configuration of more than one host initiator IQN, so all targets must be configured to allow access for the same initiator IQN.

Warning

Some iSCSI targets do not provide per-initiator IQN filtering/ACLs. Ensure that multi-initiator access is enabled if any LUNs are intended to be shared between more than one host in a pool.

iSCSI SRs may be created through both XenCenter and the CLI. XenServer hosts are limited to a single source initiator IQN, but may connect to multiple targets. Each individual iSCSI SR must be contained entirely on a single LUN, and may not span LUNs. CHAP support is provided for client authentication, both during the data path initialization and during the LUN discovery phase.

Supported device-config parameters for the shared LVM over ISCSI SR type are:

  • target - The IP address or DNS name of the iSCSI target.

  • targetIQN - The IQN (iSCSI Qualified Name) offered by the target that should be used.

  • LUNid - The bus ID of the LUN on which the SR is created.

  • chapuser - The CHAP authentication username credential that should be applied when connecting to the target. (optional)

  • chappassword - The CHAP authentication password credential that should be applied when connecting to the target. (optional)

  • usediscoverynumber - In rare cases, for multi-homed hosts, a target record may appear more than once. This option allows an advanced user to specify an alternative record number to attach. This option should be used with the scan facility outlined below to help in discovering the record ID. (optional)

In order to aid in the LUN discovery and identification phase, certain scan facilities are provided during the sr-create phase:

If the targetIQN parameter is left blank, the command will fail and return an XML string listing the available targetIQNs on the specified target. Each target will also provide an index value that may be provided as the usediscoverynumber value.

If the LUNid parameter is left blank, the command will fail and return an XML string listing the available LUNids on the specified target and targetIQN.

4.1.4. FC SANs

XenServer hosts can also use Fibre Channel SANs using the Emulex or QLogic host bus adapter (HBA). Logical unit numbers (LUNs) are mapped to the XenServer Host as disk devices /dev/sdx just like physical disks would be.

The Command Line Interfaces (CLIs) for configuring and managing Emulex and QLogic Fibre Channel HBAs are included in the XenServer Host in the following locations:

  • Emulex: /usr/sbin/hbanyware

  • QLogic: /opt/QLogic_Corporation/SANsurferCLI

If you are using a Fibre Channel SAN with an HBA that supports boot from LUN, you should do all your boot from LUN setup before installing the XenServer Host. During installation, just select the remote LUNs as if they were local disk drives. Once you complete the installation and reboot, the system will boot from the remote LUN.

Fibre Channel LUNs will appear on the host as scsi devices. Each scsi device is symlinked under the directory /dev/disk/by_id using its unique scsi_id. If you are unsure which scsi_id corresponds to which device, you can query a device with the sginfo command followed by the path. For example: sginfo /dev/disk/by_id/ {scsi_id}.

Fibre Channel disks should always be referenced by this path since it provides persistent device identification regardless of the core device name assigned by the host which may change, e.g. across host reboots.

If you add an Emulex or QLogic HBA to the XenServer Host after installation, you should edit /etc/modprobe.conf and add a line like this:

alias scsi_hostadaptern module_name
		

where n is the next available scsi_hostadapter number, and module_name is the appropriate module name for your HBA. Emulex cards are supported by the lpfcdfc module and qlogic cards by the qla**** modules, where **** will correspond to the version number. For full compatibility details, goto the online site Hardware Compatibility List for latest information.

For more information on Fibre Channel host adaptors, see the Emulex website and the QLogic website.

4.1.5. Storage Configuration Examples

The following section provides guidelines on how to create, attach, detach and delete storage types to a XenServer Host. The examples provided pertain to storage configuration via the CLI which provides the greatest flexibility.

Creating a new SR requires the use of the sr-create command. It will create a new SR record in the database and a corresponding PBD record. Upon successful creation of the SR, the PBD will be automatically plugged. If the SR shared=true flag is set, a PBD entry will be created for every host in the pool and plugged on each host. The following steps illustrate how to create a local LVM SR and a shared LVM over iSCSI SR. In each case, a correct host-uuid is required:

  1. xe sr-create host-uuid=[VALID_UUID] content-type="Example Content-type" name-label="Example Local LVM SR" shared=false device-config-device=/dev/sdb type=lvm to create a local LVM SR on device /dev/sdb. If successful, the CLI command will return an SR UUID.
  2. xe pbd-list sr-uuid=[SR_UUID] will list the status of the PBD, and if successful will show the 'currently-attached' status as 'true'.

Creating an LVM over iSCSI SR is very similar with the exception of being a shareable SR type, causing a PBD to be created for every host in the pool. Additionally, the device-config-* parameters are different, requiring a target, targetIQN and a LUNid parameter to be provided.

  1. xe sr-create host-uuid=[VALID_UUID] content-type="Example Content-type" name-label="My iSCSI SR" shared=true device-config-target=hostname type=lvmoiscsi device-config-targetIQN=NULL to provide a list of iSCSI targets available to this host from the specified target.
  2. xe sr-create host-uuid=[VALID_UUID] content-type="Example Content-type" name-label="My iSCSI SR" shared=true device-config-target=hostname type=lvmoiscsi device-config-targetIQN=[VALID_TARGET_IQN] to provide a list of LUNs available to this host via the targetIQN.
  3. xe sr-create host-uuid=[VALID_UUID] content-type="Example Content-type" name-label="My ISCSI SR" shared=true device-config-target=hostname type=lvmoiscsi device-config-targetIQN=[VALID_TARGET_IQN] device-config-LUNid=[VALID_LUNID] to create an LVM SR on the specified target LUN.
  4. xe pbd-list sr-uuid=[SR_UUID] will list the status of all the PBDs, for every host in the pool. If successful, all PBDs will show the “currently-attached” status as “true”.

Introducing an existing SR to a host requires the manual generation of both an SR record and a PBD record. Furthermore the PBD must be manually plugged to activate the SR on the host:

  1. xe sr-introduce content-type="Example Content-type" name-label="Example Shared LVM over iSCSI SR" shared=true uuid=[VALID_SR_UUID] type=lvmoiscsi to create an SR record for the specified SR UUID.
  2. xe pbd-create host-uuid=[VALID_UUID] sr-uuid=[VALID_SR_UUID] device-config-target=examplemachinename type=lvmoiscsi device-config-targetIQN=[VALID_TARGET_IQN] device-config-LUNid=[VALID_LUNID] to create a valid PBD record to accompany the SR record above.
  3. xe pbd-plug uuid=[PBD_UUID] to attach the shared LVM over ISCSI SR to the specified host.

Destroying an SR will actually delete the contents of the SR from the physical substrate. Alternatively, an SR record can be forgotten, which allows a user to re-attach the SR, e.g. to another host without removing any of the SR contents. In both cases, the SR's PBD must first be unplugged:

  1. xe pbd-unplug uuid=[PBD_UUID] to detach the SR from the corresponding host.
  2. xe sr-destroy uuid=[SR_UUID] will destroy the contents of the SR and delete both the SR and it's corresponding PBD record.
  3. xe sr-forget uuid=[SR_UUID] will remove the SR entry from the host database.

4.1.6. Summary

The following table summarizes the storage repository capabilities described above:

SR typeDescriptionShared?Sparse?VDI Resize?Fast Clone?
lvmLVM on Local Disk or attached FC LUNnonoyesno
extVHD on Local Disknoyesnoyes
nfsNetwork File System (NFS)yesyesnoyes
lvmoiscsiLogical Volume Management over iSCSIyesnoyesno

All storage repositories in XenServer are implemented as Python scripts and stored within the control domain's file system in /opt/xensource/sm. Advanced users may examine and even modify these scripts to adapt storage operations to their needs.

This is considered an advanced operation, and is not supported. However, visibility and customization of low-level storage management is of considerable value to some power users. Note also that new SR implementations may be placed in this directory and will be automatically detected by XenServer. The available SR types may be listed using the sm-list command (see Section 5.4.11, “Storage Manager commands”).

4.2. Virtual disk QoS settings (XenEnterprise only)

In XenEnterprise, virtual disks have an optional i/o priority Quality of Service (QoS) setting. This setting can be made to existing virtual disks with the CLI as described in this section.

The first parameter is qos_algorithm_type. This parameter needs to be set to the value ionice, which is the only type of QoS algorithm supported for virtual disks in this release.

The QoS parameters themselves are set with key/value pairs assigned to the qos_algorithm_type parameter. For virtual disks, qos_algorithm_type takes a sched key, and depending on the value, also requires a class key.

Possible values of qos_algorithm_type:sched are

  • sched=rt or sched=real-time sets the QoS scheduling parameter to real time priority, which requires a class parameter to set a value

  • sched=idle sets the QoS scheduling parameter to idle priority, which requires no class parameter to set any value

  • sched=<anything> sets the QoS scheduling parameter to best effort priority, which requires a class parameter to set a value

The possible values for class are

  • One of the following keywords: highest, high, normal, low, lowest

  • an integer between 0 and 7, where 0 is the highest priority and 7 is the lowest

For example, the following CLI commands set the virtual disk's VBD to use real time priority=5:

xe vbd-param-set uuid=<vbd UUID> qos_algorithm_type=ionice
xe vbd-param-set uuid=<vbd UUID> qos_algorithm_params:sched=rt
xe vbd-param-set uuid=<vbd UUID> qos_algorithm_params:class=5
		

Chapter 5. Command line interface

This chapter describes the XenServer command line interface (CLI). The xe CLI enables the writing of scripts for automating system administration tasks and allows integration of XenServer into an existing IT infrastructure.

The xe command line interface is installed by default on XenServer Hosts. A stand-alone remote CLI is also available for Linux and Windows.

  • On Windows, the xe.exe CLI executable is installed along with XenCenter. If you want to use it on a Windows computer that does not have XenCenter, you can simply copy the file \client_install\xe.exe from the Base Pack CD-ROM to a location on the local drive. You will need the Windows .NET 2.0 libraries installed.

    To use it, open a Windows Command Prompt and change directories to the directory where the file resides, or add its installation location to your system path.

  • On Linux, you can install the xe CLI executable from the RPM named xe-cli-4.0.1-4442x.i386.rpm on the Linux Pack CD, as follows:

    rpm -ivh xe-cli-4.0.1-4442x.i386.rpm

Basic help is available for CLI commands on-host by typing:

xe help command

A list of the most commonly-used xe commands is displayed if you type:

xe help

or a list of all xe commands is displayed if you type:

xe help --all

5.1. Basic xe syntax

The basic syntax of all XenServer xe CLI commands is:

xe command-name argument=value argument=value ...

Each specific command contains its own set of arguments that are of the form argument=value. Some commands have required arguments, and most have some set of optional arguments. Typically a command will assume default values for some of the optional arguments when invoked without them.

If the xe command is executed remotely, additional connection and authentication arguments are used. These arguments also take the form argument=argument_value.

The server argument is used to specify the hostname or IP address. The username and password arguments are used to specify credentials. A password-file argument can be specified instead of the password directly. In this case an attempt is made to read the password from the specified file (stripping CRs and LFs off the end of the file if necessary), and use that to connect. This is more secure than specifying the password directly at the command line.

The optional port argument can be used to specify the agent port on the remote XenServer Host (defaults to 443).

Example: On the local XenServer Host:

xe vm-list

Shorthand syntax is also available for remote connection arguments:

-uusername
-pwpassword
-pwfpassword file
-pport
-sserver

Example: On a remote XenServer Host:

xe vm-list -u myuser -pw mypassword -s hostname

Arguments are also taken from the environment variable XE_EXTRA_ARGS, in the form of comma-separated key/value pairs. For example, in order to run commands on another XenServer Host, you could do the following:

export XE_EXTRA_ARGS="server=jeffbeck,port=443,username=root,password=pass"

and thereafter you would not need to specify the remote XenServer Host parameters in each xe command you execute.

5.2. Special characters and syntax

To specify argument/value pairs on the xe command line, write

argument=value

without quotes, as long as value doesn't have any spaces in it. There should be no whitespace in between the argument name, the equals sign (=), and the value.

For values containing spaces, write:

argument="value with spaces"

If you use the CLI while logged into a XenServer Host, commands have a tab completion feature similar to that in the standard Linux bash shell. If you type, for example

xe vm-l

and then press the TAB key, the rest of the command will be displayed when it is unambiguous. If more than one command begins with vm-l, hitting TAB a second time will list the possibilities. This is particularly useful when specifying object UUIDs in commands.

5.3. Command types

Broadly speaking, the CLI commands can be split in two halves: Low-level commands concerned with listing and parameter manipulation of API objects, and higher level commands for interacting with VMs or hosts in a more abstract level. The low-level commands are:

  • class-list
  • class-param-get
  • class-param-set
  • class-param-list
  • class-param-add
  • class-param-remove
  • class-param-clear

where class is one of:

  • console
  • host
  • host-crashdump
  • host-cpu
  • network
  • patch
  • pbd
  • pif
  • pool
  • sm
  • sr
  • task
  • template
  • vbd
  • vdi
  • vif
  • vm

5.3.1. Parameter types

The objects that are addressed with the xe commands have sets of parameters that identify them and define their states.

Most parameters take a single value. For example, the name-label parameter of a VM contains a single string value. In the output from parameter list commands such as xe vm-param-list, such parameters have an indication in parentheses that defines whether they can be read and written to, or are read-only. For example, the output of xe vm-param-list on a specified VM might have the lines

                  user-version ( RW): 1
             is-control-domain ( RO): false
 		

The first parameter, user-version, is writeable and has the value 1. The second, is-control-domain, is read-only and has a value of false.

The two other types of parameters are multi-valued. A set parameter contains a list of values. A map parameter is a set of key/value pairs. As an example, look at the following excerpt of some sample output of the xe vm-param-list on a specified VM:

                      platform (MRW): acpi: true; apic: true; pae: true; nx: false
            allowed-operations (SRO): pause; clean_shutdown; clean_reboot; hard_shutdown; hard_reboot; suspend
		

The platform parameter has a list of items that represent key/value pairs. The key names are followed by a colon character (:). Each key/value pair is separated from the next by a semicolon character (;). The M preceding the RW indicates that this is a map parameter and is readable and writeable. The allowed-operations parameter has a list that makes up a set of items. The S preceding the RO indicates that this is a set parameter and is readable but not writeable.

In xe commands where you want to filter on a map parameter, or set a map parameter, use the separator : (colon) between the map parameter name and the key/value pair. For example, to set the value of the foo key of the other-config parameter of a VM to baa, the command would be

xe vm-param-set uuid=VM uuid other-config:foo=baa

5.3.2. Low-level param commands

There are several commands for operating on parameters of objects: class-param-get,class-param-set,class-param-add,class-param-remove,class-param-clear and class-param-list. Each of these takes a uuid parameter to specify the particular object.

  • class-param-list uuid=uuid

    Lists all of the parameters and their associated values. Unlike the class-list command, this will list the values of 'expensive' fields.

  • class-param-get uuid=uuid param-name=parameter [param-key=key]

    Returns the value of a particular parameter. If the parameter is a map, specifying the param-key will get the value associated with that key in the map. If param-key is not specified, or if the parameter is a set, it will return a string representation of the set or map.

  • class-param-set uuid=uuid param=value...

    Sets the value of one or more parameters.

  • class-param-add uuid=uuid param-name=parameter [key=value...] [param-key=key]

    Adds to either a map or a set parameter. If the parameter is a map, add key/value pairs using the 'key=value' syntax. If the parameter is a set, add keys with the 'param-key=key' syntax.

  • class-param-remove uuid=uuid param-name=parameter param-key=key

    Removes either a key/value pair from a map, or a key from a set.

  • class-param-clear uuid=uuid param-name=parameter

    Completely clears a set or a map.

5.3.3. Low-level list commands

The class-list command lists the objects of type class. By default it will list all objects, printing a subset of the parameters. This behavior can be modified in two ways: it can filter the objects so that it only outputs a subset, and the parameters that are printed can be modified.

To change the parameters that are printed, the argument params should be specified as a comma-separated list of the required parameters, e.g.:

 xe vm-list params=name-label,other-config
 		

Alternatively, to list all of the parameters, use the syntax:

 xe vm-list params=all
                

Note that some parameters that are expensive to calculate will not be shown by the list command. These will be shown as e.g.:

  allowed-VBD-devices (SRO): <expensive field>
                

In order to obtain these fields, use either the command class-param-list or class-param-get

To filter the list, the CLI will match parameter values with those specified on the command-line, only printing object that match all of the specified constraints. e.g.

 xe vm-list HVM-boot-policy="BIOS order" power-state=halted
                

will only list those VMs for which both the field 'power-state' has the value 'halted', and for which the field 'HVM-boot-policy' has the value 'BIOS order'.

It is also possible to filter the list based on the value of keys in maps, or on the existence of values in a set. The syntax for the first of these is map-name:key=value, and the second is set-name:contains=value

For scripting, a useful technique is passing '--minimal' on the command line, causing xe to print only the first field in a comma-separated list. For example, the command 'xe vm-list --minimal' on a XenServer Host with three VMs installed gives:

a85d6717-7264-d00e-069b-3b1d19d56ad9,aaa3eec5-9499-bcf3-4c03-af10baea96b7,42c044de-df69-4b30-89d9-2c199564581d
                

5.4. xe command reference

This section provides a reference to the xe commands. They are grouped by objects that the commands address, and listed alphabetically.

5.4.1. CD commands

Commands for working with physical CD/DVD drives on XenServer Hosts.

CDs have the following parameters:

Parameter NameDescriptionType
uuidunique identifier/object reference for the CDread only
name-labelName for the CDread/write
name-descriptionDescription text for the CDread/write
allowed-operationsA list of the operations that can be performed on this CDread only set parameter
current-operationsA list of the operations that are currently in progress on this CDread only set parameter
sr-uuidThe unique identifier/object reference for the SR this CD is part ofread only
sr-name-labelThe name for the SR this CD is part ofread only
vbd-uuidsA list of the unique identifiers for the VBDs on VMs that connect to this CDread only set parameter
crashdump-uuidsNot used on CDs since crashdumps cannot be written to themread only set parameter
virtual-sizeSize of the CD as it appears to VMs (in bytes)read only
physical-utilisationamount of physical space that the CD image is currently taking up on the SR (in bytes)read only
typeSet to User for CDsread only
sharableWhether or not the storage is sharable. Always true for CDs.read only
read-onlyWhether the CD is read-only, if false, the device is writeable. Always true for CDs.read only
storage-locktrue if this disk is locked at the storage levelread only
parentReference to the parent disk, if this CD is part of a chainread only
missingtrue if SR scan operation reported this CD as not present on diskread only
other-configA list of key/value pairs that specify additional configuration parameters for the CDread/write map parameter

5.4.1.1. cd-list

cd-list [params=param1,param2,...] [parameter=parameter value...]

List the CDs and ISOs (CD image files) on the XenServer Host or pool, filtering on the optional argument params.

If the optional argument params is used, the value of params is a string containing a list of parameters of this object that you want to display. Alternatively, you can use the keyword all to show all parameters. If params is not used, the returned list shows a default subset of all available parameters.

Optional arguments can be any number of the parameters listed at the beginning of this section.

String arguments do not take wildcards.

5.4.2. Console commands

Commands for working with consoles.

The console objects can be listed with the standard object listing command (xe console-list), and the parameters manipulated with the standard parameter commands. See Section 5.3.2, “Low-level param commands” for details.

Consoles have the following parameters:

Parameter NameDescriptionType
uuidThe unique identifier/object reference for the consoleread only
vm-uuidThe unique identifier/object reference of the VM this console is open onread only
vm-name-labelThe name of the VM this console is open onread only
protocolProtocol this console uses. Possible values are vt100: VT100 terminal, rfb:Remote FrameBuffer protocol (as used in VNC), or rdp: Remote Desktop Protocolread only
locationURI for the console serviceread only
other-configA list of key/value pairs that specify additional configuration parameters for the console.read/write map parameter

5.4.3. Event commands

Commands for working with events.

Event classes are listed in the following table:

Class nameDescription
poolA pool of physical hosts
vmA Virtual Machine
hostA physical host
networkA virtual network
vifA virtual network interface
pifA physical network interface (note separate VLANs are represented as several PIFs)
srA storage repository
vdiA virtual disk image
vbdA virtual block device
pbdThe physical block devices through which hosts access SRs

5.4.3.1. event-wait

event-wait class=class name [param-name=param-value]

Block other commands from executing until an object exists that satisfies the conditions given on the command line.

Example: wait for a specific VM to be running

xe event-wait class=vm name-label=myvm power-state=running

blocks until a VM called myvm is in the power-state "running."

The class name can be any of the classes listed at the beginning of this section, and the parameters can be any of those listed in the CLI command class-param-list.

5.4.4. Host (XenServer Host) commands

Commands for interacting with XenServer Hosts.

XenServer Hosts are the physical servers running XenServer software. They have VMs running on them under the control of a special privileged Virtual Machine, known as the control domain or domain 0.

The XenServer Host objects can be listed with the standard object listing command ( xe host-list, xe host-cpu-list, and xe host-crashdump-list), and the parameters manipulated with the standard parameter commands. See Section 5.3.2, “Low-level param commands” for details.

5.4.4.1. Host selectors

Several of the commands listed here have a common mechanism for selecting one or more XenServer Hosts on which to perform the operation. The simplest is by supplying the argument host=uuid or name-label. XenServer Hosts can also be specified by filtering the full list of hosts on the values of fields. For example, specifying enabled=true will select all XenServer Hosts whose enabled field is equal to true. Where multiple XenServer Hosts are matching, and the operation can be performed on multiple XenServer Hosts, the option --multiple must be specified to perform the operation. The full list of parameters that can be matched is described at the beginning of this section, and can be obtained by the command xe host-list params=all. If no parameters to select XenServer Hosts are given, the operation will be performed on all XenServer Hosts.

XenServer Hosts have the following parameters:

Parameter NameDescriptionType
uuidThe unique identifier/object reference for the XenServer Hostread only
name-labelThe name of the XenServer Hostread only
name-descriptionThe description string of the XenServer Hostread only
enabledfalse if disabled which prevents any new VMs from starting on them, which prepares the XenServer Hosts to be shut down or rebooted; true if the host is currently enabledread only
API-version-majormajor version numberread only
API-version-minorminor version numberread only
API-version-vendorread only 
API-version-vendor-implementationread only map parameter 
logging read only
suspend-image-sr-uuidthe unique identifier/object reference for the SR where suspended images are putread/write
crash-dump-sr-uuidthe unique identifier/object reference for the SR where crash dumps are putread/write
software-versionlist of versioning parameters and their valuesread only map parameter
capabilitieslist of Xen versions that the XenServer Host can runread only set parameter
other-configA list of key/value pairs that specify additional configuration parameters for the XenServer Hostread/write map parameter
hostnameXenServer Host hostnameread only
addressXenServer Host IP addressread only
supported-bootloaderslist of bootloaders that the XenServer Host supports, for example, pygrub, eliloaderread only set parameter
memory-totaltotal amount of physical RAM on the XenServer Host, in bytesread only
memory-freetotal amount of physical RAM remaining that can be allocated to VMs, in bytesread only
host-metrics-last-updatedTimestamp of the date and time that the metrics for a XenServer Host were read, in the form yyyymmddThh:mm:ssz, where z is the single-letter military timezone indicator, for example, Z for UTC (GMT)read only
host-metrics-livetrue if the host is operationalread only

XenServer Hosts contain some other objects that also have parameter lists.

CPUs on XenServer Hosts have the following parameters:

Parameter NameDescriptionType
uuidThe unique identifier/object reference for the CPUread only
numberthe number of the physical CPU core within the XenServer Hostread only
vendorthe vendor string for the CPU name, for example, "GenuineIntel"read only
speedThe CPU clock speed, in Hzread only
modelnamethe vendor string for the CPU model, for example, "Intel(R) Xeon(TM) CPU 3.00GHz"read only
steppingthe CPU revision numberread only
flagsthe flags of the physical CPU (a decoded version of the features field)read only
utilisationthe current CPU utilizationread only

Crash dumps on XenServer Hosts have the foll