Skip to content

Commit 668d9cb

Browse files
Renuka ApteDean Troyer
authored andcommitted
XenServer: Allow static network config for install
Change-Id: Ief24e21fcd8d4cd61296e4b81051d3332314d45c
1 parent 4d70e9e commit 668d9cb

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

tools/xen/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ Of course, use real passwords if this machine is exposed.
5959
ACTIVE_TIMEOUT=45
6060
# Interface on which you would like to access services
6161
HOST_IP_IFACE=ethX
62+
# First time Ubuntu network install params
63+
NETINSTALLIP="dhcp"
64+
NAMESERVERS=""
65+
NETMASK=""
66+
GATEWAY=""
6267
EOF
6368

6469
Step 4: Run ./install_os_domU.sh from the tools/xen directory

tools/xen/scripts/xenoneirictemplate.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
## Author: Renuka Apte <renuka.apte@citrix.com>
66
## This is not an officially supported guest OS on XenServer 6.02
77

8+
BASE_DIR=$(cd $(dirname "$0") && pwd)
9+
source $BASE_DIR/../../../localrc
10+
811
LENNY=$(xe template-list name-label=Debian\ Lenny\ 5.0\ \(32-bit\) --minimal)
912

1013
if [[ -z $LENNY ]] ; then
@@ -22,11 +25,21 @@ for arch in ${arches[@]} ; do
2225
if [[ -n $(xe template-list name-label="$distro ($arch)" params=uuid --minimal) ]] ; then
2326
echo "$distro ($arch)" already exists, Skipping
2427
else
25-
28+
if [ -z $NETINSTALLIP ]
29+
then
30+
echo "NETINSTALLIP not set in localrc"
31+
exit 1
32+
fi
33+
pvargs="-- 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}"
34+
if [ "$NETINSTALLIP" != "dhcp" ]
35+
then
36+
netcfgargs="netcfg/disable_autoconfig=true netcfg/get_nameservers=${NAMESERVERS} netcfg/get_ipaddress=${NETINSTALLIP} netcfg/get_netmask=${NETMASK} netcfg/get_gateway=${GATEWAY} netcfg/confirm_static=true"
37+
pvargs="${pvargs} ${netcfgargs}"
38+
fi
2639
NEWUUID=$(xe vm-clone uuid=$LENNY new-name-label="$distro ($arch)")
2740
xe template-param-set uuid=$NEWUUID other-config:install-methods=http,ftp \
2841
other-config:install-repository=http://archive.ubuntu.net/ubuntu \
29-
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}" \
42+
PV-args="$pvargs" \
3043
other-config:debian-release=oneiric \
3144
other-config:default_template=true
3245

0 commit comments

Comments
 (0)