mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-04 07:27:19 +08:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1b8054e847 | ||
|
631a558a9f | ||
|
d5805b4e08 | ||
|
1dc15ce2e0 | ||
|
4145e811df | ||
|
fe8615d7d3 | ||
|
27ea5506bc |
2
.github/ISSUE_TEMPLATE/1-issue.yml
vendored
2
.github/ISSUE_TEMPLATE/1-issue.yml
vendored
@ -21,6 +21,7 @@ body:
|
||||
attributes:
|
||||
label: Docker compose
|
||||
description: The compose file (or otherwise the `docker run` command used).
|
||||
render: yaml
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
@ -28,6 +29,7 @@ body:
|
||||
attributes:
|
||||
label: Docker log
|
||||
description: The logfile of the container (as shown by `docker logs dsm`).
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
2
.github/ISSUE_TEMPLATE/3-bug.yml
vendored
2
.github/ISSUE_TEMPLATE/3-bug.yml
vendored
@ -23,6 +23,7 @@ body:
|
||||
attributes:
|
||||
label: Docker compose
|
||||
description: The compose file (or otherwise the `docker run` command used).
|
||||
render: yaml
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
@ -30,6 +31,7 @@ body:
|
||||
attributes:
|
||||
label: Docker log
|
||||
description: The logfile of the container (as shown by `docker logs dsm`).
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
@ -61,9 +61,9 @@ ADD --chmod=775 https://raw.githubusercontent.com/sud0woodo/patology/refs/heads/
|
||||
VOLUME /storage
|
||||
EXPOSE 22 139 445 5000
|
||||
|
||||
ENV RAM_SIZE="1G"
|
||||
ENV RAM_SIZE="2G"
|
||||
ENV CPU_CORES="2"
|
||||
ENV DISK_SIZE="16G"
|
||||
ENV CPU_CORES="1"
|
||||
|
||||
HEALTHCHECK --interval=60s --start-period=45s --retries=2 CMD /run/check.sh
|
||||
|
||||
|
@ -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 -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:
|
||||
@ -135,7 +135,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
|
||||
|
||||
### How do I change the amount of CPU or RAM?
|
||||
|
||||
By default, the container will be allowed to use a maximum of 1 CPU core and 1 GB of RAM.
|
||||
By default, the container will be allowed to use a maximum of 2 CPU cores and 2 GB of RAM.
|
||||
|
||||
If you want to adjust this, you can specify the desired amount using the following environment variables:
|
||||
|
||||
|
@ -320,7 +320,7 @@ convertDisk() {
|
||||
|
||||
msg="Conversion of $DISK_DESC"
|
||||
html "$msg completed..."
|
||||
info "$msg to $DST_FMT completed succesfully!"
|
||||
info "$msg to $DST_FMT completed successfully!"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ set -Eeuo pipefail
|
||||
: "${DISPLAY:="none"}" # Display type
|
||||
: "${RENDERNODE:="/dev/dri/renderD128"}" # Render node
|
||||
|
||||
if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then
|
||||
CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}')
|
||||
|
||||
if [[ "$GPU" != [Yy1]* ]] || [[ "$CPU_VENDOR" != "GenuineIntel" ]] || [[ "$ARCH" != "amd64" ]]; then
|
||||
|
||||
[[ "${DISPLAY,,}" == "none" ]] && VGA="none"
|
||||
DISPLAY_OPTS="-display $DISPLAY -vga $VGA"
|
||||
|
@ -176,7 +176,11 @@ getHostPorts() {
|
||||
|
||||
configureUser() {
|
||||
|
||||
NET_OPTS="-netdev user,id=hostnet0,host=${VM_NET_IP%.*}.1,net=${VM_NET_IP%.*}.0/24,dhcpstart=$VM_NET_IP,hostname=$VM_NET_HOST"
|
||||
if [ -z "$IP6" ]; then
|
||||
NET_OPTS="-netdev user,id=hostnet0,host=${VM_NET_IP%.*}.1,net=${VM_NET_IP%.*}.0/24,dhcpstart=$VM_NET_IP,hostname=$VM_NET_HOST"
|
||||
else
|
||||
NET_OPTS="-netdev user,id=hostnet0,ipv4=on,host=${VM_NET_IP%.*}.1,net=${VM_NET_IP%.*}.0/24,dhcpstart=$VM_NET_IP,ipv6=on,hostname=$VM_NET_HOST"
|
||||
fi
|
||||
|
||||
local forward
|
||||
forward=$(getUserPorts "$USER_PORTS")
|
||||
@ -205,8 +209,9 @@ configureNAT() {
|
||||
|
||||
# Check port forwarding flag
|
||||
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
||||
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null; rc=$?; } || :
|
||||
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null 2>&1; rc=$?; } || :
|
||||
if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
||||
[[ "$PODMAN" == [Yy1]* ]] && return 1
|
||||
error "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1"
|
||||
return 1
|
||||
fi
|
||||
|
@ -17,8 +17,8 @@ echo "❯ For support visit $SUPPORT"
|
||||
: "${CONSOLE:="N"}" # Disable console mode
|
||||
: "${ALLOCATE:=""}" # Preallocate diskspace
|
||||
: "${ARGUMENTS:=""}" # Extra QEMU parameters
|
||||
: "${CPU_CORES:="1"}" # Amount of CPU cores
|
||||
: "${RAM_SIZE:="1G"}" # Maximum RAM amount
|
||||
: "${CPU_CORES:="2"}" # Amount of CPU cores
|
||||
: "${RAM_SIZE:="2G"}" # Maximum RAM amount
|
||||
: "${RAM_CHECK:="Y"}" # Check available RAM
|
||||
: "${DISK_SIZE:="16G"}" # Initial data disk size
|
||||
: "${STORAGE:="/storage"}" # Storage folder location
|
||||
|
12
src/utils.sh
12
src/utils.sh
@ -113,15 +113,15 @@ cpu() {
|
||||
local cpu=""
|
||||
|
||||
ret=$(lscpu)
|
||||
|
||||
|
||||
if grep -qi "model name" <<< "$ret"; then
|
||||
cpu=$(echo "$ret" | grep -m 1 -i 'model name' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "${cpu// /}" ] && grep -qi "model:" <<< "$ret"; then
|
||||
cpu=$(echo "$ret" | grep -m 1 -i 'model:' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
|
||||
fi
|
||||
|
||||
|
||||
cpu="${cpu// CPU/}"
|
||||
cpu="${cpu// 4 Core/}"
|
||||
cpu="${cpu// 6 Core/}"
|
||||
@ -130,7 +130,10 @@ cpu() {
|
||||
cpu="${cpu// 12 Core/}"
|
||||
cpu="${cpu// 16 Core/}"
|
||||
cpu="${cpu// 32 Core/}"
|
||||
cpu="${cpu// 48 Core/}"
|
||||
cpu="${cpu// 64 Core/}"
|
||||
cpu="${cpu// 96 Core/}"
|
||||
cpu="${cpu// 128 Core/}"
|
||||
cpu="${cpu//7th Gen /}"
|
||||
cpu="${cpu//8th Gen /}"
|
||||
cpu="${cpu//9th Gen /}"
|
||||
@ -147,7 +150,8 @@ cpu() {
|
||||
cpu="${cpu// Core TM/ Core}"
|
||||
cpu="${cpu// with Radeon Graphics/}"
|
||||
cpu="${cpu// with Radeon Vega Graphics/}"
|
||||
|
||||
cpu="${cpu// with Radeon Vega Mobile Gfx/}"
|
||||
|
||||
[ -z "${cpu// /}" ] && cpu="Unknown"
|
||||
|
||||
echo "$cpu"
|
||||
|
Loading…
x
Reference in New Issue
Block a user