blob: baf4866ad3f13a30cb98f5a1ec6e4df47966d1c8 [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
18
19for arch in ${arches[@]} ; do
20 echo "Attempting $distro ($arch)"
21 if [[ -n $(xe template-list name-label="$distro ($arch)" params=uuid --minimal) ]] ; then
22 echo "$distro ($arch)" already exists, Skipping
23 else
24
25 NEWUUID=$(xe vm-clone uuid=$LENNY new-name-label="$distro ($arch)")
26 xe template-param-set uuid=$NEWUUID other-config:install-methods=http,ftp \
27 other-config:install-repository=http://archive.ubuntu.net/ubuntu \
28 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=unassigned-hostname netcfg/get_domain=unassigned-domain auto url=http://images.ansolabs.com/devstackubuntupreseed.cfg" \
29 other-config:debian-release=oneiric \
30 other-config:default_template=true
31
32 if [[ "$arch" == "32-bit" ]] ; then
33 xe template-param-set uuid=$NEWUUID other-config:install-arch="i386"
34 else
35 xe template-param-set uuid=$NEWUUID other-config:install-arch="amd64"
36 fi
37 echo "Success"
38 fi
39done
40
41echo "Done"