Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: assert-can-mig…
Fetching contributors…

Cannot retrieve contributors at this time

executable file 38 lines (29 sloc) 0.816 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#!/bin/bash
#
# Copyright (c) Citrix Systems 2008. All rights reserved.
#

set -e

usage () {
  echo Usage: $0 host:/directory [mount options]
  echo Create a shared SR which mounts a remote ISO repository.
  exit 1
}

if [ -z "$1" ]; then
  usage
else
  LOCATION="$1"
fi
shift 1
OPTIONS=$*

XE="@BINDIR@/xe"
UUID=$(uuidgen)

SR=$(${XE} sr-introduce name-label="Remote ISO Library on: ${LOCATION}" content-type=iso shared=true type=iso uuid=${UUID} physical-size=0)
${XE} sr-param-set other-config:auto-scan=true uuid=${UUID}

. @INVENTORY@

PBD=$(${XE} pbd-create host-uuid=${INSTALLATION_UUID} sr-uuid=$SR device-config:location="${LOCATION}" device-config:options="${OPTIONS}")

destroy () {
    xe pbd-destroy uuid=${PBD}
    xe sr-forget uuid=${SR}
    exit 1
}

xe pbd-plug uuid=${PBD} &>/dev/null || destroy
Something went wrong with that request. Please try again.