nas share and wakeonlan

alexskysilk

Distinguished Member
Oct 16, 2015
1,842
373
153
Chatsworth, CA
www.skysilk.com
I dont normally use proxmox in a "homelab" environment, so I never ran into this type of issue before.

I have a sample usecase with a NAS that is normally asleep, since its only used as a backup target. the typical method to address this type of connection is to have a magic packet sent prior to automount it using autofs, but here come the proxmox wrinkles.

problem 1: when the NAS goes back to sleep, it remains in mtab and hangs disk metadata ops such as df. I cant get automount to cut the connection without umount -l.
problem 2: if I add the store to storage.cfg as a folder, it will of course hang pvestatd once the nas goes to sleep- and if I kill the connection using umount -l, it immediately wakes up because pvesm polls it.

Ideas?

/etc/auto.master
Code:
/nfs        /etc/auto.nfs       --timeout=10

/etc/auto.nfs
Code:
#!/bin/bash

nfs_ipv4="xxxx"
nfs_mac="yyyy"
ping -c 1 -w 1 -q $nfs_ipv4 > /dev/null
if [ $? -ne 0 ];
then
        wakeonlan "$nfs_mac"
        sleep 5
fi
echo "-fstype=nfs,retry=0,retrans=1,bg,intr,hard,timeo=10 $nfs_ipv4:/mnt/proxmox"
 
turns out problems 1 and 2 are cause and effect; problem 1 doesnt occur if the store is disabled in storage.cfg.

Is there a way to achieve this functionality in a proxmox supportable way?

You can search on the forum and in the docs for the backup hook scripts and do wake-on line as the start of the backup job hook, and unmount at the end...
But the backups to NAS are going to fill the space very quickly because there is no deduplication. You'd better setup a Proxmox Backup Server (you can do it on a local proxmox node with a local disk)...
 
You can search on the forum and in the docs for the backup hook scripts
I'm sorry, are you referring to a specific post or document? please link it if you are.

But the backups to NAS are going to fill the space very quickly because there is no deduplication. You'd better setup a Proxmox Backup Server (you can do it on a local proxmox node with a local disk)...
Sounds like a great idea, but immaterial to the question...
 
I'm sorry, are you referring to a specific post or document? please link it if you are.

Nope, I just remember that I used that thing a few years ago for a similar purpose. I believe I found some examples of the scripts in the Proxmox documentation, then I adapted those...
No longer use that, so don't know the current status...
 
The solution I came up with is to define the storage in pvesm as a directory with the is_mountpoint set to yes. This seems to work but the access timing is a bit iffy. good enough for now.

I'll give it some more thought.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!