Auto backup with NAS4Free storage

eiger3970

Well-Known Member
Sep 9, 2012
276
3
58
Hello, I need to setup automatic backups on Proxmox properly.

I manage local backups which fill the Proxmox disk after 12 months and Proxmox breaks.

So, trying again to use Proxmox Backup to NAS4Free storage on a separate machine.

I'm unclear how to connect Proxmox Backup storage to NAS4Free.
NAS4Free has a ZFS Pool and DataSet ready.
 
Hi,
for vzdump you need an mounted filesystem on the pve-node (like nfs...).
Or you use an hook-script, which copy/sync the backup-files after the backup is finished.

There was an thread about this some days ago.

Udo
Thank you.
I thought I'd try configuring Proxmox locally following the documentation.
Thought I'd use my preferred text editor vim, but error:
Code:
root@proxmox:/etc/pve# apt-get install vim
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'vim' has no installation candidate
 
Ok, so following the instructions from Storage ZFS and error:
Code:
root@proxmox:/etc/pve# nano storage.cfg
root@proxmox:/etc/pve# zfs create tank/vmdata
cannot create 'tank/vmdata': no such pool 'tank'
I have edited storage.cfg as per sparse configuration example.
 
Hi,
for vzdump you need an mounted filesystem on the pve-node (like nfs...).
Or you use an hook-script, which copy/sync the backup-files after the backup is finished.

There was an thread about this some days ago.

Udo
Hook script sounds good too, although I need to delete the files from Proxmox once synced to another machine, to avoid the continual issue of disks filling up and causing the io-error. I'll search about Proxmox hook scripts.
 
Thank you.
I thought I'd try configuring Proxmox locally following the documentation.
Thought I'd use my preferred text editor vim, but error:
Code:
root@proxmox:/etc/pve# apt-get install vim
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'vim' has no installation candidate
Hi,
that's strange - how looks your apt-sources?
Normaly vim-tiny is installed and you can also install the complete vim:
Code:
root@pve-a:~# dpkg -l | grep vim
ii  vim-common  2:7.4.488-7+deb8u1  amd64  Vi IMproved - Common files
ii  vim-tiny  2:7.4.488-7+deb8u1  amd64  Vi IMproved - enhanced vi editor - compact version
root@pve-a:~# apt-get install vim
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following extra packages will be installed:
  vim-runtime
Suggested packages:
  ctags vim-doc vim-scripts
The following NEW packages will be installed:
  vim vim-runtime
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,988 kB of archives.
After this operation, 28.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://security.debian.org/ jessie/updates/main vim-runtime all 2:7.4.488-7+deb8u1 [5,036 kB]
Get:2 http://security.debian.org/ jessie/updates/main vim amd64 2:7.4.488-7+deb8u1 [953 kB]
Fetched 5,988 kB in 1s (4,586 kB/s)
Selecting previously unselected package vim-runtime.
Is your installation an standard pve-installation?

Udo
 
So, my real question is...what is the easiest way to transfer Proxmox backups to another machine.
Is there an easy GUI (the NFS or ZFS thing is complicated). Perhaps a Cron script?
 
Ok, I gave up on Proxmox. I'm using freeNAS which rsyncs the Proxmox backup onto the freeNAS machine. Works well.
 
Footnote for what it is worth.

Not sure what you mean "NFS and proxmox is hard". This is about one of the easier configs for storage in Proxmox possible (aside from local storage maybe). ie,

- setup an NFS export on your Filer storage unit which has lots of disk. Allow the proxmox host(s) RW access if mapping/config required for clients.
- mount the storage in proxmox - just "add new storage > NFS > enter IP of the NFS Filer > let it locate the export > choose it"
- designate this storage type as a pool where proxmox may be permitted to store <DUMPS>
- now you are done, can configure your proxmox backup jobs to put dumps onto this new <nfs storage dump storage tank>

it is ~5minutes of work, and works very solidly.

at least in my experience.



Tim
 
Ok, here's what the Proxmox machine has:
Code:
root@proxmox:/var/lib/vz# lsblk
NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                            8:0    0 223.6G  0 disk
├─sda1                         8:1    0  1007K  0 part
├─sda2                         8:2    0   127M  0 part
└─sda3                         8:3    0 223.5G  0 part
  ├─pve-root                 251:0    0  55.8G  0 lvm  /
  ├─pve-swap                 251:1    0     8G  0 lvm  [SWAP]
  ├─pve-data_tmeta           251:2    0    72M  0 lvm
  │ └─pve-data-tpool         251:4    0 143.7G  0 lvm
  │   ├─pve-data             251:5    0 143.7G  0 lvm
  │   └─pve-vm--143--disk--1 251:6    0    30G  0 lvm
  └─pve-data_tdata           251:3    0 143.7G  0 lvm
    └─pve-data-tpool         251:4    0 143.7G  0 lvm
      ├─pve-data             251:5    0 143.7G  0 lvm
      └─pve-vm--143--disk--1 251:6    0    30G  0 lvm
