diff --git a/create_lxc_base.sh b/create_lxc_base.sh index c1ef44c..5e043f7 100755 --- a/create_lxc_base.sh +++ b/create_lxc_base.sh @@ -27,6 +27,12 @@ else # TODO move this sovereign-stack-base construction VM to separate dedicated IP lxc config set "$BASE_IMAGE_VM_NAME" + # for CHAIN in mainnet testnet; do + # for DATA in blocks chainstate; do + # lxc storage volume attach ss-base "$CHAIN-$DATA" "$BASE_IMAGE_VM_NAME" "/home/ubuntu/$CHAIN/$DATA" + # done + # done + lxc start "$BASE_IMAGE_VM_NAME" sleep 15 @@ -39,6 +45,13 @@ else sleep 3 + + # for CHAIN in testnet mainnet; do + # for DATA in blocks chainstate; do + # lxc file push --recursive --project=default "/home/ubuntu/.ss/cache/bitcoin/$CHAIN/$DATA/" "$BASE_IMAGE_VM_NAME/home/ubuntu/$CHAIN/$DATA/" + # done + # done + # stop the VM and get a snapshot. lxc stop "$BASE_IMAGE_VM_NAME" lxc snapshot "$BASE_IMAGE_VM_NAME" "$UBUNTU_BASE_IMAGE_NAME" @@ -46,3 +59,5 @@ else fi lxc publish --public "$BASE_IMAGE_VM_NAME/$UBUNTU_BASE_IMAGE_NAME" --project=default --alias="$DOCKER_BASE_IMAGE_NAME" + +lxc delete -f "$BASE_IMAGE_VM_NAME" diff --git a/stub_lxc_profile.sh b/stub_lxc_profile.sh index 9d8a19a..37fd0e4 100755 --- a/stub_lxc_profile.sh +++ b/stub_lxc_profile.sh @@ -40,6 +40,14 @@ config: EOF +if [ "$VIRTUAL_MACHINE" = base ]; then + cat >> "$YAML_PATH" <> "$YAML_PATH" <