Backup strategy for running VM's

Joined
Dec 29, 2014
Messages
1,135
I have two FreeNAS units that are both running 11.2-U6 on bare metal Cisco UCS C240 M3S servers, and a really old Netgear ReadyNAS unit. I finally got around to setting up reasonably proper rsynch modules and jobs, and that all appears to have copied the files correctly. My question is around the backing up of my 3 VM's that are running all the time on on ESXi 6.5 servers using the FreeNAS units for storage over NFS. Those are a FreeBSD VM (my mail server), a Vcenter appliance, and an APC Powerchute appliance (UPS monitoring). I have had bad luck with how recoverable these VM's are if they lose connectivity with the storage. I am trying to figure out a way to get a cold backup, or a usable hot/warm backup. Since I kick off the backups manually (the secondary FN is the backup target and I don't keep it running all the time), I have thought about shutting down the VM's and taking a snapshot of the ZFS data set. Then I can bring the VM's back up and copy over the cold version from the snapshot. I am sure that would work, but I was wondering if there was a better way of attacking this.
 

blanchet

Guru
Joined
Apr 17, 2018
Messages
516
If you have a vCenter virtual appliance, I guess that you have a paid-edition of ESXi (for example, VSphere Essentials). In such a case, Veeam Backup & Replication Community Edition is the best tool to backup your virtual machines. It is free for up to 10 VMs, you have only to create an account on veeam.com. You can even run Veeam in a bhyve vm on FreeNAS.

If you have only ESXi free, you cannot use Veeam B&R because the ESXi API is locked. In such a situation, the most common alternative is to install a backup agent in each vm to schedule backup to a network share. For example, Veeam Agent Free Edition for Windows or for Linux. Unfortunately if your virtual machine runs another operating system, you cannot install the backup agent.

An other alternative is VMware Snapshot combined with FreeNAS. It is not as straightforward as veeam and I do not know if it works with ESXi free, but it may work.
 

1kokies

Contributor
Joined
Oct 7, 2017
Messages
138

1kokies

Contributor
Joined
Oct 7, 2017
Messages
138
I am trying to figure out a way to get a cold backup, or a usable hot/warm backup. Since I kick off the backups manually (the secondary FN is the backup target and I don't keep it running all the time), I have thought about shutting down the VM's and taking a snapshot of the ZFS data set. Then I can bring the VM's back up and copy over the cold version from the snapshot. I am sure that would work, but I was wondering if there was a better way of attacking this.
thanks for the idea @Elliot Dierksen
 
Joined
Dec 29, 2014
Messages
1,135
An other alternative is VMware Snapshot combined with FreeNAS. It is not as straightforward as veeam and I do not know if it works with ESXi free, but it may work.
I have configured the FreeNAS boxes with the Vcenter credentials and data store names. I just wasn't sure how well it would work. Maybe I am showing my graybeard-ness by being distrusting of hot snapshots. I did enable make snapshots visible on the volume in question and was able to manually copy off a cold backup (shut down the VM's, took a snapshot (excluding the ESXi snapshot part), and then brought VM's back up) by copying from the snapshot I took while the 3 main VM's were off. That seems to be ok. I doubt I need to do it all that often, but it seems prudent.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Joined
Dec 29, 2014
Messages
1,135
I have that already configured although I told it not to snapshot the VM's since the ones I wanted to replicate were powered off at the time. My question was really more general about recovering VM's that were backed up/snapshotted while running. Have you had good luck recovering from the hot snapshots? My experience on that hasn't been very good which is why I altered my process to get a cold snapshot. Thanks for the info. I am pleasantly surprised to see I had it configured correctly. :)
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Once the snapshot is back on the main system you would want to promote it and set it up and an iscsi lun or NFS share, add the new datastore to esxi/vcenter, and the tricky part.. if you wan to keep your vSphere ID and historical data, you would have to rename the broken vm folder with -old and copy not vmotion the backup into its place. Or just register the vmx file as a new vm if you don't care. That you would be able to just vmotion it over.

Once that's done, it just cleanup, dismount the temp datastore, delete the datastore, remove the lun/share on FreeNAS and likely remove the snapshot.


Caution, this is all off the top of my head and I have not had coffee yet.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
I have that already configured although I told it not to snapshot the VM's since the ones I wanted to replicate were powered off at the time. My question was really more general about recovering VM's that were backed up/snapshotted while running. Have you had good luck recovering from the hot snapshots? My experience on that hasn't been very good which is why I altered my process to get a cold snapshot. Thanks for the info. I am pleasantly surprised to see I had it configured correctly. :)
Hmm I see your issue may be something else. I would need more details about what issues your seeing. As long as the VMware snapshot is taking place, the FreeNAS snapshot should contain everything needed to produce an already running VM. Are you capturing the memory of the running VM in the VMware snapshot? I know there is an option for that in some cases...
 
Top