This commit is contained in:
Zack Meier
2026-04-15 15:42:41 -05:00
parent 74edcc4d9a
commit 03dba08135
146 changed files with 9119 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
$VMsToMove = Get-DatastoreCluster *linux*V5K* | Get-VM | where-object Name -like "itddhs*" | sort-object UsedSpaceGB
ForEach($VM in $VMsToMove){
Write-Warning ($VM.Name + ' ... ' + [math]::round($VM.UsedSpaceGB,2))
$wait = $true
while ($wait -eq $true)
{
$tasks = Get-Task | where-object {$_.Name -like "ApplyStorageDrs*" -and $_.State -eq "Running"}
If(@($Tasks).count -lt 1){$wait = $false}
Else{$wait=$true; Write-Warning ("[$VM]:Start sleep " + (Get-Date) + " DRS Count: " + @($Tasks).count); start-sleep -Seconds 20}
}
$Source = $VM | Get-DatastoreCluster
$Destination = Get-DatastoreCluster -Name ($Source.Name.split('_')[0] + "_A9K_General")
Move-VM -VM $VM -Datastore $Destination -RunAsync
Start-Sleep -Seconds 10
}