Forked from jniltinho/xenserver_create_jessie_template_64bit.sh
Last active
April 10, 2016 17:15
-
-
Save gnanet/7e14d834515cf07335265de9d8a794ec to your computer and use it in GitHub Desktop.
Script to install a Debian Jessie 8 template on Xenserver 6.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Script to install a Debian Jessie 8 template on Xenserver 6.5 | |
## https://gist.github.com/jniltinho/0455fb5f01cfd8bbdbff | |
# Check if we are running on XenServer 6.5 | |
CHECK65=`cat /etc/redhat-release | grep "XenServer release 6.5"` | |
if [ "x${CHECK65}" == "x" ]; then echo "This script is intended to be run on XenServer 6.5"; exit 1; fi | |
# The redirector aims to solve the problem of choosing a Debian mirror. | |
# Read more at http://httpredir.debian.org/ | |
MIRROR=http://httpredir.debian.org/debian/ | |
# No need to edit something below | |
WHEEZY=$(xe template-list name-label=Debian\ Wheezy\ 7.0\ \(64-bit\) --minimal) | |
if [[ -z $WHEEZY ]] ; then | |
WHEEZY=$(xe template-list name-label=Debian\ Wheezy\ 7.0\ \(64-bit\)\ \(experimental\) --minimal) | |
if [[ -z $WHEEZY ]] ; then | |
echo "Cant find Wheezy 64bit template, is this on 6.5 or above?" | |
exit 1 | |
fi | |
fi | |
NEWUUID=$(xe vm-clone uuid=$WHEEZY new-name-label="Debian Jessie 8 (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=jessie | |
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