I think I would like the root kept at 50 GB, the rest of the 223.6 GB disk to be used for storage.
Once per month I can clear the storage to a 2nd machine. This should stop any i/o errors.

Still working out how to do daily backups. Might have to add a few more terabytes of storage. First like to practice making this setup work, unless any better ideas?

So, looks like I need to research how to partition Proxmox's disk, the add whatever storage type NFS or ZFS to the rest of the partitioned disk.
 
Last edited:
Hi, my advice would be,
- don't change the internal storage on proxmox you use for VMs that are active
- instead just add a new storage pool, NFS based, which is used only for holding your backups
- if you have not done so already, review these docs,

first briefly; https://pve.proxmox.com/wiki/Storage
and then specifically, https://pve.proxmox.com/wiki/Storage:_NFS

ie, proxmox supports quite happily, having multiple different storage types available at any/all times; and to use them for different purposes. (for example, "This storage is for VM Disks storage; that storage is for NFS mounted dumps storage; and that other storage, quite tiny SSD, is only for a few fasst-VM-disk-storage-needs". etc etc.

- you also sound like you are maybe not aware of the built-in scheduler for backups, which automates the process (ie, "do dump of all vms nightly at 2am" or "do nightly dump, only of the indicated VMs nightly at 2am. or weekly. or whatever".

- and finally, depending on how big your VMs are / how many copies you want to keep of backups, and how much space you have for backups storage; you might wish to read a bit about a 3rd party add-on that was released ~years ago for proxmox backups module, which allows for storage of only the 'delta' of the backup, not the 100% full bunch of blocks each nightly full. It means that you can squeeze in more copies onto the same storage this way. Downside is that it might break aspect of the GUI that default backups has working in proxmox; I forget; I haven't used this piece for a while. Maybe first you want to get 'regular backups to NFS target' working first.

Tim
 
Ok, added disk2 as storage. Need Proxmox to read it as storage rather than disk1 which runs the OS.

Proxmox > Server View > Datacenter > proxmox > Disks > shows /dev/sda LVM, /dev/sdb partitions, /dev/sdc partitions and /dev/sdd partitions. I added /dev/sdb as storage Directory, however storage shows only /dev/sda. Need to stop using local disks and use added disks.
 
Hi, I think there is something in communication here between your posts and my posts, which suggests that we are not understanding each other.

- if your setup looks like this?
- two physical systems
- one system is running proxmox, had local storage for VMS to run from
- one system is running NAS4Free, has bulk disk space
- desire is to use the NAS4Free box, as bulk storage target for VM Dump Backups, only, and not for VM operations (ie, live running VMs)

If this is the case,
-- NFS export from your NAS4Free
-- Mount it as NFS storage on Proxmox, designate it as use only for "VM Backups".
-- and you are done

There is no requirement for 'snapshot support' on the storage tank used for holding VM dumps, because, this is just a 'big bit bucket' into which you pour VM Dump Files, period.

Proxmox does not care what underlying filesystem you may choose to use on Nas4Free (ie, ZFS, Other) so long as proxmox has access to it in a well defined way (ie, NFS mount)

To add the NFS storage into proxmox, in the WebUI just go DataCentre >> Storage >> ADD >> NFS.
Then designate ID = "Human-friendly-name" such as "NAS4FreeTank"; Server = IP of the NAs4Free box; EXPORT field should auto-populate if your NFS export is setup properly (ie, drop-down box will show it listed, choose it); Content = VZDumpBackupFIle; MaxBackups = number you want it to keep / auto-prune (set to zero if no prune old backups); click add; you are done.

The only reason you want to go into DC>PROXNODE>DISKS is if you need to manage local disks on the proxmox node, ie, places from which your primary VM operations storage / proxmox install exist. I don't believe (?!) you are trying to add more 'local storage' to your proxmox physical node; but rather use some form of network-attached storage to give more capacity to proxmox for storage of VM Backups.

Tim
 
Thanks.
So:
Machine1, Disk1 sda, 120 GB has Proxmox OS.
Machine1, Disk2 sdb 120 GB for backup storage.
Machine1, Disk3, sdc 120 GB for backup storage.
Machine1, Disk4, sdd 120 GB for backup storage.
Machine2, Disk1, sda 1 TB for backup of Machine1, Disk2, Disk3 and Disk4. This freeNAS auto rsyncs and removes Proxmox's data. (turns on once a month (maybe once a week if the BIOS can turn on autmatically)).

Right now, I'm trying to add Disk2,3,4 for storage so the snapshots and/or auto scheduled Proxmox backups go to Disk1 until full, then Disk2, then Disk3.
 
Hi,

I don't think Proxmox will allow you to designate, "Write backups to STORAGE_1 until it is full, then go to STORAGE2, then storage3, etc". So your options, maybe?

-- build a single raid volume composed of (disk 2,3,4) to give you a single pool of storage space. Or LVM if you prefer. or ZFS based model if that is your thing.
-- format and mount this thing, note you are doing this all via CLI "under the hood". Mount it to some mount point like "/spare-local-storage"
-- then in proxmox WebUI you can "ADD STORAGE" >> Type == "LOCAL" and designate the mount point (/spare-local-storage" and now you have a tank of local disk storage where you can send local backups.

Myself, I would not bother with rsync wrappers and added complexity - just keep it simple, use the NasMachine2 box purely as an NFS filer and dump stuff to that from proxmox. If you insist on DIY script things, just make sure the NFS mount exists from NAS>>Proxmox and then run your script(s) locally on proxmox (ie, via Crontab) to "do stuff" such as copy/sync data from <Local storage> to <NFS mount storage>

As a footnote, if you are using this box for anything other than 'throw away testing' then you really should not have proxmox installed to a single (non-raid) disk. This is just asking for heartache when the disk inevitably wears out and dies and you lose all data on the disk. Life is too short to deal with such things for 'serious' systems. Just do either a SW Raid config with pair of disks for Proxmox OS install (either Linux SW raid "custom install via Debian install approach" OR if you like ZFS, just do a 2-drive ZFS proxmox main volume install; and use your other drives for misc. storage.

after all drives are cheap, and you appear to have fairly small drives here, so if you need more local dump space on proxmox just blow $100 and get a 1-2Tb Sata disk for holding tank for local dumps; much better capacity than fussing around with 120gig drives IMHO.

but ultimatly it is your pick on how you do this.

Good luck!


Tim
 
as said by fortechitsolutions, you need to either combine all those extra disks into a single array in your vm host, once in an array, probably your easiest route is to format the array with some file system ie:
Code:
mkfs.ext4 /dev/md0 #(assuming you made a mdadm array).
mkdir /mnt/backups
mount /dev/md0 /mnt/backups

Next in proxmox web gui add that storage as a directory: /mnt/backups

On the add storage dialog there is a control called Max Backups, calculate your total guest storage usage vs available space on array, ie if arrays is 2000gb, and 4 guests have used space of 90gb each, you should limit your backups to 4 to prevent filling drive... make sure to leave space for extra backup, as I think proxmox deletes the oldest backup only after a new one is created.

The above is the path of least resistance and easiest to grasp with minimal knowledge of file systems. You could also use LVM, or zfs, but you need to really understand how they work or you could break something bad.

Using zfs/lvm- it must have a formatted file system to store backups (snapshots should not be considered backups). Only running VMs can sit on raw zfs/lvm.... once formatted (ie ext4), you would mount it to a dir (/mnt/backups) add it in the pve web gui as a directory not as a zfs pool (only for running vms).

Or - if your VMs are already running on zfs, then you actually could use a 2nd storage running raw zfs without a file system and use pve-zsync to sync the file system over to the other drives, at the moment this would be completely managed from the command line, no gui. https://pve.proxmox.com/wiki/PVE-zsync From your comments, you do not seem to understand the different layers of zfs, I suggest you read a lot more on it before trying to use it.
 
Reading Proxmox's Software_RAID wiki links, it seems software RAID is supported out of the box with ZFS.
Looks like I need to setup ZFS, as install mdadm doesn't work.
So, does this mean I should install install debian Squeeze/Wheezy/Jessie on sda, the intall mdadm on sda.
then RAID sda, sdb, sdc.
Then install Proxmox on the RAID (sda,sdb,sdc).
Then sdd will be a storage disk for backing up Proxmox to?

Here's my plan:
1. sda - install debian squeeze, wheezy or jessie. (wiping over currently installed Proxmox).
2. sda debian squeeze, wheezy or jessie: install mdadm
3. sda debian squeeze, wheezy or jessie with mdadm installed: RAID 4 or 5 configuration of sda, sdb and sdc (named md0).
4. md0 (sda/sdb/sdc) RAID 4 or 5 configured: install Proxmox
5. md0 (sda/sdb/sdc) RAID 4 of 5 with Proxmox: add storage on sdd to directory /dev/sdd.
 
Last edited:

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!