From d3740f70b52763d547d2a1d861829e6f853775bc Mon Sep 17 00:00:00 2001 From: Mate Lakat Date: Thu, 9 May 2013 15:02:21 +0100 Subject: [PATCH] xenapi: Ubuntu installation repository/proxy fix Get rid of UBUNTU_INST_REPOSITORY, use UBUNTU_INST_HTTP_HOSTNAME and UBUNTU_INST_HTTP_DIRECTORY instead. User can also specify UBUNTU_INST_HTTP_PROXY to utilize a proxy for the OpenStack VM installation. The answer file will be edited to contain the specified values. Also get rid of the magic, undocumented MIRROR variable. This is related to blueprint xenapi-devstack-cleanup Change-Id: Ic9fc564c4ad0f43e2e536854335ebe14791d0255 --- tools/xen/install_os_domU.sh | 11 ++++++----- tools/xen/scripts/install_ubuntu_template.sh | 7 ++++++- tools/xen/xenrc | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh index bcea939932..0e194fe973 100755 --- a/tools/xen/install_os_domU.sh +++ b/tools/xen/install_os_domU.sh @@ -250,11 +250,12 @@ if [ -z "$templateuuid" ]; then mkdir -p $HTTP_SERVER_LOCATION fi cp -f $THIS_DIR/devstackubuntupreseed.cfg $HTTP_SERVER_LOCATION - MIRROR=${MIRROR:-""} - if [ -n "$MIRROR" ]; then - sed -e "s,d-i mirror/http/hostname string .*,d-i mirror/http/hostname string $MIRROR," \ - -i "${HTTP_SERVER_LOCATION}/devstackubuntupreseed.cfg" - fi + + sed \ + -e "s,\(d-i mirror/http/hostname string\).*,\1 $UBUNTU_INST_HTTP_HOSTNAME,g" \ + -e "s,\(d-i mirror/http/directory string\).*,\1 $UBUNTU_INST_HTTP_DIRECTORY,g" \ + -e "s,\(d-i mirror/http/proxy string\).*,\1 $UBUNTU_INST_HTTP_PROXY,g" \ + -i "${HTTP_SERVER_LOCATION}/devstackubuntupreseed.cfg" fi # Update the template diff --git a/tools/xen/scripts/install_ubuntu_template.sh b/tools/xen/scripts/install_ubuntu_template.sh index 00cabb038d..b7a8eff952 100755 --- a/tools/xen/scripts/install_ubuntu_template.sh +++ b/tools/xen/scripts/install_ubuntu_template.sh @@ -69,11 +69,16 @@ fi xe template-param-set uuid=$new_uuid \ other-config:install-methods=http \ - other-config:install-repository="$UBUNTU_INST_REPOSITORY" \ + other-config:install-repository="http://${UBUNTU_INST_HTTP_HOSTNAME}${UBUNTU_INST_HTTP_DIRECTORY}" \ PV-args="$pvargs" \ other-config:debian-release="$UBUNTU_INST_RELEASE" \ other-config:default_template=true \ other-config:disks='' \ other-config:install-arch="$UBUNTU_INST_ARCH" +if ! [ -z "$UBUNTU_INST_HTTP_PROXY" ]; then + xe template-param-set uuid=$new_uuid \ + other-config:install-proxy="$UBUNTU_INST_HTTP_PROXY" +fi + echo "Ubuntu template installed uuid:$new_uuid" diff --git a/tools/xen/xenrc b/tools/xen/xenrc index 1956623a81..e50f954715 100644 --- a/tools/xen/xenrc +++ b/tools/xen/xenrc @@ -64,7 +64,9 @@ UBUNTU_INST_TEMPLATE_NAME="Ubuntu 11.10 (64-bit) for DevStack" # XenServer 6.1 and later or XCP 1.6 or later # 11.10 is only really supported with XenServer 6.0.2 and later UBUNTU_INST_ARCH="amd64" -UBUNTU_INST_REPOSITORY="http://archive.ubuntu.net/ubuntu" +UBUNTU_INST_HTTP_HOSTNAME="archive.ubuntu.net" +UBUNTU_INST_HTTP_DIRECTORY="/ubuntu" +UBUNTU_INST_HTTP_PROXY="" UBUNTU_INST_LOCALE="en_US" UBUNTU_INST_KEYBOARD="us" # network configuration for ubuntu netinstall