Backup a VM while it is running

4

2

I have several virtual machines created with VMware Workstation 11 which must run 24/7. I'm not allowed to shutdown/suspend it temporarily.

  1. What options do I have to backup this VM while it is running? (hot clone)
  2. Can I restore a VM on another machine when I just copy its entire folder while the VM is running?
  3. How can I automate this backup process assuming the host system is Windows 7.
    So PowerShell, Command Line, Task Scheduler are available.

My research found this method which works from a ESXi service console which I believe is not available under Windows 7 and VMware Workstation 11, or?

nixda

Posted 2015-08-12T08:43:41.353

Reputation: 23 233

This question is too broad. Just like there's a million ways to back up any computer there's a million ways to back up a VM.

A basic, yet highly inefficient method would be to just take a snapshot of the VM and export it. VMWare workstation allows this and there are CLI tools to automate this. – qasdfdsaq – 2015-08-12T10:13:53.577

If I had asked how to backup a VM, maybe I would agree. But I asked how to backup while the VM is running. And this isn't trivial and simple as you suggest. But if you think there are a million ways to do this, I would be happy to accept your answer where you demonstrate just one way – nixda – 2015-08-12T11:10:01.077

The whole point of snapshots is that you can do it while the VM is running. You can even snapshot the RAM and running OS so it doesn't even have to boot up when you restore the snapshot. As for the million other ways: just google "How to backup PC". Any method that applies to a normal computer can be used from inside a VM - backing up the host VM image is not always the most effective method after all. – qasdfdsaq – 2015-08-12T12:34:00.770

2

Please, if you find this question too broad, then vote to close. I wouldn't mind. For all others: This method uses vmware-cmd utility to create snapshots, save them, copy them and delete the old snapshot. I'm willing to write a PowerShell script to automate this. But aren't there other more elegant ways to hot clone a running VM from outside?

– nixda – 2015-08-12T13:57:39.117

If you really must run 24/7 then workstation is not really the tool for that. – albal – 2015-08-12T13:58:24.880

@albal What would you recommend instead? We already discussed to buy VMWare ESXi Hypervisor but the client asked to demonstrate hot cloning at first. I thought that would be possible with Windows 7+Workstation, but apparently not if you say so. – nixda – 2015-08-12T14:17:54.960

BTW "that method" from your original post runs from the service console. That only exists in ESX and not ESXi. That product has been deprecated many years ago, although the technique is still valid. The issue you will have is easily creating a live clone of the base disk (due to the size). Backup products like Veeam will certainly make that a whole lot easier by backing up only the blocks which have changed. – David Moylan – 2015-08-12T15:03:04.820

Answers

3

You need to implement a standard supported infrastructure to achieve what you want, otherwise you are going to create a bundle of hacks.

If your VM needs to run 24/7, what have you done to cater for hardware failure? This isn't just a situation of "I need to make a backup copy", it should also be "I need to cater for maximum uptime".

A full VMware kit, two hosts, shared storage, HA etc will cater for all of this. Hell, you might even be able to use VMware's Fault Tolerance feature which would permit hardware failure without skipping a beat.

If you were to implement a correct infrastructure, you could then utilise products such as Veeam Backup. This and similar products backup from the outside while the VM is running with no interruption.

If you want to just ensure you have backup copies (which you could restore elsewhere) and have a tight budget, might I recommend Veeam Endpoint Backup which is free. Install this into the VM and backup to an external device like a NAS. You could restore back onto another machine. This isn't as elegant, but there is obviously a significant difference in price here.

Last note - if you are going to design and implement a redundant infrastructure, PLEASE use a certified VMware Reseller who has certified VMware Engineers. Don't use someone who hasn't been trained as they (in my experience) will implement single points of failure (ie: two servers, shared storage and ONE SWITCH).

David Moylan

Posted 2015-08-12T08:43:41.353

Reputation: 107

So ESXi doesn't have a service console? And this feature has no successor? --- Fallback hardware is certainly an issue, but let's ignore it in this question please --- How do products like "Veeam Backup & Replication" do this from outside? What "interface" to VMware do they use? Can I somehow go the same way with free or onboard tools? – nixda – 2015-08-12T16:52:18.983

@nixda The service console has essentially been replaced by vMA which is a linux based VM appliance you can download. Products like "Veeam Backup and Replication" use the VMware Storage API which is only available in licensed versions of vSphere (ie: does not come included in a free hypervisor license of ESXi). "Veeam Endpoint Protection" installs inside the guest VM, so it can run on any edition of VMware/ESXi hypervisor. – David Moylan – 2015-08-15T00:03:47.460