This is the second post in a series about XenSource XenEnterprise 3.1. The first post was about installation and basic management. This post is about virtual machine management. I will limit myself to Windows virtual machines because that is basically what I am interested in the most. I tinker a bit with Linux once in a while but our customers mainly use Windows.
Windows XenVMs
XenEnterprise 3.1 supports Windows Server 2003 and Windows XP. Version 3.2 will support Windows 2000 Server SP4. Version 3.1 also has some limitations when compared to the upcoming version 3.2:
- Only 1 vCPU (4 in version 3.2)
- No suspend/resume (available in 3.2)
- 2GB of RAM (>2GB in 3.2)
- Unsigned paravirtualized drivers (should be signed in 3.2 with WHQL certification)
Version 3.2 has other improvements like better network performance and VLAN trunk support.
Installing a Windows Server 2003 XenVM
A new Windows virtual machine is installed from the XenServer management console by right clicking the XenServer and selecting Install XenVM. The virtual machine options can then be specified (click to enlarge):
I created a virtual machine with the maximum amount of memory (2047MB) and three virtual disks (the maximum). Windows Server 2003 can be installed from a cd image (iso) that is uploaded to /opt/xensource/packages/iso. I guess you can also use /var/opt/xen/iso_import. The iso can be uploaded with any scp client such as WinSCP or Bitvise Tunnelier. If you do not want to work with an iso, you can use the physical cd-rom of the XenServer host.
You should note that there is not a lot of free space for iso images in /. The XenSource website has more information about the creation of an iso repository. It is done by creating a new logical volume in the XenStorage volume group. There are other ways to do it as well.
When the Install button is clicked, the XenVM is started and you can take remote control from the management console (click image to enlarge):
The disks are presented as regular IDE devices. During installation, you do not need to load any device drivers (F6). Installation is fast as expected.
Let's take a look at the finished WIndows Server 2003 installation without the paravirtualized drivers. Here is a view of device manager (click to enlarge):
This Windows XenVM works without any additional drivers but that is not recommended. The paravirtualized drivers need to be installed from the supplied ISO image. To install the drivers, go the the Overview tab of the virtual machine and connect the xswindrivers.iso. When you connect the iso, autorun will be triggered to start the installation. During installation of the drivers, some warnings will popup because the drivers have not been signed. After installation of the drivers and a reboot, the Found New Hardware Wizard will appear to install the drivers for the network card. After that, device manager looks like:
After the drivers are installed, the XenEnterprise management console knows the ip address of the XenVM and will enable the remote desktop button. That button, when clicked, will launch mstsc.exe and connect to the XenVM with RDP. Note that you need to enable remote desktop in the vm. It is not like Windows Server Virtualization (Longhorn) where RDP will be used as the remote control protocol even during the boot up phase or during installation from cd.
Virtual Machine Storage
VMware ESX works with two types of storage: vmdk files on a vmfs volume or rdm (raw device mapping). When you use vmdk files on vmfs you simply encapsulate the disks of your virtual machine in a file on the host server. When you use rdm, you give a virtual machine more direct access to a SAN LUN for applications that require it. With XenEnterprise, don't expect your virtual machine disks to appear as files on the filesystem of the Xen host. Although Xen supports this, XenEnterprise uses LVM for virtual machine storage and each virtual machine's disk is a logical volume in the volume group that was created during installation. I believe that XenSource is planning to add support for other storage types, including the use of vhd files.
How does it actually work? Well, remember my server had one RAID5 volume with four local SAS disks (about 220GB in total). During installation, XenEnterprise creates three partitions: /dev/cciss/c0d0p1, /dev/cciss/c0d0p2 and /dev/cciss/c0d0p3 (it's an HP box). The first two are quite small and used by the system. The third is used to host an lvm 2 volume group. With pvdisplay, the physical volumes are shown and you can see to which volume group they belong. In my case /dev/cciss/c0d0p3 is used for volume group VG_XenStorage-1f64f92b-56f8-4e7f-adbb-812d62abe84f. To get more info about the volume group, use the vgdisplay command. To see the logical volumes created in the volume group (something like partitions on a regular disk), use lvdisplay. In my case, I see seven logical volumes. One is used by the system and the others correspond to the disks of the XenVMs.
A common requirement is the ability to resize a virtual machine's disks. With XenEnterprise that is easy. When a XenVM is shutdown, the new size of the disk can be set with the management console. No need to go to a command line!
Other possibilities
There are some other features that you might find useful:
- XenVM export and import to and from the system that runs the management console.
- XenVM cloning: simpler than VMware VirtualCenter but it does the job
- Mounting of virtual machine disks on the XenServer (command line).
Conclusion
Virtual machine management is pretty easy and straightforward with the management console. Installing a Windows XenVM is like installing a physical machine but you can also use cloning in combination with sysprep. XenEnterprise 3.1 has some serious limitations (vCPUs, memory, disks) for Windows XenVMs but this will improve with version 3.2 and higher.



