Skip to content

Instantly share code, notes, and snippets.

@thapakazi
Forked from hingstarne/xenserver_create_tahr.sh
Created August 27, 2014 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thapakazi/ddfe2f7f587b3f542b9f to your computer and use it in GitHub Desktop.
Save thapakazi/ddfe2f7f587b3f542b9f to your computer and use it in GitHub Desktop.
#!/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.ntc.net.np
# 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