Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save lambdacpp/5864464 to your computer and use it in GitHub Desktop.

Select an option

Save lambdacpp/5864464 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Script to install a debian wheezy template on xcp 1.1 and above, or
# Citrix (TM) Xenserver 5.6 and above.
# Copyright (C) 2012 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/04/2013
#
# Add your favourite mirror here
MIRROR=http://ftp.de.debian.org/debian/
# No need to edit something below
SQUEEZE=$(xe template-list name-label=Debian\ Squeeze\ 6.0\ \(64-bit\) --minimal)
if [[ -z $SQUEEZE ]] ; then
SQUEEZE=$(xe template-list name-label=Debian\ Squeeze\ 6.0\ \(64-bit\)\ \(experimental\) --minimal)
if [[ -z $SQUEEZE ]] ; then
echo "Cant find Squeeze 64bit template, is this on 5.6 or above?"
exit 1
fi
fi
NEWUUID=$(xe vm-clone uuid=$SQUEEZE new-name-label="Debian Wheezy 7.0 (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=wheezy
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