Newer Older
f16725e 3 months ago History
27 lines | 0.629kb
Bogdan Timofte authored 3 months ago
1
[Unit]
2
Description=Resume PVE VMs manually
3
Documentation=man:qm(1)
4

            
5
# Only run if we have a state file from previous suspend
6
ConditionPathExists=/var/lib/pve-manager/pgs-state.json
7

            
8
# We need pve-cluster for /etc/pve access
9
Requires=pve-cluster.service
10
After=pve-cluster.service
11

            
12
# Run after storage is available
13
After=pve-storage.target
14

            
15
# Run before the standard pve-guests service to handle our VMs first
16
Before=pve-guests.service
17

            
18
[Service]
19
Type=oneshot
20
ExecStart=/usr/local/sbin/pgs resume -v
21
# Allow generous time for VMs to resume
22
TimeoutStartSec=900
23
Restart=on-failure
24
RestartSec=20
25

            
26
[Install]
27
WantedBy=multi-user.target