Unverified Commit 138742c9 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Increase default disksize (#1030)

parent 2c6efc45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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

+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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
+6 −25
Original line number Diff line number Diff line
@@ -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. 
+2 −6
Original line number Diff line number Diff line
@@ -535,12 +535,8 @@ case "${DISK_TYPE,,}" in
esac

if [ -z "$ALLOCATE" ]; then
  if [[ "${DISK_FMT,,}" == "raw" ]]; then
    ALLOCATE="Y"
  else
  ALLOCATE="N"
fi
fi

if [[ "$ALLOCATE" == [Nn]* ]]; then
  DISK_STYLE="growable"
@@ -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