Rebalancing linked-clone VMs

Опубликовано: 16 Май 2026
на канале: vmutils
825
1

http://vmutils.blogspot.com

NARRATION:
In this video I am going to show how to use a script I created to evenly distribute any number of vApps containing linked clone desktops, among any number of destination datastores.

In this environment I have 4 hosts connected to a shared NFS, and 4 local datastores, one on each host.

The VMs in the parent vApp are all in the NFS datastore, but I want the linked clones to write on the local datastore, and only use the NFS for reads as the parent VMs will stay there.

Here you can see the content in each datastore.

Now we will run the rebalance linked clones script and see the result.


The script takes 3 obligatory and 1 optional arguments. They are:
vApp_rootname which is the root name of the vApps we want to distribute.
destination_datastores which is a comma separated list of datastore names.
endN and startN which are the highest and lowest number in the range of vApps we want to distribute.

By default startN is 1 and it is the optional parameter.

The script will display what it will try to do and ask for confirmation.

Once you press Y it will proceed with the job.

After a few minutes the rebalance is completed.

Now we can see that all the linked clone VMs are in the local datastores, while keeping the parent VMs in the NFS.

If we check the vSphere client, we will see that each linked clone VM is now using 2 datastores. That is because the parent VM disks are on the NFS.

We can now power on these linked clones.


The script will stop:
if you provide a wrong vApp name
if you provide any wrong datastore name.
if you try to migrate vApps that are powered on.

The script will not try to migrate a linked clone VM:
if you try to use a destination datastore that is not connected to any host that also sees the source datastore
if the destination datastore is the source datastore.

The script can also be used to move the vApps back to the NFS, or to move them wherever you want.

Thanks for watching.