Disable pvestatd for cifs/samba

Airw0lf

Member
Apr 11, 2021
62
3
13
60
it-visibility.net
In my lab I'm relying on cifs/samba for backup and deploying vm images.
The NAS behind it is switched-off between 11 PM and 7 AM.
The syslog is then filling rapidly with messages like "pvestatd[1734]: storage 'backup-only' is not online".

Is there a way to disable this type of monitoring for cifs/samba?
Or at least reduce the rate to once every hour or so?


Thank you - will
 
Last edited:
Is there a way to disable this type of monitoring for cifs/samba?
Or at least reduce the rate to once every hour or so?
You can disable the storage until the NAS is online again, using like the bellow commands by adding them to the cron job:

Bash:
/usr/sbin/pvesm set backup-only  --disable 0 # Enable
/usr/sbin/pvesm set backup-only  --disable 1 # Disable
 
  • Like
Reactions: Airw0lf
You can disable the storage until the NAS is online again, using like the bellow commands by adding them to the cron job:

Bash:
/usr/sbin/pvesm set backup-only  --disable 0 # Enable
/usr/sbin/pvesm set backup-only  --disable 1 # Disable

It looks like this disables the volume (as if it doesn't exist) - not stopping the monitoring and its events - correct?

Are these settings persistent across (re)boots?


Cheers - Will
 
It looks like this disables the volume (as if it doesn't exist) - not stopping the monitoring and its events - correct?
Yes, disabling the storage stop the monitoring, e.g., you can see the below image from 10:05 to 10:15 when disabled the storage is the monitor is not work.

1680769247515.png


Are these settings persistent across (re)boots?
What are you mean exactly? If you are mining that, the storage will automatically be enabled after the reboot, the answer is no.
 
Hello,

Sorry to resurrect this thread but the question and possible solution possibly fits me. I'd just like some clarifcation please.

I have created an external NFS share and added it to PVE fine. This is going to be used as the target for VM backups. Am setting the NFS box to startup at 01:00 and shutdown at 06:00 everyday.

So when the NFS server/share is powered down I see a lot these in syslog:

pvestatd[2732]: storage 'BACKUP1-NFS' is not online

Taking the above into account, will the commands work in my case?

I take it the NFS box (BACKUP1) needs to be powered up/online before the enable command in PVE cron is run?

When the enable cron is run the NFS share/mount will automatically connect back to the PVE? Or do I have to manually mount it again? (same for powering on this box outside of the backup time window)?

Apology number 2 is am not sure how to set this in cron. Can you please give me an example with enabled/disabled times?

Thank you very much for any help.

edit: or is it easier (or possible) to set a cron command to enable/disable the NFS box in the Datacenter Storage?
 
Last edited:
Hello,

Sorry to resurrect this thread but the question and possible solution possibly fits me. I'd just like some clarifcation please.

I have created an external NFS share and added it to PVE fine. This is going to be used as the target for VM backups. Am setting the NFS box to startup at 01:00 and shutdown at 06:00 everyday.

So when the NFS server/share is powered down I see a lot these in syslog:

pvestatd[2732]: storage 'BACKUP1-NFS' is not online

Taking the above into account, will the commands work in my case?

I take it the NFS b
#
# Share with VM images from logos
30 8 * * * /usr/sbin/pvesm set vm-images --disable 0
30 21 * * sun-fri /usr/sbin/pvesm set vm-images --disable 1
#

ox (BACKUP1) needs to be powered up/online before the enable command in PVE cron is run?

When the enable cron is run the NFS share/mount will automatically connect back to the PVE? Or do I have to manually mount it again? (same for powering on this box outside of the backup time window)?

Apology number 2 is am not sure how to set this in cron. Can you please give me an example with enabled/disabled times?

Thank you very much for any help.

edit: or is it easier (or possible) to set a cron command to enable/disable the NFS box in the Datacenter Storage?

No problem.

I'm starting pvesm "shortly" after starting the CIFS server. And stopping "shortly" before the server stops.
Where "shortly" means 30 minutes after starting and before stopping.
So that al tasks related to the CIFS server have time enough to finish their tasks.

Below the code for the 2 cron jobs - one for starting and one for stopping:
Code:
30 8 * * * /usr/sbin/pvesm set vm-images --disable 0
30 21 * * sun-fri /usr/sbin/pvesm set vm-images --disable 1

The share share vm-images is "always mounted" - hence the error messages.

Please note that the above is based on a maintenance window.
Meaning that in the weekend (saturday and sunday) I have several maintenance jobs running.
Hence the CIFS server stays operational and therefor the command "--disable 1" is not executed.

Hope this helps.
 
Last edited:
  • Like
Reactions: FlashPan
Thank you very much for that and your prompt reply. Sorry I did forget to say am running PVE 8.0.4

I take it then, I would replace "pvesm" with "pvestatd" in my case and of course the start/stop time (which am going to have to figure out).

I did some tests earlier today with my NFS box running and not and with Enabled box tciked and unticked for the NFS mount. Rebooting the PVE and all permitations of the NFS box being unmounted/not powered up it reconnected fine to the PVE again with no manual input.

Thanks and cheers
 
Thank you very much for that and your prompt reply. Sorry I did forget to say am running PVE 8.0.4

I take it then, I would replace "pvesm" with "pvestatd" in my case and of course the start/stop time (which am going to have to figure out).

I did some tests earlier today with my NFS box running and not and with Enabled box tciked and unticked for the NFS mount. Rebooting the PVE and all permitations of the NFS box being unmounted/not powered up it reconnected fine to the PVE again with no manual input.

Thanks and cheers

Not sure if we are on the same page here.

But pvestatd is about collecting stats and statusses. And generates a lot of errors in syslog when the CIFS volume is not available. In my case this was caused because of daily shutdown/reboot cycle of the Synology NAS.

The pvesm commands are about shutting down and restarting the CIFS share to prevent this syslog flooding.

I never did anything pvestatd as I still want it to monitor other stuff on the same system.
 
Last edited:
  • Like
Reactions: FlashPan
Ahh I see now.

Sorry for that I slightly mis-understood but think I have a handle on it.

I'lldo my best to give this a whirl this evening.

Thanks
 
Just tried running this in shell now and I get it. In my layman terms it Enables/Starts or Disables/Stops the mounted NFS share within Storage :) (ie: ticking and unticking the Enabled box of the storage area/device in Storage).

Thanks very much for you help and clarifications. Just need to get my head into cron scheduling now :) This is all quite new for me.

