mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-10 12:03:41 +08:00
Compare commits
3 Commits
v7.27
...
7d2af63eac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d2af63eac | ||
|
|
2e73bf560e | ||
|
|
bfc8d7a9c6 |
@@ -10,58 +10,72 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
storage: 16Gi
|
storage: 16Gi
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: apps/v1
|
||||||
kind: Pod
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: dsm
|
name: dsm
|
||||||
labels:
|
labels:
|
||||||
name: dsm
|
name: dsm
|
||||||
spec:
|
spec:
|
||||||
containers:
|
replicas: 1
|
||||||
- name: dsm
|
selector:
|
||||||
image: vdsm/virtual-dsm
|
matchLabels:
|
||||||
env:
|
app: dsm
|
||||||
- name: RAM_SIZE
|
template:
|
||||||
value: "1G"
|
metadata:
|
||||||
- name: CPU_CORES
|
labels:
|
||||||
value: "1"
|
app: dsm
|
||||||
- name: DISK_SIZE
|
spec:
|
||||||
value: "16G"
|
containers:
|
||||||
ports:
|
- name: dsm
|
||||||
- containerPort: 5000
|
image: vdsm/virtual-dsm
|
||||||
securityContext:
|
env:
|
||||||
capabilities:
|
- name: RAM_SIZE
|
||||||
add:
|
value: "1G"
|
||||||
- NET_ADMIN
|
- name: CPU_CORES
|
||||||
privileged: true
|
value: "1"
|
||||||
volumeMounts:
|
- name: DISK_SIZE
|
||||||
- mountPath: /storage
|
value: "16G"
|
||||||
name: storage
|
ports:
|
||||||
- mountPath: /dev/kvm
|
- containerPort: 5000
|
||||||
name: dev-kvm
|
name: http
|
||||||
- mountPath: /dev/net/tun
|
protocol: TCP
|
||||||
name: dev-tun
|
securityContext:
|
||||||
terminationGracePeriodSeconds: 120
|
capabilities:
|
||||||
volumes:
|
add:
|
||||||
- name: storage
|
- NET_ADMIN
|
||||||
persistentVolumeClaim:
|
privileged: true
|
||||||
claimName: dsm-pvc
|
volumeMounts:
|
||||||
- hostPath:
|
- mountPath: /storage
|
||||||
path: /dev/kvm
|
name: storage
|
||||||
name: dev-kvm
|
- mountPath: /dev/kvm
|
||||||
- hostPath:
|
name: dev-kvm
|
||||||
path: /dev/net/tun
|
- mountPath: /dev/net/tun
|
||||||
type: CharDevice
|
name: dev-tun
|
||||||
name: dev-tun
|
terminationGracePeriodSeconds: 120
|
||||||
|
volumes:
|
||||||
|
- name: storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: dsm-pvc
|
||||||
|
- hostPath:
|
||||||
|
path: /dev/kvm
|
||||||
|
name: dev-kvm
|
||||||
|
- hostPath:
|
||||||
|
path: /dev/net/tun
|
||||||
|
type: CharDevice
|
||||||
|
name: dev-tun
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: dsm
|
name: dsm
|
||||||
spec:
|
spec:
|
||||||
|
internalTrafficPolicy: Cluster
|
||||||
ports:
|
ports:
|
||||||
- name: tcp-5000
|
- name: http
|
||||||
port: 5000
|
port: 5000
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 5000
|
||||||
selector:
|
selector:
|
||||||
name: dsm
|
app: dsm
|
||||||
type: NodePort
|
type: ClusterIP
|
||||||
|
|||||||
@@ -250,14 +250,14 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
|
|||||||
|
|
||||||
### How do I install a specific version of vDSM?
|
### How do I install a specific version of vDSM?
|
||||||
|
|
||||||
By default, version 7.2 will be installed, but if you prefer an older version, you can add its download URL to your compose file as follows:
|
By default, version 7.2 will be installed, but if you prefer an older version, you can add the download URL of the `.pat` file to your compose file as follows:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
environment:
|
environment:
|
||||||
URL: "https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
|
URL: "https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
|
||||||
```
|
```
|
||||||
|
|
||||||
With this method, it is even possible to switch between different versions while keeping all your file data intact.
|
With this method, it is even possible to switch back and forth between versions while keeping your file data intact.
|
||||||
|
|
||||||
If you don't have internet access, it's also possible to skip the download by setting URL to:
|
If you don't have internet access, it's also possible to skip the download by setting URL to:
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
|
|||||||
URL: "DSM_VirtualDSM_42218.pat"
|
URL: "DSM_VirtualDSM_42218.pat"
|
||||||
```
|
```
|
||||||
|
|
||||||
after placing a file called `DSM_VirtualDSM_42218.pat` in your `/storage` folder.
|
after placing a copy of [DSM_VirtualDSM_42218.pat](https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat) in the root of your `/storage` folder.
|
||||||
|
|
||||||
### What are the differences compared to the standard DSM?
|
### What are the differences compared to the standard DSM?
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,6 @@ configureNAT() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create a bridge with a static IP for the VM guest
|
# Create a bridge with a static IP for the VM guest
|
||||||
|
|
||||||
{ ip link add dev dockerbridge type bridge ; rc=$?; } || :
|
{ ip link add dev dockerbridge type bridge ; rc=$?; } || :
|
||||||
|
|
||||||
if (( rc != 0 )); then
|
if (( rc != 0 )); then
|
||||||
@@ -279,6 +278,22 @@ configureNAT() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeBridge() {
|
||||||
|
|
||||||
|
local pid="/var/run/dnsmasq.pid"
|
||||||
|
[ -s "$pid" ] && pKill "$(<"$pid")"
|
||||||
|
|
||||||
|
[[ "${NETWORK,,}" == "user"* ]] && return 0
|
||||||
|
|
||||||
|
ip link set "$VM_NET_TAP" down promisc off &> null || true
|
||||||
|
ip link delete "$VM_NET_TAP" &> null || true
|
||||||
|
|
||||||
|
ip link set dockerbridge down &> null || true
|
||||||
|
ip link delete dockerbridge &> null || true
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
closeNetwork() {
|
closeNetwork() {
|
||||||
|
|
||||||
if [[ "$DHCP" == [Yy1]* ]]; then
|
if [[ "$DHCP" == [Yy1]* ]]; then
|
||||||
@@ -294,26 +309,16 @@ closeNetwork() {
|
|||||||
exec 30<&- || true
|
exec 30<&- || true
|
||||||
exec 40<&- || true
|
exec 40<&- || true
|
||||||
|
|
||||||
if [[ "$DHCP" == [Yy1]* ]]; then
|
if [[ "$DHCP" != [Yy1]* ]]; then
|
||||||
|
|
||||||
ip link set "$VM_NET_TAP" down || true
|
closeBridge
|
||||||
ip link delete "$VM_NET_TAP" || true
|
return 0
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
local pid="/var/run/dnsmasq.pid"
|
|
||||||
[ -s "$pid" ] && pKill "$(<"$pid")"
|
|
||||||
|
|
||||||
[[ "${NETWORK,,}" == "user"* ]] && return 0
|
|
||||||
|
|
||||||
ip link set "$VM_NET_TAP" down promisc off || true
|
|
||||||
ip link delete "$VM_NET_TAP" || true
|
|
||||||
|
|
||||||
ip link set dockerbridge down || true
|
|
||||||
ip link delete dockerbridge || true
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ip link set "$VM_NET_TAP" down || true
|
||||||
|
ip link delete "$VM_NET_TAP" || true
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,15 +464,10 @@ else
|
|||||||
# Configure for tap interface
|
# Configure for tap interface
|
||||||
if ! configureNAT; then
|
if ! configureNAT; then
|
||||||
|
|
||||||
|
closeBridge
|
||||||
NETWORK="user"
|
NETWORK="user"
|
||||||
warn "falling back to usermode networking! Performance will be bad and port mapping will not work."
|
warn "falling back to usermode networking! Performance will be bad and port mapping will not work."
|
||||||
|
|
||||||
ip link set "$VM_NET_TAP" down promisc off &> null || true
|
|
||||||
ip link delete "$VM_NET_TAP" &> null || true
|
|
||||||
|
|
||||||
ip link set dockerbridge down &> null || true
|
|
||||||
ip link delete dockerbridge &> null || true
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user