passthrough disk and hot plug sata

keeka

Active Member
Dec 8, 2019
199
24
38
Hi,
I am formulating a proxmox set up to replace my existing kvm server. On that machine, I run nfs on the host and use a caddy, configured as hot plug sata (in Z77 BIOS), to do rotated backups.
One thing I cannot replicate in my virtualised test is this backup. If I put file services in a vm, say open media vault, and passthrough block devices, what's the best way to back it all up?
AIUI I cannot pass through a non-existent / inactive block device and I am unable to passthrough an entire sata controller since the additional onboard sata is Marvell :-( Nor can I passthrough one sata port.

What would be the next best way to back up the files on the block devices that are passed through to the virtualised NAS?

Or should I abandon the idea of virtualising file services and instead run nfsd/samba in pve. Bearing in mind I will only have one physical machine.

Many thanks.
 
You can format your disk with LVM or ZFS and create a single volume to assign to your VM spanning the entire disk. Then you can use the built-in PVE backup capabilities - this would allow you to hot-plug your backup disk (the host should support hotplug) and then run the backup manually each time. Hot-plugging disks to a VM is not supported, only with a pass-through PCIe disk controller.
 
Thanks for the suggestion. That way, would the PVE host be able to perform a file level backup?
I like to use rsnapshot for data backups, so need to mount the fs. The current server (soon to be PVE) is already set up with a working hotplug and rsnapshot backup. I have udev rules that, when it sees the appropriate disk label, launches the backup and powers down the disk on completion. This works well for me. I plan to do the same under PVE.
 
Technically yes, especially the part about the udev rules (PVE is a regular Debian under the hood, so udev/systemd/what-have-you all work the same). I'd recommend not backing up VMs that way though, and instead using PVE's integrated backup for that.

E.g., some script along the lines of:
Code:
#!/bin/sh
# triggered on udev
vzdump <vmid> <vmid> <vmid> <...> --mode snapshot --storage <storage on your external disk>

You'd have to extend the script for backing up the host configuration as well, if you need that, but just as a starting point. 'man vzdump' and our documentation are helpful ressources.
 
You'd have to extend the script for backing up the host configuration as well, if you need that, but just as a starting point. 'man vzdump' and our documentation are helpful ressources.
Thanks Stefan. Really appreciate your advice. AIUI vzdump backs up, snapshots and restores vm disk images and container filesystems at block level.
I will certainly be using that to backup VMs and CTs.
However, I really want to run file level backups of NAS type storage with rsnapshot/rsync. I can then easily recover specific files/directories by mounting the appropriate backup disk & syncing back those parts of the filetree I need to recover.
In my case, we've ruled out hotplug backups within the OMV VM since there's no spare controller to passthrough. Also, I'm not bothered if I don't run this from within the NAS VM.
So, I believe I ultimately need to mount the 'NAS' filesystem in PVE either directly or via NFS (if I am passing the disk through to proposed OMV VM).
 
So, I believe I ultimately need to mount the 'NAS' filesystem in PVE either directly or via NFS (if I am passing the disk through to proposed OMV VM).
For file-level backups you are going to need a mount of some sort, yes. Mounting directly can be tricky for synchronization issues, so I'd only recommend doing that on snapshots (i.e. take a ZFS snapshot and read-only-mount that, as opposed to mounting the ZFS subvol directly, same for LVM-thin).

Mounting via NFS (or possibly even simpler options, sshfs and the likes) is probably the easiest solution. Then you can just run rsync/rsnapshot on the mounted folder to your hot-plug disk.
 

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!