blob: 003acd578140045f38365f8685517d8c04f6567a [file] [log] [blame]
Renuka Apte4c889342012-03-08 13:15:03 -08001#!/bin/bash
2## makeubuntu.sh, this creates Ubuntu server 11.10 32 and 64 bit templates
3## on Xenserver 6.0.2 Net install only
4## Original Author: David Markey <david.markey@citrix.com>
5## Author: Renuka Apte <renuka.apte@citrix.com>
6## This is not an officially supported guest OS on XenServer 6.02
7
8LENNY=$(xe template-list name-label=Debian\ Lenny\ 5.0\ \(32-bit\) --minimal)
9
10if [[ -z $LENNY ]] ; then
11 echo "Cant find lenny 32bit template, is this on 6.0.2?"
12 exit 1
13fi
14
15distro="Ubuntu 11.10"
16arches=("32-bit" "64-bit")
17
Renuka Apte360e29b2012-04-09 16:24:53 -070018preseedurl=${1:-"http://images.ansolabs.com/devstackubuntupreseed.cfg"}
Renuka Apte4c889342012-03-08 13:15:03 -080019
20for arch in ${arches[@]} ; do
21 echo "Attempting $distro ($arch)"
22 if [[ -n $(xe template-list name-label="$distro ($arch)" params=uuid --minimal) ]] ; then
23 echo "$distro ($arch)" already exists, Skipping
24 else
25
26 NEWUUID=$(xe vm-clone uuid=$LENNY new-name-label="$distro ($arch)")
27 xe template-param-set uuid=$NEWUUID other-config:install-methods=http,ftp \
28 other-config:install-repository=http://archive.ubuntu.net/ubuntu \
Renuka Apte360e29b2012-04-09 16:24:53 -070029 PV-args="-- quiet console=hvc0 partman/default_filesystem=ext3 locale=en_US console-setup/ask_detect=false keyboard-configuration/layoutcode=us netcfg/choose_interface=eth3 netcfg/get_hostname=os netcfg/get_domain=os auto url=${preseedurl}" \
Renuka Apte4c889342012-03-08 13:15:03 -080030 other-config:debian-release=oneiric \
31 other-config:default_template=true
32
33 if [[ "$arch" == "32-bit" ]] ; then
34 xe template-param-set uuid=$NEWUUID other-config:install-arch="i386"
35 else
36 xe template-param-set uuid=$NEWUUID other-config:install-arch="amd64"
37 fi
38 echo "Success"
39 fi
40done
41
42echo "Done"