HD Full

do i have to define the mountpoint in fstab instead of using the storage.cfg? did i understand correctly?
You do not have to. I just gave a hint regarding "is_mountpoint" and that the classic way via fstab is still a valid approach.

I have no idea what works best for you ;-)

Good luck!
 
Myabe i don't understand and i should come back and rephrase:
What's the best way to ensure that, when an NAS goes offline, the VM or LXC don't start writing to the internal storage?
 
What's the best way to ensure that, when an NAS goes offline, the VM or LXC don't start writing to the internal storage?
Well, it is worth to mention that I have never had this problem. I am really not sure why..., yes I do use network storages.

One way is what what you already tried to achieve and where I pointed out that is seams to not work under all circumstances: mount whatever you want, be it NFS, CIFS or an USB drive. Tell PVE that you have a directory-storage at the respective location. Then tell PVE "...is_mountpoint".

Another approach may be: check manually if the storage is available. If it is not available tell PVE that is is disabled. This can be done by something like pvesh set /storage/$DATASTORE_ID --disable 1. This check can run every few minutes via a crontab.

Some weeks ago there was a script posted here in the forum to disable a storage if that server is not online. Search... here: https://forum.proxmox.com/threads/a...nding-on-host-availability.146105/post-659463

Good luck :)
 
Well, it is worth to mention that I have never had this problem. I am really not sure why..., yes I do use network storages.

One way is what what you already tried to achieve and where I pointed out that is seams to not work under all circumstances: mount whatever you want, be it NFS, CIFS or an USB drive. Tell PVE that you have a directory-storage at the respective location. Then tell PVE "...is_mountpoint".

Another approach may be: check manually if the storage is available. If it is not available tell PVE that is is disabled. This can be done by something like pvesh set /storage/$DATASTORE_ID --disable 1. This check can run every few minutes via a crontab.

Some weeks ago there was a script posted here in the forum to disable a storage if that server is not online. Search... here: https://forum.proxmox.com/threads/a...nding-on-host-availability.146105/post-659463

Good luck :)
By using the directory "method" i need to mount manually in fstab right?
Regarding the second method i'm not really a fan of scripts that eventualy get lost in migrations/reinstalls
 
By using the directory "method" i need to mount manually in fstab right?
Correct. A directory with free space must be available to be presented to PVE ;-)

Regarding the second method i'm not really a fan of scripts that eventualy get lost in migrations/reinstalls
Also correct. This is a "last resort"-approach.

As @alexskysilk said: usually it should "just work" with the configuration options in the official WebGui under Datacenter --> Storage.
 
What do you mean?

If the share is defined in the web GUI (or CLI) using a specific storage type (e.g. CIFS or NFS), Proxmox VE looks after it. It has more information and control over the share.

If you use /etc/fstab and the Directory type storage, you need to manage whether it is online or not. Proxmox VE only knows it is a directory and does not have any visibility into more than that.
 
If the share is defined in the web GUI (or CLI) using a specific storage type (e.g. CIFS or NFS), Proxmox VE looks after it. It has more information and control over the share.

If you use /etc/fstab and the Directory type storage, you need to manage whether it is online or not. Proxmox VE only knows it is a directory and does not have any visibility into more than that.
I indeed had an CIFS share via the GUI.
Apprently proxmox wasn't looking when my NAS (truenas scale on a VM inside proxmox) went down and filled "local" with 40gb of frigate recordings!
So why are you telling me that proxmox looks after it? that's the bit that i'm missing
 
I indeed had an CIFS share via the GUI.
Apprently proxmox wasn't looking when my NAS (truenas scale on a VM inside proxmox) went down and filled "local" with 40gb of frigate recordings!
So why are you telling me that proxmox looks after it? that's the bit that i'm missing
Let me see if I understand correctly:
  • You were running TrueNAS Scale as a VM in PVE.
  • The TrueNAS Scale VM had a CIFS share called frigate.
  • You mounted the frigate CIFS share in PVE.
What was writing to the frigate CIFS share?
 
You understood correctly. Frigate Is an NVR that i have in a container.
When i was fiddling with truenas It went down several hours and frigate kept writing in the mountpoint that was actually offline and so i had 40gb of recordings in the local partition instead of the CIFS share
 
You understood correctly. Frigate Is an NVR that i have in a container.
When i was fiddling with truenas It went down several hours and frigate kept writing in the mountpoint that was actually offline and so i had 40gb of recordings in the local partition instead of the CIFS share
Please share the config for the Frigate LXC.
 
Please share the config for the Frigate LXC.
sure thing
Quick edit: the 40gb files were in /mnt/pve/frigate after i unmounted the share

Code:
arch: amd64
cores: 4
features: nesting=1
hostname: docker-frigate
memory: 16000
mp0: /mnt/pve/frigate,mp=/data/frigate
nameserver: 192.168.2.1
net0: name=eth0,bridge=vmbr0,gw=192.168.2.1,hwaddr=BC:24:11:11:E3:8A,ip=192.168.2.20/24,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-100-disk-0,size=14G
startup: order=3
swap: 2048
tags:
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/serial/by-id  dev/serial/by-id  none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0       dev/ttyUSB0       none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB1       dev/ttyUSB1       none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM0       dev/ttyACM0       none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM1       dev/ttyACM1       none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0, 0
lxc.mount.entry: /dev/bus/usb/001/ dev/bus/usb/001/ none bind,optional,create=dir 0,0
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
 
Last edited:
I have taken a deeper look at the configs you posted.

Your /etc/pve/storage.cfg has the following:

Code:
cifs: frigate
        path /mnt/pve/frigate
        server 192.168.2.90
        share frigate
        content iso,images
        preallocation off
        prune-backups keep-all=1
        username sugar0

Your LXC has the following config line:

Code:
mp0: /mnt/pve/frigate,mp=/data/frigate

If your LXC had mounted the share using the storage defined in Proxmox, I would have expected to see something like:

Code:
mp0: frigate:9999/vm-9999-disk-0.raw,mp=/data/frigate,size=999G

Looking at the storage config, you have not configured the CIFS share to allow container storage. You have:

Code:
content iso,images

If it allowed container storage, you would see:

Code:
content rootdir,iso,images

It appears you have manually mounted the share as an arbitrary directory. When mounted that way, PVE will not know it is a share -- in the LXC context.

What you would want to do to prevent writing to that directory when the share is offline is to allow containers in the storage and provision the mount point from the PVE storage instead of using the path.
 
Thank you for taking time to explain to a noob, i learned that here and i tought it was the "go to" easy mount , clearly i have lot to learn!
 
  • Like
Reactions: weehooey-bh

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!