Blog

XenServer 6 Auto-Start VMs

Saturday 7 January 2012 - 6 comments

In XenServer 6, Citrix made the decision to not include the option anymore to auto-start VM's when the XenServer host boots up. The reason is that this feature interfered with the HA and Failover capabilities, but nonetheless it was a nice feature for situations where only one XenServer host is used.

In XenServer 6 it is possible to auto-start VM's but it requires enabling the auto-start feature at the pool level and on each individual VM by using the CLI which is not very user friendly. Therefore, we have created a script that runs during startup of the host and will start any VM that has been tagged with the "autostart" tag. This allows for easy administration using XenCenter.

In order to install the script,  copy the contents below to the end of the /etc/rc.d/rc.local file on the XenServer host, using for example WinSCP.  Afterwards just tag the VM's you would want to auto-start using the tag "autostart". The VM's will be started with a 20 second delay between each VM.

 

# AutoStart VM's that are tagged with autostart tag
# Script created by Raido Consultants - http://www.raido.be
TAG="autostart"
# helper function
function xe_param()
{
PARAM=$1
while read DATA; do
LINE=$(echo $DATA | egrep "$PARAM")
if [ $? -eq 0 ]; then
echo "$LINE" | awk 'BEGIN{FS=": "}{print $2}'
fi
done
}
# Get all VMs
sleep 20
VMS=$(xe vm-list is-control-domain=false | xe_param uuid)
for VM in $VMS; do
echo "Raido AutoStart Script : Checking VM $VM"
VM_TAGS="$(xe vm-param-get uuid=$VM param-name=tags)"
if [[ $VM_TAGS == *$TAG* ]]
then
echo "starting VM $VM"
sleep 20
xe vm-start uuid=$VM
fi
done



Update: This script will do the same with vApps. If "autostart" is in the description of a vApp it will start the vApp during boot. Within a vApp you can specify multiple VM's and their boot order.
# AutoStart Vapp's that have autostart in description
# Script created by Raido Consultants - http://www.raido.be 
TAG="autostart"
# helper function
function xe_param()
{
PARAM=$1
while read DATA; do
LINE=$(echo $DATA | egrep "$PARAM")
if [ $? -eq 0 ]; then
echo "$LINE" | awk 'BEGIN{FS=": "}{print $2}'
fi
done
}
# Get all Applicances
sleep 20
VAPPS=$(xe appliance-list | xe_param uuid)
for VAPP in $VAPPS; do
echo "Raido AutoStart : Checking vApp $VAPP"
VAPP_TAGS="$(xe appliance-param-get uuid=$VAPP param-name=name-description)"
if [[ $VAPP_TAGS == *$TAG* ]]
then
echo "starting vApp $VAPP"
xe appliance-start uuid=$VAPP
sleep 20
fi
done

 

 

Written by Frank Vandebergh in category: Citrix. Tags: , , ,

By Default, users connecting to a XenApp server will have their client printers automatically mapped using the citrix universal print driver. All client printers are mapped including any PDF printers the client has installed. This might give you unwanted network traffic as it is much slower to print to PDF on a client mapped printer compared to a PDF printer installed on the Xenapp server. Also we have seen issues at customers where those 'special' printers were mapped and giving problems, even crashing the print spooler.

The solution is to create a list of printer drivers that are blocked so that these printers are not created automatically in the session. This is the procedure to block these drivers:

Within Citrix Delivery Services console, create or edit a User policy. Within this policy navigate to Printing > Drivers > "Printer Driver mapping and compatibility

Edit the Printer mapping and compatibility and add the printer drivers you want to block. Use "Do Not Create" as the action.

Here is a list of common printer drivers you can block:

  • Send To Microsoft OneNote Driver
  • Microsoft Office Document Image Writer Driver
  • pdfFactory 2
  • Amyuni Document Converter 400
  • Microsoft XPS Document Writer
  • PDFCreator
  • CutePDF Writer
  • Send To Microsoft OneNote 2010 Driver

Written by Frank Vandebergh in category: Citrix. Tags: , , ,

This whitepaper shows how you can extend the functionality of Citrix WebInterface in order to filter applications based on tags in the description field of a published application. Applications can be shown or hidden on a per-web interface site level. Both filtering of normal web interface sites as Xenapp Services sites is supported.

Download here

Written by Frank Vandebergh in category: Citrix. Tags: , , , , ,

The goal of this document is to point out that there are still a lot of differences between Microsoft Remote Desktop Services and Citrix Xenapp. Microsoft Remote Desktops has improved a lot (a lot of extra features are added to the latest version), but it still doesn’t replace Citrix Xenapp at all.

Written by Bob Deleeck in category: Citrix.