VMware Cloud Community
CLPEDUC
Contributor
Contributor

Linked clones and DatastoreCluster

Hi

I am trying to create new VMs based on a snapshot using the New-VM command.

My "base" image is stored on a dedicated datastore for "base" images, let's call it "template"

I have a Datastore Cluster of several "vms" datastores but it does not include "template".

When I run the command to create the linked clone from "source" and store it into the datastore Cluster :

New-VM -Name toto -vm source -linkedClone -ReferenceSnapshot (Get-Snapshot -vm source -Name Base) -Datastore (Get-DatastoreCluster DataStore4VMs) -ResourcePool (Get-ResourcePool "POOL") -Location (Get-Folder Data)

I have the following error saying The Storage DRS requirements of this VirtualMachine cannot be satisfied. storagePlacement The datastore is not compatible with the virtual machine.

Whereas it works if I add "template" datastore into the Datastore Cluster and it also works if I set the VM Datastore instead of DataStoreCluster directly.

 

Is there any restrictions on the command ? Or has anyone been able to do that ?

Thanks all for your help

0 Kudos
1 Reply
mduchaine
VMware Employee
VMware Employee

It's been years since this post but since I recently got into the same issue and here is why:

linked clones VM are useful to save storage space in case you deploy a lot of VMs all based on the same template and few modifications afterwards.

You save space by reusing the vmdk files of the original VM, and adding individual vmdks to store the differences.

This however implies that the original and the clones all need to be on the same datastore or datastore cluster.

In CLPEDUC's case, adding "Template" to the datastore cluster puts original vmdks and cloned into the same storage cluster and all is well.

Take Template out of the lcuster, and the original vmdk files cannot be "seen" in the destination datastore (cluster) hence, the incompatibility.

Resolution:

a - don't use linked clones, use plain clone.

b - if you want to take advantage of linked clones, clone and starting vm must reside on the same datastore (cluster).

0 Kudos