From 138742c9536da87ac119a414a906d0d19576c6e1 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 28 Sep 2025 18:22:44 +0200 Subject: [PATCH] feat: Increase default disksize (#1030) --- Dockerfile | 2 +- compose.yml | 2 +- kubernetes.yml | 4 ++-- readme.md | 31 ++++++------------------------- src/disk.sh | 8 ++------ 5 files changed, 12 insertions(+), 35 deletions(-) diff --git a/Dockerfile b/Dockerfile index 66c9313..49ddbc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,7 +66,7 @@ EXPOSE 22 139 445 5000 ENV RAM_SIZE="2G" ENV CPU_CORES="2" -ENV DISK_SIZE="16G" +ENV DISK_SIZE="256G" HEALTHCHECK --interval=60s --start-period=45s --retries=2 CMD /run/check.sh diff --git a/compose.yml b/compose.yml index 4de54bf..54ea70d 100644 --- a/compose.yml +++ b/compose.yml @@ -3,7 +3,7 @@ services: container_name: dsm image: vdsm/virtual-dsm environment: - DISK_SIZE: "16G" + DISK_SIZE: "256G" devices: - /dev/kvm - /dev/net/tun diff --git a/kubernetes.yml b/kubernetes.yml index 97a04db..f356a95 100644 --- a/kubernetes.yml +++ b/kubernetes.yml @@ -8,7 +8,7 @@ spec: - ReadWriteOnce resources: requests: - storage: 16Gi + storage: 256Gi --- apiVersion: apps/v1 kind: Deployment @@ -31,7 +31,7 @@ spec: image: vdsm/virtual-dsm env: - name: DISK_SIZE - value: "16G" + value: "256G" ports: - containerPort: 5000 name: http diff --git a/readme.md b/readme.md index 862b708..66a38bb 100644 --- a/readme.md +++ b/readme.md @@ -30,7 +30,7 @@ services: container_name: dsm image: vdsm/virtual-dsm environment: - DISK_SIZE: "16G" + DISK_SIZE: "256G" devices: - /dev/kvm - /dev/net/tun @@ -47,7 +47,7 @@ services: ##### Via Docker CLI: ```bash -docker run -it --rm --name dsm -p 5000:5000 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/dsm:/storage" --stop-timeout 120 vdsm/virtual-dsm +docker run -it --rm --name dsm -e "DISK_SIZE=256G" -p 5000:5000 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/dsm:/storage" --stop-timeout 120 vdsm/virtual-dsm ``` ##### Via Kubernetes: @@ -87,35 +87,24 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m ### How do I change the size of the disk? - To expand the default size of 16 GB, locate the `DISK_SIZE` setting in your compose file and modify it to your preferred capacity: + To expand the default size of 256 GB, locate the `DISK_SIZE` setting in your compose file and modify it to your preferred capacity: ```yaml environment: - DISK_SIZE: "128G" + DISK_SIZE: "512G" ``` > [!TIP] > This can also be used to resize the existing disk to a larger capacity without any data loss. -### How do I create a growable disk? - - By default, the entire capacity of the disk will be reserved in advance. - - To create a growable disk that only allocates space that is actually used, add the following environment variable: - - ```yaml - environment: - DISK_FMT: "qcow2" - ``` - ### How do I add multiple disks? To create additional disks, modify your compose file like this: ```yaml environment: - DISK2_SIZE: "32G" - DISK3_SIZE: "64G" + DISK2_SIZE: "500G" + DISK3_SIZE: "750G" volumes: - ./example2:/storage2 - ./example3:/storage3 @@ -263,14 +252,6 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m There are only two minor differences: the Virtual Machine Manager package is not available, and Surveillance Station will not include any free licenses. -### How do I run Windows in a container? - - You can use [dockur/windows](https://github.com/dockur/windows) for that. It shares many of the same features, and even has completely automatic installation. - -### How do I run a Linux desktop in a container? - - You can use [qemus/qemu](https://github.com/qemus/qemu) in that case. - ### Is this project legal? Yes, this project contains only open-source code and does not distribute any copyrighted material. Neither does it try to circumvent any copyright protection measures. So under all applicable laws, this project will be considered legal. diff --git a/src/disk.sh b/src/disk.sh index 7cd23df..80e932b 100644 --- a/src/disk.sh +++ b/src/disk.sh @@ -535,11 +535,7 @@ case "${DISK_TYPE,,}" in esac if [ -z "$ALLOCATE" ]; then - if [[ "${DISK_FMT,,}" == "raw" ]]; then - ALLOCATE="Y" - else - ALLOCATE="N" - fi + ALLOCATE="N" fi if [[ "$ALLOCATE" == [Nn]* ]]; then @@ -554,7 +550,7 @@ DISK_OPTS+=$(createDevice "$BOOT" "$DISK_TYPE" "1" "0xa" "raw" "$DISK_IO" "$DISK DISK_OPTS+=$(createDevice "$SYSTEM" "$DISK_TYPE" "2" "0xb" "raw" "$DISK_IO" "$DISK_CACHE" "" "") DISK1_FILE="$STORAGE/${DISK_NAME}" -if [[ ! -f "$DISK1_FILE.img" && -f "$STORAGE/data${DISK_SIZE}.img" ]]; then +if [ ! -f "$DISK1_FILE.img" ] && [ -f "$STORAGE/data${DISK_SIZE}.img" ]; then # Fallback for legacy installs mv "$STORAGE/data${DISK_SIZE}.img" "$DISK1_FILE.img" fi