-
Notifications
You must be signed in to change notification settings - Fork 8
XenServer 7.4
XenServer 7.4 is complete virtualization package from Citrix Systems. Citrix acquired XenSource in 2007. It uses well known Xen hypervisor (which is often used in public cloud - including Amazon AWS or few years ago in Rackspace etc.) - see About page on https://www.xenproject.org/about-us.html for more details.
For plain Xen hypervisor please see Xen
Notable highlights:
-
very comfortable Windows installation (IDE drivers on install, automatic drivers replacement by Guest tools after install)
-
comfortable Linux installation (all drivers and PV mode in all mainstream Linux distribution)
-
XenCenter client supports all Windows versions since Windows 7 SP1 - unlike that Hyper-V manager is much more constrained (Windows 8+ required, windows Home edition has NOT Hyper-V Manager)
-
probably only commercial product that can manage more than one server in its Free edition (however one pool is limited to 3 hosts since XenServer 7.3.0) - for example both VMware vCenter or Microsoft SCVMM are available in paid edition only.
- You need at least 1 dedicated PC server for XenServer that would run VMs.
- You need client
Windows 7 SP1
or later with latest service Pack and .NET 4.6 to run XenCenter management software. Please see https://docs.citrix.com/content/dam/docs/en-us/xenserver/current-release/downloads/xenserver-installation-guide.pdf section 2.3.1.2. XenCenter System Requirements for details
Please see https://docs.citrix.com/content/dam/docs/en-us/xenserver/current-release/downloads/xenserver-installation-guide.pdf for up-to-date requirements. Briefly:
- CPU with basic Intel VT or AMD-V virtualization support (practically everything) required for Windows guest.
NOTE: You can still run most Linux guests in PV mode - even on CPUs without any virtualization support. It is also handy if your trying XenServer under another Hypervisor (tested also under Proxmov VE 5.1) on CPUs without nested virtualization support
- 2GB minimum of RAM required - but you need free RAM for VMs. I use 6GB for testing.
- 50GB disk space (Note that this will leave only around 8GB Local storage for guests disks).
NOTE: if your taking this really seriously you should visit official HCL page on http://hcl.vmd.citrix.com/
You can get all required software in Free edition from https://www.citrix.com/downloads/xenserver/product-software/xenserver-74-free-edition.html (free registration required).
You need to download at least:
-
XenServer-7.4.0-install-cd.iso
- XenServer 7.4.0 Base Installation ISO - Free Edition - this should be installed on your dedicated server -
XenServer-7.4.0-XenCenter.msi
- XenCenter 7.4.0 Windows Management Console - this should be installed on your management Windows
Here are some pros and cons of XenServer when compared to other Hypervisor:
Pros:
- XenServer 7.4 works well on any 64-bit CPU with basic virtualization support (just basic Intel VT or AMD-V is enough - unlike ESXi 6.5 which is very selective). I'm happily running HVM mode VMs on AMD-X2 CPU from 2007 :-)
- optional Para-Virtualization support (PV) for Linux guest - it is fast enough for real use (unlike Qemu++ software emulation - which is usable just for evaluation but not for production) and it works on all 64-bit CPUs without any HW virtualization support.
- PV and drivers supported in most Linux'es out of the box (similarly as support for KVM/Qemu)
- seamless guest OS setup in XenCenter using Templates - it just works. No need to fiddle with VNC vs. SPICE or USB Tablet hack to have working mouse. For Linux guest there is even comfortable button Open SSH console that runs favorite Putty SSH client - really nice.
- Automatic replacement of convenient but slow IDE drivers for Windows (even for boot disk! and even under XP!) after installation (see bellow). A never saw this in other virtualization environment! If you ever tried to change boot disk device on XP you know what I'm talking about.
- guest Suspend/Resume works across XenServer reboot (tested on Win2008R2 Trial guest - suspending on fetching updates and resuming next day)
++) to be honest - even XenServer uses QEMU - for BIOS and some legacy HW emulation.
Cons:
-
many advanced features were removed from XenServer 7.3 Free edition - please see https://xenserver.org/blog/entry/xenserver-7-3-changes-to-the-free-edition.html for official announce.
-
Only XenMotion remained in Free edition (it allows online moving VMs (on shared storage!) in pool from one server to another without any downtime.
-
requires NFS/CIFS (Samba/SMB server) to access ISO images from VMs (however you can use your management Windows to Share ISOs so it is not fatal problem.
-
some Templates have too strict limitations (for example Legacy Windows requires minimum 24GB of disk space which is often overkill for XP - they can run happily on 10GB disk)
-
XenCenter allows only very little on later Edit/Customization of XenServer components.
For Example:
If you change IP address of your NFS server (either Virtual Disk storage or ISO Library) than you need lot of CLI commands to repair that configuration. Please see
-
No Quiesced (filesystem/application) consistent snapshot for Linux. According to https://docs.citrix.com/content/dam/docs/en-us/xenserver/xenserver-7-0/downloads/xenserver-7-0-administrators-guide.pdf section 8.10.2. Quiesced Snapshots only Windows Server 2003 or better are supported. Unlike that Qemu Agent in Proxmox is much more flexible (it can freeze/thaw filesystem on Linux and also can run optional pre-freeze and after-thaw shell script - for example for database consistency). Unsupported OS have only crash-consistent snapshot which is quite unreliable (even on journaled filesystem you may easily lost active files).
-
no online disk resize. There is even one more weird constraint - when any VM on your Local storage (lvm type) is active than you can't resize any disk on this storage. So all VMs on your Local storage must be powered off to do resize(!) in XenCenter.
When I tried from https://discussions.citrix.com/topic/293389-resize-a-xenserver-windows-vm-virtual-disk-without-shutdown/:
xe vdi-resize uuid=MY_VDI_UUID online=true disk-size=9 This function is no longer available.
What?
However Xen Hypervisor (which also contains basic CLI commands) is still entirely free and will likely stay free thanks to GPL that applies to Linux kernel. You can find more information on Xen Hypervisor for example here:
- official homepage https://xenproject.org
- Debian Host+guest guide: https://wiki.xenproject.org/wiki/Xen_Project_Beginners_Guide
There is also alternative to XenServer, here:
- https://xcp-ng.org/ Did not try yet, but surely will do...
- use
Legacy Windows
template - after install do following to properly install Xen Guest tools:
- Eject installation ISO
- select
guest-tools.iso
- after Autorun you would probably get strange error "Use Control panel Add/Remove to install Software"
- you can workaround this to install (in this order):
-
dotNetFx40_Full_x86_x64.exe
.NET 4 Framework (honestly last version that works on XP) -
xenlegacy.exe
Xen legacy tools (tools for older systems than Vista/2008: XP and Windows Server 2003)
Notes for driver magic in Windows. According to https://docs.citrix.com/content/dam/docs/en-us/xenserver/current-release/downloads/xenserver-vm-users-guide.pdf section 2.4. XenServer Tools
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. During the installation 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 allows Windows to complete its installation using built-in drivers, but with reduced performance due to the overhead inherent in emulation of the controller drivers.
So you don't need to worry that you were not asked for driver disk - its IDE drivers are used for installation only and are replaced later with optimized PV driver.
Just install guest-tools.iso
after OS installation.
You are even notified on Search
tab whether you are using optimized drivers.
Tested trial version 7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
.
Install notes:
-
before installing guest tools you need to install
.NET Framework 3.5.1 Feature
in Server Manager -> FeaturesNOTE: Do not check WCF Activation (it is SOA like solution for .NET which requires whole IIS to be installed). WCF is not required by XenCenter
guest-tools.iso
After guest tools install be sure to enable VSS for Quiesced snapshots support. As mentioned in installation guide, run this script:
"%programfiles%\Citrix\XenTools\install-XenProvider.cmd"
NOTE: Please read carefully section 8.10.9.3. Advanced Notes for Quiesced Snapshots of https://docs.citrix.com/content/dam/docs/en-us/xenserver/xenserver-7-0/downloads/xenserver-7-0-administrators-guide.pdf VSS has important shortcomings so be prepared for some problems...
IMPORTANT: After taking Snapshot with Quiesced Filesystem - Always look into Notifications in XenCenter.
Even when you see that Snaphost was taken on Snapshot
tab - in reality there can be error and this
supposed snapshot quietly vanish after a while in XenCenter!
When testing on local storage (200GB SATA disk) I always get dreaded error in Notifications:
The quiesced-snapshot operation failed for an unexpected reason
And in guest Event Log:
0x80042314, The shadow copy provider timed out while holding writes to the volume being shadow copied.
This is probably due to excessive activity on the volume by an application or a system service.
Try again later when activity on the volume is reduced.
So be prepared - on some storage you may be unable to fit 10s limit on VSS hold!
- remember to manually Enable RDP in Windows Firewall using:
- Server Manager -> Configuration -> Windows Firewall with ... > Inbound Rules
- Enable rule Remote Desktop (TCP-in)
- on Server Manager (Top node) click on Configure Remote Desktop
- remember to add yourself to Remote Desktop Users using Select Users...
XenCenter will automatically detect when you enable Remote Desktop Access in your Windows guest and will connect to it. So don't be scared when you see RDP dialog in you Guest Console and accept it.
I use these commands:
-
connect via SSH to Xen Host where is VM (I don't use pools)
-
issue these commands (replace
vm
arg with your VM - you can tryxe vm-list
to see all VMs):mkdir /opt/backups cd /opt/backups xe vm-export vm=CentOS6-32bit metadata=true filename=CentOS6-32bit.meta xe vm-export vm=CentOS6-32bit compress=true filename=CentOS6-32bit.xva
WARNING! The
/
(and thus/opt/
) disk has only about 15GB free space. See tip bellow.... -
backing up to remote CIFS share (
\\192.168.0.50\TEMP
in my example):mkdir /mnt/x mount -t cifs //192.168.0.50/TEMP /mnt/x -o username=xen_share Password for xen_share@//192.168.0.50/TEMP: … # and now export VM there: xe vm-export vm=Win2008R2-MariaBench compress=true \ filename=/mnt/x/00backups/Win2008R2-Trial-MariaBench.xva # umount share once you don't need it umount /mnt/x
Importing VM on XenServer host:
- import VM
cd /opt/backups xe vm-import filename=CentOS6-32bit.xva PRINTS_IMPORTED_VM_UUID
- I don't like that imported VM has same
name-label
, so at least I use:xe vm-param-set uuid=VM_UUID_FROM_VM_IMPORT name-label='CentOS6-32bit-2'
- however even attached disks have same label which is confusing. So I used following:
xe vm-disk-list name-label=CentOS6-32bit-2
...
Disk 0 VDI:
uuid ( RO) : REMEMBER_THIS_VDI_UUID
name-label ( RW): CentOS6-32bit 0
sr-name-label ( RO): Local storage
virtual-size ( RO): 8589934592
...
xe vdi-param-set uuid=ABOVE_VDI_UUID name-label=CentOS6-32bit-2
For testing memory constraints I used following script to import and rename VM and its VDI:
#!/bin/bash
set -ex
vm_prefix=CentOS7MariaBench
for i in 1 2 3 4 5
do
vm_uuid=$(xe vm-import filename=/opt/backups/CentOS7MariaBench.xva)
vm_name="$vm_prefix-$i"
xe vm-param-set uuid=$vm_uuid name-label="$vm_name"
vdi_uuid=$(xe vm-disk-list uuid=$vm_uuid | grep -A 1 VDI: | \
awk -F: '/uuid/{print $2}' | tr -d ' ')
xe vdi-param-set uuid=$vdi_uuid name-label="$vm_name"
done
I plan to relax some template limits (for example minimum 8GB for CentOS). Here is what I can get:
template_uuid=$(xe template-list name-label='CentOS 6 (32-bit)' --minimal)
echo $template_uuid
0a21ac1d-b18f-469e-9fe7-8bb9d0291574
xe template-param-get uuid=$template_uuid param-name=other-config param-key=disks
<provision><disk bootable="true" device="0" size="8589934592" sr="" type="system"/></provision>
Looks promising...
When I installed CentOS 7.4 from ISO (using CentOS 7 template in XenCenter) I suddenly found that CentOS was using 2GB instead for 1GB specified. Also I was unable to change it back to 1GB in XenCenter (it always returned back after edit).
Fortunately in CLI I was able to lower limit to 1GB and then use it in XenCenter:
# use "xe vm-list" to get vm-uuid for your VM
xe vm-param-set uuid=YOUR_VM_UUID memory-static-min=1073741824
After this command I was able to lower CentOS 7 RAM to 1GB in XenCenter
CentOS 7.4 by default switch to ridiculously high console resolution.
Use nomodeset bochs_drm.nomodeset=0
on GRUB_CMDLINE_LINUX
variable in /etc/sysconfig/grub
. You can also remove dumb rhgb quiet
to see Linux boot messages. After edit re-create grub.cfg using:
# this skips foreign OS detection for grub menu - typically useless in VM where is only one OS
chmod a-rx /etc/grub.d/30_os-prober
# this regenerates grub.cfg:
grub2-mkconfig -o /boot/grub2/grub.cfg
I can't understand this but it really happened to me. After experimenting with oVirt I did
clean install of XenSever on same hardware (including same disk) and suddenly my Ethernet
cards were swapped - literally eth0 <=> eth1
. So also Network 0
and Network 1
get swapped.
When I import VM (exported from previous installation of XenServer) I must always remember
to change Network 0
to Network 1
. Hmm....
Please note that these Network cards are integrated on-board so I'm pretty sure that I did not swapped them :-) (Also I have only 1st MAC address registered in my DHCP address so I'm sure that cable remained in same socket).
NOTE: It is even visible in kernel messages (weird!!!):
[ 13.662711] forcedeth 0000:00:09.0 side-6477-eth1: renamed from eth1
[ 13.670245] forcedeth 0000:00:08.0 side-6602-eth0: renamed from eth0
...
[ 39.046593] forcedeth 0000:00:08.0 eth1: renamed from side-6602-eth0
[ 39.088301] forcedeth 0000:00:09.0 eth0: renamed from side-6477-eth1
Fortunately fix is here: https://support.citrix.com/article/CTX135809
I did this on my XenServer node:
interface-rename --list
Name MAC PCI ethN Phys SMBios Driver Version Firmware
eth0 00:16:17:98:a2:c4 0000:00:09.0 eth1 forcedeth 0.64
eth1 00:16:17:98:64:db 0000:00:08.0 eth0 forcedeth 0.64
interface-rename --update eth0=00:16:17:98:64:db eth1=00:16:17:98:a2:c4
INFO [2018-05-01 18:21:03] Performing manual update of rules. Not actually renaming interfaces
INFO [2018-05-01 18:21:03] All done
# then reboot to take change into effect
init 6
After reboot I must reassign Management interface on XenServer console:
- Customize System -> Network and Management Interface
- Configure Management Interface
- select current
eth0
card and follow instruction on screen.
You may then check Network X
assignment in XenCenter
- click on your Server node
- select
Network
tab
And remember - switch back from Network 1
to Network 0
on all VMs (guests). And that's all.
- XenServer 7.4 Free - download page
- SDK guide - best source of XenServer technical terms, structures and blocks - a must read if you want to understand PBD, VBD, SR... - start with section 3.2. Object Model Overview:
- XenServer Hardware Compatibility List (HCL)
- List of features removed from XenServer Free Edition:
- Using multi-core gzip for faster backups:
- Export live VM from snapshot (but beware of filesystem consistency issues under Linux guests!)
- How to backup XenServer itself
Copyright © Henryk Paluch. All rights reserved.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License