Can you do backups on a shoestring without sacrificing their integrity? Do it with the tools you have but be careful -- there are some gotchas.
You’d think at this late date that backups would be just another boring topic — boring but necessary. There’s much controversy surrounding backups in virtual environments and it seems there are many vendors out there wanting to sell you a solution. The real question is do you need to buy a third-party solution or can you use the built-in tools to do the job just as well? The answer may surprise you.
How often do you think about backups or your backup strategy? Most of us only think about such things during or after a failure occurs — because that’s then you need them. A good virtual machine (VM) backup strategy is a costly endeavor financially and in labor — or is it? It doesn’t have to be because your best backup strategy is part of your existing virtualization solution. Both VMware and Citrix provide the tools you need to create and maintain a successful backup strategy with supplied tools.
For backups, you have the following options:
- Treat VMs as if they are Physical Machines
- Treating VMs as Files
- Using an Internal VLAN for Client/Server Backup
- Snapshots1 and VM Copy
- Built-in Backup Tools
- VM Cloning
Any method you choose has its drawbacks and not every method will work for every VM. You’ll probably have to use more than one backup method to satisfy backup requirements for your systems. For example, if you have an application server VM that cannot be shutdown or paused, then your best option is to treat this VM as if it were a physical system — meaning that you’ll install a backup client on it and backup its files over the network or to local disk or tape. Most of the other techniques require that the VM is quiescent, shutdown, or can tolerate decreased performance during the backup procedure.
For VMs whose services can go offline temporarily, treating the VMs as files is the traditional backup method. The VM disk images and configuration files are copied to storage media (Tape, Disk, SAN, NAS).
A generally non-supported strategy is to use an internal VLAN for backups. In this scenario, you run a backup client on your VM of interest and a backup server on another VM connected to a backup device and allows the backup to run. Both VMs must exist on the same host server so that the data isn’t transmitted over the physical network. This procedure takes its toll on the VM host system but the backup is very fast since no data flows over the LAN.
I like the Snapshot capability in VMware. A Snapshot is a hot copy of an entire VM while the VM stays up and running. For a very busy system, there may be a momentary disruption in service but the advantage of being able to grab a Snapshot far outweighs this minor downside. There’s no equivalent yet for Xen* users but the Snapshot is due for a future release. A VM copy (vm-copy) is the current Xen way to make a Snapshot of a VM. The downside is that the VM has to be shutdown (powered off) before making the copy.
Cloning is another oft-used backup method. For VMware and Xen alike, you’ll have to power off the VM to make a clone. For VMware, there is no direct clone creation tool. You’ll have to create the clone yourself by using a script, making a copy of the VM, or using the Snapshot method. Xen has a cloning tool (vm-clone) that’s used specifically for the job.
I don’t really like to say, “I love you, but” — or to take sides on a particular product but for backups, I’ll take the VMware road on backups alone. Xen, you’ve got a great product — a nice interface, a second-to-none Templating schema, world-class I/O but your backup technology is lagging behind. After all, what’s more important than backups for a company’s data and resources? Nothing except the data and resources themselves.
The second thing you should build into any software product, behind basic functionality, is the ability to backup, save, archive, or manage data versioning. It’s hard to believe that the only way to create true backups is to completely power off a virtual machine. Can you imagine powering off a physical machine when you need to do a backup? It isn’t very practical, is it?
If we are to move our valued infrastructure to a virtual one, then we need the same set of tools in those virtual environments that we have in the physical one. So, this discussion brings us back to the question, do you need to buy a third-party solution or can you use the built-in tools to do the job just as well? The answer is that if you’re running virtual machines that can’t be shut down for backups on VMware, you’re probably safe with the VMware-supplied tools. If you’re using Xen however, consider a third-party backup solution that doesn’t require shutting down your VMs.
1 No SnapShot utility available as of XenServer version 4.1.
Comments on "Virtual Machine Backup and Restore: What’s Your Strategy?"
Nice introductory article, but not much useful content. :-( I am, right NOW, in the middle of developing a strategy for doing backups on VMs, so I was hoping for more specific recommendations, or even some links to tools or other people’s experiences on doing backups. We’re using VMware Server right now, but there’s nothing to say we couldn’t switch to another product (aside from $$$$) if we found that it clarified our way to keeping the systems reliably backed up.
There are other Virtualization product besides VMware and Xen. Virtual Iron does offer LiveSnapshots of VMs and exporting.
This article incorrectly states that there is no direct cloning command in VMWARE. Actually, the VI (Virtual Infrastructure) client tool of VMWARE ESX Server offers a complete wizard for cloning virtual guests (and I would like to mention that this is completely separate from the snapshot mechanism). Other products by VMWARE (free VMWARE Server, Workstation, Fusion for APPLE Mac) also offer similar functions so that one does not need to improvize on the command line.
I understand that the writer of this article is biased towards CITRIX and XEN (nothing wrong with that…) and seeks ways of hidding VMWARE’s superiority from his reader’s eyes – however, there are plenty of other ways to promote XEN’s advantages that falsely accuse its competitors.
Panos Tsapralis.
There are other methods that allow live backup. We use Xen. The storage for each VM is a LVM logical partition. It is possible to take a LVM snapshot of the logical partition assigned to a VM. Backing up the LVM snapshot from the host machine would allow for a live backup of the VM, however we chose to use another method.
Each VM uses the same Centos Linux OS and its LVM partition appears as a SCSI disk drive with two partitions, a root partition and a swap partition. All VM’s are identical except for the size of the root partition and the services they run. We have a master VM in a LVM partition that is used as a template. Creating a new VM is a matter of dd’ing the master VM’s LVM partition to the new VM’s LVM partition, then using kpartx and resize2fs to adjust the size of the VM’s root and swap partitions as needed. Bacula (www.bacula.org) is installed on each VM and they are backed up as if they were real machines. Restore is simply dd’ing the master template to the VM’s LVM partition, starting the VM, adjusting a couple of lines in its Bacula config, and running the Bacula restore job from the Bacula director host.
The advantages of this method are:
– All VMs are backed up live
– Only the needed services and data on the VM need be backed up
– The master VM is never running, so is backed up along with the
host it resides on in a straight forward manner
– By setting up a different master VM, the VMs can be migrated to
a different virtualization environment or even a real machine,
so the backups are virtualization agnostic.
– Backups for both VMs and real machines are centrally organized
by Bacula.
– Critical service VMs are running on a heartbeat HA cluster with
DRBD mirroring their LVM partitions across two different hosts.
This method allows backing up the VM independent of which host
it happens to be running on.
@ptsapralis
I’m not biased toward Citrix and VMware. I just used those two for comparison based on market share–being the two most widely used Enterprise-level virtualization solutions.
When I said “no direct method” I was referring to the fact that you have to power off the VM to make the clone.
@cwtryon
Thanks. These posts are not meant to be in-depth technical articles but are instead, blogicles. And, as offered in the article, if you’re using VMware Server, you have snapshots, file-level backup, and so on. There are multiple examples of what you can use.
As far as strategies that others use, they are as varied as opinions on the economy and politics. ;-)
I will tell you this though: If you’re using VMware Server, either you don’t have a lot of VMs or you need something free. VMware Server is NOT an Enterprise solution–it is meant to be a free, introductory solution to VMware virtualization. There’s nothing wrong with VMware Server but just realize that it’s not VMware ESX or Xen.
Great items from you, man. I have consider your stuff previous to and you are simply too great. I actually like what you’ve received right here, certainly like what you’re stating and the way in which during which you say it. You make it entertaining and you still care for to stay it sensible. I can not wait to read far more from you. That is actually a tremendous website.
Great weblog right here! Also your web site a lot up fast! What web host are you using? Can I get your affiliate link on your host? I want my web site loaded up as fast as yours lol
It’s in fact very complex in this full of activity life to listen news on TV, thus I just use internet for that reason, and obtain the newest information.
Hi! I’m at work surfing around your blog from my new iphone 4! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the excellent work!
Here is my weblog – Suzanna
excellent points altogether, you simply gained a new reader. What would you recommend in regards to your post that you made a few days ago? Any positive?
What’s Happening i’m new to this, I stumbled upon this I’ve found It positively useful and it has aided me out loads. I hope to give a contribution & assist different users like its aided me. Good job.
It is the best time to make a few plans for the long run and it is time to be happy. I’ve read this put up and if I may I wish to recommend you some interesting issues or tips. Perhaps you could write next articles referring to this article. I desire to read even more things approximately it!
Awesome post. I am a regular visitor of your website and appreciate you taking the time to maintain the excellent site. I’ll be a frequent visitor for a long time.
Spot on with this write-up, I truly think this web site wants way more consideration. I?ll probably be once more to learn way more, thanks for that info.
4vlaV3 Wow, great blog.Really thank you! Will read on
Thanks a bunch for sharing this with all of us you actually know what you’re talking about! Bookmarked. Kindly also visit my website =). We could have a link exchange arrangement between us!
Rattling fantastic visual appeal on this web site, I’d rate it 10 10.
The time to read or take a look at the content material or web pages we have linked to beneath.
Very interesting information!Perfect just what I was looking for!
The details talked about in the post are several of the most effective readily available.