Sure.
First you need to create a dataset on your PVE Host and mount it somewhere.
Here is an example:
Code:
root@proxmox:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
HDD_Z2 21.5T 82.2T 114K /HDD_Z2
HDD_Z2/PVE_Backup 696G 82.2T 696G /PVE_Backup
HDD_Z2/SMB_Data 125G 82.2T 125G /smb/Data
HDD_Z2/SMB_Downloads 776G 82.2T 776G /smb/Downloads
HDD_Z2/SMB_Media 18.8T 82.2T 18.8T /smb/Media
HDD_Z2/SMB_Other 1.11T 82.2T 1.11T /smb/Other
HDD_Z2/SMB_Rechnungen 235M 82.2T 235M /smb/Rechnungen
Second you need to passthrough that dataset to your LXC Container, i simply use the mounted location of that dataset and edit my LXC container Config, because thats not possible in the GUI for whatever reason....
Here is my Example Config:
Code:
arch: amd64
cores: 2
features: nesting=1
hostname: linux-srv
memory: 2048
mp0: /smb/Other,mp=/smb_storage/Other,replicate=0
mp1: /smb/Media,mp=/smb_storage/Media,replicate=0
mp2: /smb/Data,mp=/smb_storage/Data,replicate=0
mp3: /smb/Rechnungen,mp=/smb_storage/Rechnungen,replicate=0
mp4: /smb/Downloads,mp=/smb_storage/Downloads,replicate=0
net0: name=eth0,bridge=vmbr0,hwaddr=50:6D:FF:F3:C8:DD,ip=dhcp,ip6=auto,type=veth
onboot: 1
ostype: ubuntu
rootfs: NVME_ZFS_R10:subvol-103-disk-1,mountoptions=noatime,size=16G
startup: order=3
swap: 512
lxc.cap.drop:
lxc.cap.drop: mac_admin mac_override sys_module sys_rawio
Only the mpX are important....
replicate=0 ist pretty important, to not Backup those Volumes with PBS...
Depending from the LXC Container if it Priviliged or Unpriviliged, you need to change the Rights on your PVE Host on the dataset mountpoint (to the UID:GID of the root user in the LXC Container).
But you need that only on a unpriviliged container, so you can skip that, because to run samba alone inside LXC you need a Priviliged Container as far i remember.
To find out the UID:GID of the Container:
Simply chmod the mountpoint from your dataset to 777 on the proxmox host, then enter your lxc container as root and create a file with nano or whatever on the mounted storage....
Then simply check on the proxmox host again with what UID:GID the file was created.... and chown the whole mountpoint to that...
And surely change back 777 to anything normal, like 775.
Then install on your Proxmox host anything that does the snapshots for you on your datasets...
I think in the meantime this is even implemented in Proxmox already...
However, im using still
https://github.com/wezm/zfs-autosnap
Because i come from a time, where autosnapshots werent implemented in Proxmox....
Configure them....
then you have to configure smb.conf in your LXC container, one of my VSS Shares looks like this:
Code:
[Data]
comment = Server Data
path = /smb_storage/Data
guest ok = no
browseable = yes
valid users = mw, root
write list = mw, root
create mask = 0775
force create mode = 0775
force user = samba
force group = sambagroup
vfs objects = shadow_copy2
shadow:snapdir = /smb_storage/Data/.zfs/snapshot
shadow:basedir = /smb_storage/Data
shadow:sort = desc
shadow:format = %Y-%m-%dT%H:%M:%SZ-autosnap
but you will probably change that a little, to a format and directory that matches your snapshotting method.
Thats a super Cheap How-To, but should help you at least, or give you the right direction....
Cheers