VMware PowerCLI - Mass Migrate all VM'v from one host to another
Script name: massmigrate.ps1
$SourceHost=$args[0]
$DestinationHost=$args[1]
$VMs = Get-VMHost $SourceHost | Get-VM | select Name
foreach ($VM in $VMs) {Get-VM -Name $VM.Name | Move-VM -Destination $DestinationHost –RunAsync}
Now we just simply run it:
PowerCLI X:> .\massmigrate.ps1 SourceHostIP DestinationHostIP
$SourceHost=$args[0]
$DestinationHost=$args[1]
$VMs = Get-VMHost $SourceHost | Get-VM | select Name
foreach ($VM in $VMs) {Get-VM -Name $VM.Name | Move-VM -Destination $DestinationHost –RunAsync}
Now we just simply run it:
PowerCLI X:> .\massmigrate.ps1 SourceHostIP DestinationHostIP
Komentarze
Prześlij komentarz