Mount storage volumes only on btcpayserver.

This commit is contained in:
Derek Smith 2023-03-20 20:12:25 -04:00
parent ba153765a7
commit 0ede72d556
Signed by: farscapian
GPG Key ID: B443E530A14E1C90

View File

@ -40,16 +40,16 @@ if ! lxc list --format csv | grep -q "$LXD_VM_NAME"; then
# and so we can set DNS internally.
lxc config set "$LXD_VM_NAME" "volatile.enp5s0.hwaddr=$MAC_ADDRESS_TO_PROVISION"
lxc config device override "$LXD_VM_NAME" root size="${ROOT_DISK_SIZE_GB}GB"
# # attach any volumes
# for CHAIN in testnet mainnet; do
# for DATA in blocks chainstate; do
# MOUNT_PATH="/$CHAIN-$DATA"
# if lxc storage volume list ss-base -q --format csv -c n | grep -q "$CHAIN-$DATA/snap0"; then
# lxc storage volume attach ss-base "$CHAIN-$DATA" "$LXD_VM_NAME" "$MOUNT_PATH"
# fi
# done
# done
if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then
# attach any volumes
for CHAIN in testnet mainnet; do
for DATA in blocks chainstate; do
MOUNT_PATH="/$CHAIN-$DATA"
lxc config device add "$LXD_VM_NAME" "$CHAIN-$DATA" disk pool=ss-base source="$CHAIN-$DATA" path="$MOUNT_PATH"
done
done
fi
lxc start "$LXD_VM_NAME"
sleep 10