How do I back up ESXi VMs?


Recommended Posts

Hi All,

Just after people's opinion on how to "backup" ESXi VMs? Not a true backup as it isn't offsite but I just want a copy so that if the DataStore drive dies I can put a new datastore in, create the unRaid VM again and copy them off that.

 

Do I just copy the vmdk and vmx files or use something like Veeam if it works with ESXi Free version?

 

Thanks Josh

Link to comment

Hi All,

Just after people's opinion on how to "backup" ESXi VMs? Not a true backup as it isn't offsite but I just want a copy so that if the DataStore drive dies I can put a new datastore in, create the unRaid VM again and copy them off that.

 

Do I just copy the vmdk and vmx files or use something like Veeam if it works with ESXi Free version?

 

Thanks Josh

You could do worse than to check out ghettoVCB.  Takes a bit of time to setup, but once you have it configured, it's largely set it and forget it. 

https://communities.vmware.com/docs/DOC-8760

 

Trilead VM Explorer is an alternative to Veeam.

http://www.trilead.com/

 

 

 

Link to comment

I just boot my VMs with an Acronis True Image CD image.  Then I image the HDD.  I don't have the VM settings but for unRAID it is very easy to setup.  With 5.0 I have 3GB mem, 2GB VMDK and pass through M1015 card.  I use USB pass through for the unRAID flash drive.  So it takes me about a minute to setup from scratch.  NOTE I just have my VMDK as a copy of my flash drive so I don't really use True Image for that.  I have some Windows VMs that I backup with True Image.  So if I was having to restore from a datastore crash: I would first setup my Windows VM.  Restore the HDD image of the Windows VM.  Create a 2GB VMDK for unRAID but attach to Windows VM as second drive.  Boot up Windows VM and format VMDK, run MakeBootable.bat and copy unRAID flash drive to VMDK.  Then attach VMDK and flash drive to new VM and am back in business.

 

I know that sounds like a lot but it is nothing to setup a VMDK from scratch for unRAID since all configuration files are on the flash drive anyway.  The super.dat and config folder files are updated on the flash drive not the VMDK so a copy of the config folder from flash to VMDK takes care of setting up after a datastore crash.  The longest part of the restore process is getting the Windows VMDK boot drive copied back from the backed up image.  Once that is done it is usually just a half hour or so.  And no I didn't have a datastore crash but I did switch from one datastore HDD to another and removed original.

Link to comment

Hey nice write up!  I'm sure it will help others. I think from my testing that if nfs is enabled like your guide it doesn't matter what the VM_BACKUP directory is set to at the start. If the nfs is not set up then it will go to that directory. Anyone who knows better can correct me but that's what I've found.

I also don't plan on backing up unraid VM. I'm going to test mine with plop should be easy enough to just recreate the vm. If my esxi goes down, I'd have to boot unraid bare metal, copy off to another pc, install esxi then import vm. Too much hassle. If I do backup unraid vm then probably just to my desktop.

Josh

 

Sent by tapatalk

 

 

Link to comment

Hey nice write up!  I'm sure it will help others. I think from my testing that if nfs is enabled like your guide it doesn't matter what the VM_BACKUP directory is set to at the start. If the nfs is not set up then it will go to that directory. Anyone who knows better can correct me but that's what I've found.

I also don't plan on backing up unraid VM. I'm going to test mine with plop should be easy enough to just recreate the vm. If my esxi goes down, I'd have to boot unraid bare metal, copy off to another pc, install esxi then import vm. Too much hassle. If I do backup unraid vm then probably just to my desktop.

Josh

Are you backing up to a separate datastore then?  I was considering doing that as well for simplicity, but when my Norco's backplane fried my drives, it fried all the drives on the same backplane, which were all my datastore drives.  I'm opting to backup to unRAID to have that additional layer of redundancy. 

 

Ideally, however, I'd backup to a completely separate box.  One of these days I'd love to get my hands on an HP Microserver and have that be my backup destination.  Perfect for that other unRAID key I have laying around, or for trying out ZFS.

Link to comment

I'm backing up to unRaid, not a datastore.

 

Mainly to protect against datastore failure. That's why I don't backup unRaid. I could but getting the VM backoff it isn't worth the hassle.

 

I don't have another server, part of the reason for running ESXi otherwise I would have baremetal unRaid and another server to run all the other VMs.

 

Josh

Link to comment

Any idea how to restore?

 

I've mounted the NFS from unRaid which gets picked up fine.

 

I've run ghettoVCB and with a dryrun seems fine, run the proper commands and it clones/restores. There are two files that get created in the folder, the vmx and the virtual disk.

 

However it shows as Unknown (invalid) and I can't start. If i remove that I can't select the vmx and click add to inventory.

 

Thanks Josh

Link to comment

Okay can't seem to use the ghettoVCB-restore to restore the VM. I've:

1) nfs mounted the share with the VM backups

2) run the ghettoVCB command and it copies the files - however:

It comes up with invalid and I can't start the VM.

 

I've then tried copying the files, the .vmx and the .vmdk and then started it. Copied it by downloading the files from unRaid (not part of ESXi yet) to my desktop and then uploading to the new Datastore. So far that seems to work but I'm not sure if it introduces any major issues. Issues so far are:

1) It gets a new MAC address (since I use my router to set static IP addressess based on MAC this changes things but is an easy fix)

2) It was an Ubuntu VM and had to do a file rebuild on boot up, didn't quite catch it all as it was quick but I'm guessing since the hardrive changed it mention fschk and rebuild.

 

I'm currently trying a Windows 7 VM. Just a lot larger so waiting for it to copy. Trying to copy from the mounted nfs share (unRaid) directly to the datastore via the cp  -a cli command with nohup.

 

Josh

Link to comment

Well that's unfortunate.  You didn't get the "Did you copy or move this VM?" prompt when you fired it up the first time?  So far I've only copied/moved machines within the datastore browser, so I wonder if it preserves some sort of state when used.

 

I'll try a restore a few different ways today as well and share my results.

Link to comment

I had success using the datastore browser to restore the backup.  Create an NFS datastore mount (if not persistent), go into the machine folder, pick the backup folder you want, right-click and copy.  Go into other datastore, right-click and paste.  Rename folder, right-click on .vmk and Add to Inventory. 

 

I think its much easier than going through the process of creating a restore config file, running the dry runs, executing the script, etc.  Though there may be some configurations in which the backup being thin provisioned, changing the format, and so on that may cause issues?  Though if restoring multiple machines the datastore browser method would require much more interaction.

 

I updated my guide accordingly.

Link to comment

How big was the vm and what provisioning did you back it up as?

My VMs were created as lazy zeroed and backed up as thick zero (not eager). I tried copying like you said but it just didn't work. It finished in about 3 seconds and the vmdk didn't show up. I'm copying via the cli but a 350gb vmdk had taken over twelve hours.

Josh

 

Sent by tapatalk

 

 

Link to comment

 

I use VEAM (free) and backup to the array..

 

The only thing is that you cannot backup the unraid vm that way (well you could, but without the data it would be useless), not a problem however since unraid will still boot from its usb stick if you just disable esxi..

I recently looked at Veeam. This is what it states on their download page after registration:

 

Note: Free vSphere Hypervisor (free ESXi) is not supported. vSphere Essentials or higher license level required.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.