diff --git a/common.sh.in b/common.sh.in index 267743b..76eebc3 100644 --- a/common.sh.in +++ b/common.sh.in @@ -441,6 +441,7 @@ fi : ${NETWORKS_DIR:="@sysconfdir@/ganeti/instance-image/networks"} : ${OVERLAYS_DIR:="@sysconfdir@/ganeti/instance-image/overlays"} : ${EXPORT_DIR:="/tmp"} +: ${IMPORT_DIR:="/tmp"} : ${IMAGE_DIR:="@localstatedir@/cache/ganeti-instance-image"} : ${IMAGE_DEBUG:="no"} : ${FDISK:="sfdisk"} diff --git a/defaults b/defaults index 52bbd46..bb981e4 100644 --- a/defaults +++ b/defaults @@ -54,6 +54,10 @@ # (default is: /tmp) # EXPORT_DIR="/tmp" +# IMPORT_DIR: directory used when importing an instance +# (default is: /tmp) +# IMPORT_DIR="/tmp" + # ARCH: Define the ARCH of the image to use # Use either x86 or x86_64 # ARCH="" diff --git a/import b/import index aaa8dca..cb3a29b 100755 --- a/import +++ b/import @@ -31,9 +31,9 @@ if [ ! -b $blockdev ]; then CLEANUP+=("$LOSETUP -d $blockdev") fi -TARGET=`mktemp -d` || exit 1 +TARGET=`mktemp -d --tmpdir=${IMPORT_DIR}` || exit 1 CLEANUP+=("rmdir $TARGET") -DUMPDIR=`mktemp -d` || exit 1 +DUMPDIR=`mktemp -d --tmpdir=${IMPORT_DIR}` || exit 1 CLEANUP+=("rm -rf $DUMPDIR") if [ ! "${NOMOUNT}" = "yes" ] ; then