Skip to content

Instantly share code, notes, and snippets.

@hingstarne
Created April 21, 2014 18:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hingstarne/11152619 to your computer and use it in GitHub Desktop.
Save hingstarne/11152619 to your computer and use it in GitHub Desktop.
Script to install an ubuntu trusty tahr template on xenserver
#!/bin/bash
# Script to install a ubuntu trusty tahr 14.04 LTS template on xcp or
# Citrix (TM) Xenserver 5.6 and above.
# Copyright (C) 2014 Arne-Kristian Hingst - All Rights Reserved
# Permission to copy and modify is granted under the eupl license
# http://ec.europa.eu/idabc/servlets/Docbb6d.pdf?id=31979
# Last revised 04/20/2014
#
# Add your favourite mirror here
MIRROR=http://ubuntu.mirror.lrz.de/ubuntu/
# No need to edit something below
UBUNTU=$(xe template-list name-label=Ubuntu\ Precise\ Pangolin\ 12.04\ \(64-bit\) --minimal)
if [[ -z $UBUNTU ]] ; then
UBUNTU=$(xe template-list name-label=Ubuntu\ Lucid\ Lynx\ 10.04\ \(64-bit\) --minimal)
if [[ -z $UBUNTU ]] ; then
echo "Cant find Ubuntu 64bit template, is this on 5.6 or above?"
exit 1
fi
fi
NEWUUID=$(xe vm-clone uuid=$UBUNTU new-name-label="Ubuntu Trusty Tahr 14.04 (64-bit)")
xe template-param-set uuid=$NEWUUID other-config:install-methods=http,ftp,nfs other-config:default_template=true
xe template-param-set uuid=$NEWUUID other-config:install-methods=http other-config:debian-release=trusty
xe vm-param-set uuid=$NEWUUID other-config-install-repository=$MIRROR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment