But Veeam and the PowerCLI help to down the time that I spend to move this machines to 5 minutes logoff.
Well, first I do a replica job to replica the VM to the new LUN and when finish I run a job that run this PowerCli script
Code: Select all
$initialVM=$args[0]
$replica=$args[0]+"_replica"
$user="root"
$pass="12345678"
Connect-VIServer -Server 192.168.30.3 -User $user -Password $pass
Shutdown-VMGuest -VM $initialVM -Confirm:$false -Verbose
$vms = Get-VM -Name $initialVM
do {$vms = Get-VM -Name $initialVM} while ($vms.PowerState -ne "PoweredOff")
Start-VM -VM $initialVM
Start-Sleep -Seconds 60
$vms = get-vm -Name $replica
$qMsgUuidMoved = "msg.uuid.altered:"
$choiceMove = 2
$vmview = $vms | Get-View
if($vmview.Runtime.Question -ne $null -and $vmview.Runtime.Question.Text.StartsWith($qMsgUuidMoved))
{
$vmview.AnswerVM($vmview.Runtime.Question.Id, $choiceMove)
}
I test this with little servers, I don't know if work with a Domain Controller or a Exchange, or something could be wrong doing this?
I want to add the script the option to put the same MAC address to the Network Card, because there are server with program licensed by this MAC.
I hope it can help someone.
Thanks!