Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 39 lines (29 sloc) 0.816 kb
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a256...
Xen hg user authored
1 #!/bin/bash
2 #
3 # Copyright (c) Citrix Systems 2008. All rights reserved.
4 #
5
6 set -e
7
8 usage () {
9 echo Usage: $0 host:/directory [mount options]
10 echo Create a shared SR which mounts a remote ISO repository.
11 exit 1
12 }
13
14 if [ -z "$1" ]; then
15 usage
16 else
17 LOCATION="$1"
18 fi
19 shift 1
20 OPTIONS=$*
21
13b8348 @jonludlam Move everything over to using Fhs.ml / @ substitution
jonludlam authored
22 XE="@BINDIR@/xe"
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a256...
Xen hg user authored
23 UUID=$(uuidgen)
24
25 SR=$(${XE} sr-introduce name-label="Remote ISO Library on: ${LOCATION}" content-type=iso shared=true type=iso uuid=${UUID} physical-size=0)
26 ${XE} sr-param-set other-config:auto-scan=true uuid=${UUID}
27
13b8348 @jonludlam Move everything over to using Fhs.ml / @ substitution
jonludlam authored
28 . @INVENTORY@
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a256...
Xen hg user authored
29
30 PBD=$(${XE} pbd-create host-uuid=${INSTALLATION_UUID} sr-uuid=$SR device-config:location="${LOCATION}" device-config:options="${OPTIONS}")
31
32 destroy () {
33 xe pbd-destroy uuid=${PBD}
34 xe sr-forget uuid=${SR}
35 exit 1
36 }
37
38 xe pbd-plug uuid=${PBD} &>/dev/null || destroy
Something went wrong with that request. Please try again.