Citrix XenServer VM’s Unmanageable

Problem:

 

Xen begins throwing errors about not being able to attach VDIs, XenMotion stops working, and the system becomes unmanageable, or xapi service immediately dies after starting

 

 

Solution:

check space on dom0

df -h

If this is at a high threshold you may want to do the following:

Remove patches from /var/patch

cd /var/patch
rm <uuid of patch>

Remove old log files

rm -rf /var/log/*.gz

Clean temp log files

rm -rf /tmp/*.log

Cleanup any old patches

xe patch-clean

Clean out /var/log/btmp

echo > /var/log/btmp

Restart Xen Toolstack

xe-toolstack-restart

 

Re-occurance Prevention:

Create a mounted volume for /var/log or do the following:

in /etc/cron.daily create the following script called logclean.sh

#!/bin/bash
rm -rf /var/log/*.gz

Then change permissions to make it executable

chmod 700/etc/cron.daily/logclean.sh

Another alternative would be to setup an NFS mount in /var/log, however I already use a centralized log aggregation solution so this cron job while a fairly blunt instrument meets my needs.

Enabling PXE Boot for Citrix XenServer VMs

Seasons greetings! i’ve been doing some testing with Cobbler deployment in my lab and ran into a minor snag getting Citrix XenServer VMs to PXE boot. Below are the steps to enable boot options for XenServer Guest VMs to utilize PXE:

 

List VMs

List VMs and make note of the UUID for the VM in question

xe vm-list

 

Setting HVM Boot Options

Using the UUID from the command above change the boot options to enable HVM mode booting and set the boot order to disk then network

xe vm-param-set uuid=<your UUID> HVM-boot-policy="BIOS order"
xe vm-param-set uuid=<your UUID HVM-boot-params:order=cn

 

Start The VM

xe vm-start uuid=<your UUID

 

Increasing Screen Resolution of VMs in Citrix XenServer 6.x

In my home lab I have a whole host of servers, the one I run all my home production off of is a Citrix XenServer 6.5 box running on a Dell PowerEdge R415. Recently I had a friend ask me to setup a Windows 7 VM for them to use with TeamViewer for their Quickbooks accounting and tie it into my offsite backups. This is ordinarily a non-issue for me as most of my VMs are Linux and the handful of Windows VMs I run are typically used via RDP. Upon setting up this VM with TeamViewer I discovered that TeamViewer would not allow the resolution to go beyond the limitations of the supported VM resolution. While the default 800×600 or 1024×768 has never been a problem, it did prove problematic in this case. I was able to find a workable solution however, which i was the change several of the video related VM parameters in the CLI on the Citrix host.

Below is a screenshot of the resolution options before making the change.
Screen Shot 2015-11-07 at 2.55.44 PM

To Make Changes

[root@intrepid ~]# xe vm-shutdown uuid=
[root@intrepid ~]# xe vm-param-set uuid= platform:vga=std
[root@intrepid ~]# xe vm-param-set uuid= platform:videoram=16
[root@intrepid ~]# xe vm-start uuid=

 

To Roll Back

[root@intrepid ~]# xe vm-param-remove uuid= param-name=platform param-key=vga
[root@intrepid ~]# xe vm-param-remove uuid= param-name=platform param-key=videoram

 

Below are the results resolution options after making the changes
Screen Shot 2015-11-07 at 2.56.39 PM