Cheers again.
 
@FlashPan
Did you figure this out? I have exactly the same problem - everytime my synology NAS is offline, my log gets flooded (of course) and there are no stats collected.
 
Hi,

yep as above edited/added to the cron:

#THIS Enables synology share TO PVE @ 1:25AM
25 1 * * * root /usr/sbin/pvesm set SHARENAME --disable 0
# THIS Disables synology share FROM PVE @ 3:55AM
55 3 * * * root /usr/sbin/pvesm set SHARENAME --disable 1
 
Last edited:
  • Like
Reactions: Kapsville
Hi,

yep as above edited/added to the cron:

#THIS Enables synology share TO PVE @ 1:25AM
25 1 * * * root /usr/sbin/pvesm set SHARENAME --disable 0
# THIS Disables synology share FROM PVE @ 3:55AM
55 3 * * * root /usr/sbin/pvesm set SHARENAME --disable 1
FINALLY a solution for my "stats not showing problem" - Works like a charm. Now I only have to figure out how to automatically run these commands if I power on my NAS at different times. Like a script which pings every minute and then run the above commands if the ping is successful (or not)
 
Last edited:
Glad it works for you. I rarely power on my nas and need access to pmox at the same time so I just manualy start it if needed. Am no expert but maybe you can run a ssh script from the nas to the pmox when it powers on/off ?
 
But as previously said... When the nas is offline the log do fill up with a constant 5-10 sec pooling rate to check the connectivity. How can we turn off this check ? Only the check, no matter is nas is up or not.
In order to have an error of : disk not accessible 1 time and not 24k log of no ping pool possible.
 
Think you have it the wrong way round.

When cron runs:

25 1 * * * root /usr/sbin/pvesm set SHARENAME --disable 0

This means the share is enabled in pmox and until the nas powers on/connects you will get the logs. (my nas powers on at the same time so minimal logs for that time period).

When cron runs:

55 3 * * * root /usr/sbin/pvesm set SHARENAME --disable 1

This means the share is disabled in pmox. So even if the nas is powered on, the share is not accessible in pmox, so no logs. as pmox is not trying to access the nas.
 
Last edited:
But how to disable the proxmox check for the nas alive? It report error in log and it's only a setting something in a json file maybe... ?
 
But how to disable the proxmox check for the nas alive? It report error in log and it's only a setting something in a json file maybe... ?

Well... Proxmox doesn't check if the NAS is alive - it checks if mounted volumes are available for reading and writing.
Meaning it does this for all volumes - regardless where they are coming from.

You need a script for checking if the nas is alive.
However keep in mind that technically if the nas is alive, the volume may-or-may-not be available... :)
 

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!