VMware Cloud Community
MrCheesecake
Enthusiast
Enthusiast
Jump to solution

PowerCLI copy of VSAN VMDKs between datastores

Greeting!

In my environment, we maintain a bunch of standalone VMDKs within a VSAN datastore.  They basically make up a library of templates that we use for building VMs but are not associated with (attached to) any VMs.

Since our backup solution only targets VMs (and their attached VMDKs), these files are left untouched so I'm trying to automate a process to copy them to another VSAN datastore to maintain a second copy.  Within the vCenter browser/GUI, this works perfectly using "Copy To" within the Datastore tab.  But using PowerCLI's copy-datastoreitem, I cannot get this to work since it doesn't seem to understand the VSAN stream format-  a 4GB VMDK ends up as a 500KB descriptor.  I have also tried attaching an NFS datastore to a host and get the same results with copy-datastoreitem.

Are there any other tools/commands/approaches that might work?

 

 

0 Kudos
1 Solution

Accepted Solutions
TheBobkin
Champion
Champion
Jump to solution

@MrCheesecake, a couple of options that might suit:

Create a VM, attach all of these vmdks to it, then back it up, then detach the vmdks.

Create a VM, attach all these vmdks to it, clone it, then SvMotion the clone to other vSAN cluster, then detach the vmdks from both VMs.

It is also possible to use vmkfstools to clone a vSAN object to a file or another object (but can't be across vsanDatastores unless used HCI Mesh I guess).

View solution in original post

0 Kudos
4 Replies
TheBobkin
Champion
Champion
Jump to solution

@MrCheesecake, a couple of options that might suit:

Create a VM, attach all of these vmdks to it, then back it up, then detach the vmdks.

Create a VM, attach all these vmdks to it, clone it, then SvMotion the clone to other vSAN cluster, then detach the vmdks from both VMs.

It is also possible to use vmkfstools to clone a vSAN object to a file or another object (but can't be across vsanDatastores unless used HCI Mesh I guess).

0 Kudos
MrCheesecake
Enthusiast
Enthusiast
Jump to solution

Thank you!

Mounting the VMDKs to a VM won't really work given the number we have but I'm really intrigued by the HCI Mesh idea-  I had forgotten about that and will take a closer look next week.  

Have a good one!

0 Kudos
TheBobkin
Champion
Champion
Jump to solution

@MrCheesecake I am now intrigued by what you are running there and how many vmdk/objects we are talking!

A VM can have 60 vmdks attached as SCSI, another 60 as NVMe and then other amounts as other means which may not have the same capabilities e.g. IDE.

Could always attach 120 vmdk as the above to each of multiple VMs as needed - they don't need to be all in the same namespace, when you add them they should have absolute path (e.g. including the namespace path to them).

But yes, bit band-aid alternative, but if a cluster can have the destination vsanDatastore mounted then can clone from one to other using: vmkfstools -i <source.vmdk> <destination.vmdk> -W vsan

0 Kudos
MrCheesecake
Enthusiast
Enthusiast
Jump to solution

The HCI Mesh approach works- Thank you for mentioning it!

0 Kudos