From ea54b3e021a4b04f5407992f5a2f7030e82a9df8 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 4 Jun 2020 11:56:29 +0200 Subject: [PATCH] better_compatibility --- copy_containers | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copy_containers b/copy_containers index 4b58a62..99c94d4 100755 --- a/copy_containers +++ b/copy_containers @@ -156,7 +156,8 @@ echo "Setting up mountpoint on destination for "$CONT_VAR"" ssh "$DEST_IP" -p $DEST_PORT zfs set canmount=noauto "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" ssh "$DEST_IP" -p $DEST_PORT zfs set mountpoint=/var/snap/lxd/common/lxd/storage-pools/"$DEST_ZPOOL_2"/containers/"$CONT_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" ssh "$DEST_IP" -p $DEST_PORT zfs mount "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -ssh "$DEST_IP" -p $DEST_PORT "nsenter -t \$(cat /var/snap/lxd/common/lxd.pid) -m bash -c \"mount -t zfs "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" /var/snap/lxd/common/lxd/storage-pools/"$DEST_ZPOOL_2"/containers/"$CONT_VAR"\"" +REMOTE_LXD_PID=$(ssh "$DEST_IP" -p $DEST_PORT cat /var/snap/lxd/common/lxd.pid) +ssh "$DEST_IP" -p $DEST_PORT "nsenter -t $REMOTE_LXD_PID -m bash -c \"mount -t zfs "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" /var/snap/lxd/common/lxd/storage-pools/"$DEST_ZPOOL_2"/containers/"$CONT_VAR"\"" echo "Importing "$CONT_VAR" on destination" ssh "$DEST_IP" -p $DEST_PORT /snap/bin/lxd import "$CONT_VAR" --force