Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add IMPORT_DIR and use in import script #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
4 changes: 4 additions & 0 deletions defaults
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
4 changes: 2 additions & 2 deletions import
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down