VMware Cloud Community
Raghukalloor
Contributor
Contributor

SVMotion from one DS cluster to another DS cluster

@LucD 

Good Day !!
I have a requirement for VMs to be svmotioned from one Datastore cluster to another DS cluster. First DS cluster has around 800+ VMs with different in sizes, First Job would be

1. Check the cluster which has less than 500GB VMs 
2. Check the VMs has any RDMs connected
3. Check the VMs for any affinity or anti-affinity rules

After all above conditions met VM will svmotion to another datastore cluster and after svmotion completed it has to check the free space in datastore cluster which should not cross 80%. if the free space is above 75% it should start the migration and if it is less than 75% it should stop the migration. Eveytime migration completes it should check the free space and again back to next VM for migration.. Can this be scripted.. pls update

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership

Yes


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Raghukalloor
Contributor
Contributor

Can you pls provide the script for this

Reply
0 Kudos
LucD
Leadership
Leadership

What do you already have?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Raghukalloor
Contributor
Contributor

I have only in bits and pieces, so far 

Get-DatastoreCluster XXXXX | Get-Datastore | Get-VM | Get-HardDisk | where {$_.StorageFormat -eq 'Thin' -and $_.CapacityGB -le 500} | select @{N='VM';E={$_.Parent}}, Name,Filename,CapacityGB
$myds = Get-DatastoreCluster -Name newdscluster
Move-VM -VM 'xxx', 'dld210127020602' -Datastore $myds

Tags (1)
Reply
0 Kudos
Raghukalloor
Contributor
Contributor

@LucD  could you help me out here !!!

Reply
0 Kudos