Product Announcements

Multi-disk replication into common directory with vSphere Replication

Posted by
Ken Werneburg
Tech Marketing

When replicating VMs with vSphere Replication you have control over the target location for your VMDKs that are being replicated.  For example, you may have a VM with two disks and choose to place them in different directories and locations than they were in the primary site from which they are being copied.

That's great, but something that never came up with array replication is what happens when we want to put all the disks in the *same* directory at the recovery site?

If we have a machine ("VM1") that has 2 VMDKs each on different datastores, for example, they might both be named the same.  We might have two "VM1.vmdk" files.  In fact, this happens by default – the first disk in a directory is named for the parent VM without consideration for the fact that there may be other VMs elsewhere on different disks.

Disk one: 


Looks a lot like disk 2:


Obviously attempting to replicate these VMs into a single directory on the same datastore will cause difficulty on the recovery site.  We can't have more than one VMDK of a particular name in a directory.  

vSphere Replication is smart – it will detect that an existing disk is in that directory, but it is not so smart that it understands what it is.  It assumes very smartly that this is a seed disk you have copied in via sneakernet.  If you've got this far with a multi-disk VM, don't choose this option, or you'll use the 'first' disk as a seed and it will do a full synch of the second disk against it, overwriting it!


What are the options?  Well first, you can get to the CLI and use vmkfstools to detach, rename, and re-attach the disk then replicate to your heart's content.  

Another idea is to create folders for these disks and populate them into unique folders.  I.e. "VM1" is the main folder and within it there will be the VMX and all other items and sundry for a VM.  In your other directories (such as "OS Disk" and "Data Disk") you can replicate the individual VMDKs.  Each directory will then contain a unique but homonymous named "vm1.vmdk".


Set your VR target per-disk, and choose the appropriate directory at the recovery site by selecting to "specify datastore folder".  This keeps your data separate, retains easy management and the ability to identify a VMDK by function easily, as well as giving you the freedom to use separate data stores at the source and single data stores at the recovery site.