Hi,
Am 20.03.2018 um 10:16 schrieb Thomas Lamprecht:
Hi,
On 3/19/18 5:00 PM, Toan Pham wrote:
Hi, I am very new to proxmox and I have a few questions/suggestions:
welcome!
1. [...] Since I have
node that's always powered off, but can be powered on from wake-on-lan
network packet. It would be really nice to have a wake-on-lan feature
integrated to the web-UI.
Completely custom commands cannot be added for now.
Custom as in "user presses button and some arbitrary script runs on node",
has just to much security implications and hides to much for the user
what happens when the button is pressed, especially in multi-admin
environments.
As a workaround I'd add a small script which merely does:
wakeonlan MAC
on a node which is always on and execute it through the webinterfaces node
shell when needed. Not to nice but gives you what you want.
That said, just adding a "wakeonlan" feature per node (where the MAC address
used is default the one we configured vmbr0 too, and can be manually set)
sounds like a more possible feature.
No promises yet, but can you open a feature request at
https://bugzilla.proxmox.com/ so that we can track it?
We are also using a very simple script to wake on lan another
backup-server via MAC adress connected to bridge vmbr10, then mounting a
nfs volume after the server is up, and then doing the backup of the
virtual machines via "rsnapshot" software. After the backup is finished,
the server will be shut down via ssh and key. Maybe this code/config
snippets helpes you to create your own script:
root@pm3:~# cat /usr/local/sbin/rsnapshot-helper
#!/bin/bash
#set -x
backupsrv=192.168.xxx.xxx
quelle=$backupsrv:/daten/lv1
ziel="/rsnapshot"
optionen="-o vers=3"
case $1 in
pre)
grep " $ziel " /proc/mounts &>/dev/null ; if [[ $? -ne 0 ]]; then
if ping $backupsrv -c1 &>/dev/null ; then
mount $optionen $quelle $ziel
else
/usr/sbin/etherwake -b 0f:de:ad:be:af:0f -i vmbr10
sleep 120
mount $quelle $ziel
fi
fi
;;
post)
umount -lf $ziel 2>&1 |grep -v ': not mounted'
sleep 5
ssh -l root $backupsrv 'echo systemctl poweroff | at now + 2 minute'
&>/dev/null
;;
*)
echo "usage: $(basename $0) [pre|post]"
echo ""
echo "options:"
echo " pre: poweron backupserver, mount backup share"
echo " post: ummount backup share, then poweroff backupserver"
;;
esac
This is our rsnapshot configuration to backup the VM's:
root@pm3:~# grep -B1 -A6 SCRIPTS /etc/rsnapshot.conf
###############################
### BACKUP POINTS / SCRIPTS ###
###############################
# VMs
backup_script /bin/date "+ backup of virtual machines started at %c"
.tmp/unused1
backup_script /usr/bin/vzdump --mode snapshot --dumpdir
/rsnapshot/vmbackup/dump --compress lzo --mailnotification failure --mailto
[email protected] --maxfiles 15 --remove 1 --all 1 --quiet 1 .tmp/unused2
backup_script /bin/date "+ backup of virtual machines ended at %c"
.tmp/unused3
have fun, good luck!
Lutz
_______________________________________________
pve-user mailing list
[email protected]
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-user