Techie solution
asked on
Cold Vmotion Script
Hi All,
Do we have any script for cold migration of multiple vm from one cluster to another.
Do we have any script for cold migration of multiple vm from one cluster to another.
ASKER
How can I connect to the server via cli also please guide from basic commands. I never performed it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Error: Invalid server certificate. Use Set-powerCLIConfigurationt o set the value for the InvalidCertification option prompt.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Used below command
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP $true
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP $true
Before you try the steps in production, i request you to try in a lab setup environment and test the scripts..
Thanks,
MS
Thanks,
MS
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am still fetching help on this.
Though it helped with few knowledge but script is throwing error as I need to change both source network and Datastore.
Though it helped with few knowledge but script is throwing error as I need to change both source network and Datastore.
ASKER
I used below and was able to migrate them successfully #Put the path of the csv file
$vms = Import-CSV "C:\test\Testback.csv"
foreach ($vm in $vms)
{
#Assign Variables
$VMName = ($vm.Name1,$vm.Name2)
$VMHost = ($vm.Host)
$DD = ($vm.Datastore)
$OldNetwork = ($vm.OldNetwork)
$Net = ($vm.Network)
Write-Host $VMName
Write-Host $vm.Host
Write-Host $vm.Datastore
Write-Host $vm.Network
Write-Host $vm.OldNetwork
#Power off vms
Get-VM -Name $VMName | Shutdown-VMGuest
#Where the VM gets Migrated
Move-VM -VM $VMName -Destination $VMHost -Datastore$DD
Get-VM $VMName | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName $Net -Confirm:$false
#Power On VMs
#Start-VM $VMName -Confirm
}
$vms = Import-CSV "C:\test\Testback.csv"
foreach ($vm in $vms)
{
#Assign Variables
$VMName = ($vm.Name1,$vm.Name2)
$VMHost = ($vm.Host)
$DD = ($vm.Datastore)
$OldNetwork = ($vm.OldNetwork)
$Net = ($vm.Network)
Write-Host $VMName
Write-Host $vm.Host
Write-Host $vm.Datastore
Write-Host $vm.Network
Write-Host $vm.OldNetwork
#Power off vms
Get-VM -Name $VMName | Shutdown-VMGuest
#Where the VM gets Migrated
Move-VM -VM $VMName -Destination $VMHost -Datastore$DD
Get-VM $VMName | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName $Net -Confirm:$false
#Power On VMs
#Start-VM $VMName -Confirm
}
You can check this.... it should help