Manage virtual machines
This section provides an overview of how to create Virtual Machines (VMs) using templates. It also explains other preparation methods, including physical to virtual conversion (P2V), cloning templates, and importing previously exported VMs.
What is a virtual machine?
A Virtual Machine (VM) is a software computer that, like a physical computer, runs an operating system and applications. The VM comprises a set of specification and configuration files backed by the physical resources of a host. Every VM has virtual devices that provide the same functions as physical hardware. VMs can give the benefits of being more portable, more manageable, and more secure. In addition, you can tailor the boot behavior of each VM to your specific requirements. For more information, see VM Boot Behavior.
XenServer supports guests with any combination of IPv4 or IPv6 configured addresses.
Types of virtual machines
In XenServer VMs can operate in one of two modes:
Paravirtualized (PV): The virtual machine kernel uses specific code which is aware it is running on a hypervisor for managing devices and memory.
Fully virtualized (HVM): Specific processor features are used to ‘trap’ privileged instructions that the virtual machine carries out. This capability enables you to use an unmodified operating system. For network and storage access, emulated devices are presented to the virtual machine. Alternatively, PV drivers can be used for performance and reliability reasons.
Use VM templates
VMs are prepared from templates. A template is a gold image that contains all the various configuration settings to create an instance of a specific VM. XenServer ships with a base set of templates, which are raw VMs, on which you can install an operating system. Different operating systems require different settings to run at their best. XenServer templates are tuned to maximize operating system performance.
There are two basic methods by which you can create VMs from templates:
Using a complete pre-configured template, for example the Demo Linux Virtual Appliance.
Installing an operating system from a CD, ISO image or network repository onto the appropriate provided template.
Windows VMs describes how to install Windows operating systems onto VMs.
Linux VMs describes how to install Linux operating systems onto VMs.
Templates created by older versions of XenServer can be used in newer versions of XenServer. However, templates created in newer versions of XenServer are not compatible with older versions of XenServer. If you created a VM template by using XenServer 7.6, to use it with an earlier version, export the VDIs separately and create the VM again.
Other methods of VM creation
In addition to creating VMs from the provided templates, you can use the following methods to create VMs.
Physical to Virtual Conversion (P2V) is the process that converts an existing Windows operating system on a physical server to a virtualized instance of itself. The conversion includes the file system, configuration, and so on. This virtualized instance is then transferred, instantiated, and started as a VM on the XenServer host.
Clone an existing VM
You can make a copy of an existing VM by cloning from a template. Templates are ordinary VMs which are intended to be used as master copies to create instances of VMs from. A VM can be customized and converted into a template. Ensure that you follow the appropriate preparation procedure for the VM. For more information, see Preparing for Cloning a Windows VM Using Sysprep and Preparing to Clone a Linux VM.
Templates cannot be used as normal VMs.
XenServer has two mechanisms for cloning VMs:
A full copy
The faster Copy-on-Write mode only writes modified blocks to disk. Copy-on-Write is designed to save disk space and allow fast clones, but slightly slows down normal disk performance. A template can be fast-cloned multiple times without slowdown.
If you clone a template into a VM and then convert the clone into a template, disk performance can decrease. The amount of decrease has a linear relationship to the number of times this process has happened. In this event, the
vm-copyCLI command can be used to perform a full copy of the disks and restore expected levels of disk performance.
Notes for resource pools
If you create a template from VM virtual disks on a shared SR, the template cloning operation is forwarded to any server in the pool that can access the shared SRs. However, if you create the template from a VM virtual disk that only has a local SR, the template clone operation is only able to run on the server that can access that SR.
Import an exported VM
You can create a VM by importing an existing exported VM. Like cloning, exporting and importing a VM is fast way to create more VMs of a certain configuration. Using this method enables you to increase the speed of your deployment. You might, for example, have a special-purpose server configuration that you use many times. After you set up a VM as required, export it and import it later to create another copy of your specially configured VM. You can also use export and import to move a VM to the XenServer host that is in another resource pool.
For details and procedures on importing and exporting VMs, see Importing and Exporting VMs.
XenServer Tools provide high performance I/O services without the overhead of traditional device emulation. XenServer Tools consists of I/O drivers (also known as Paravirtualized drivers or PV drivers) and the Management Agent. Install XenServer Tools on each Windows VM for that VM to have a fully supported configuration, and to be able to use the xe CLI or XenCenter. The version of XenServer Tools installed on the VM must be the same as the latest available version installed on the XenServer host. For example, some hotfixes include an updated XenServer Tools ISO that updates the version installed on the host.
The I/O drivers contain storage and network drivers, and low-level management interfaces. These drivers replace the emulated devices and provide high-speed transport between Windows and the XenServer product family software. While installing of a Windows operating system, XenServer uses traditional device emulation to present a standard IDE controller and a standard network card to the VM. This emulation allows Windows to install by using built-in drivers, but with reduced performance due to the overhead inherent in emulating the controller drivers.
The Management Agent, also known as the Guest Agent, is responsible for high-level virtual machine management features and provides a full set of functions to XenCenter. These functions include quiesced snapshots.
You must install XenServer Tools on each Windows VM for the VM to have a fully supported configuration. The version of XenServer Tools installed on the VM must be the same as the version installed on the XenServer host. A VM functions without the XenServer Tools, but performance is hampered when the I/O drivers (PV drivers) are not installed. You must install XenServer Tools on Windows VMs to be able to perform the following operations:
Cleanly shut down, reboot, or suspend a VM
View VM performance data in XenCenter
Migrate a running VM (using XenMotion or Storage XenMotion)
Create quiesced snapshots or snapshots with memory (checkpoints), or revert to snapshots
Adjust the number of vCPUs on a running Linux VM (Windows VMs require a reboot for this change to take effect)
Find out the virtualization state of a VM
XenCenter reports the virtualization state of a VM on the VM’s General tab. You can find out whether or not XenServer Tools (I/O drivers and the Management Agent) are installed. This tab also displays whether the VM can install and receive updates from Windows Update. The following section lists the messages displayed in XenCenter:
I/O optimized (not optimized): This field displays whether or not the I/O drivers are installed on the VM. Click the Install I/O drivers and Management Agent link to install the I/O drivers from the XenServer Tools ISO.
I/O drivers are automatically installed on a Windows VM that can receive updates from Windows Update. For more information, see Updating XenServer Tools.
Management Agent installed (not installed): This field displays whether or not the Management Agent is installed on the VM. Click the Install I/O drivers and Management Agent link to install the Management Agent from the XenServer Tools ISO.
Able to (Not able to) receive updates from Windows Update: specifies whether the VM can receive I/O drivers from Windows Update.
Windows Server Core 2016 does not support using Windows Update to install or update the I/O drivers. Instead use the installer on the XenServer Tools ISO.
Install I/O drivers and Management Agent: this message is displayed when the VM does not have the I/O drivers or the Management Agent installed. Click the link to install XenServer Tools. For Linux VMs, clicking the status link switches to the VM’s console and loads the XenServer Tools ISO. You can then mount the ISO and manually run the installation, as described in Installing XenServer Tools.
Supported guests and allocating resources
For a list of supported guest operating systems, see Supported Guests, Virtual Memory, and Disk Size Limits
This section describes the differences in virtual device support for the members of the XenServer product family.
XenServer product family virtual device support
The current version of the XenServer product family has some general limitations on virtual devices for VMs. Specific guest operating systems may have lower limits for certain features. The individual guest installation section notes the limitations. For detailed information on configuration limits, see Configuration Limits.
Factors such as hardware and environment can affect the limitations. For information about supported hardware, see the XenServer Hardware Compatibility List.
VM block devices
In the para-virtualized (PV) Linux case, block devices are passed through as PV devices. XenServer does not attempt to emulate SCSI or IDE, but instead provides a more suitable interface in the virtual environment. This interface is in the form of
xvd* devices. It is also sometimes possible to get an
sd* device using the same mechanism, where the PV driver inside the VM takes over the SCSI device namespace. This behavior is not desirable so it is best to use
xvd* where possible for PV guests. The
xvd* devices are the default for Debian and RHEL.
For Windows or other fully virtualized guests, XenServer emulates an IDE bus in the form of an
hd* device. When using Windows, installing the XenServer Tools installs a special I/O driver that works in a similar way to Linux, except in a fully virtualized environment.