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
diff --git a/tools/xen/scripts/install_ubuntu_template.sh b/tools/xen/scripts/install_ubuntu_template.sh
index 00cabb0..b7a8eff 100755
--- a/tools/xen/scripts/install_ubuntu_template.sh
+++ b/tools/xen/scripts/install_ubuntu_template.sh
@@ -69,11 +69,16 @@
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='<provision><disk device="0" size="'$disk_size'" sr="" bootable="true" type="system"/></provision>' \
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"