HI All,
I am trying to Clone a Virtual Machine from a Template and put it under a Host Cluster, Forcing it to be deployed under a specific ESXi host.
The command that I am using is as below
If there is no Resource Pool mentioned, then
$New_VM = New-VM -VMHost $VMHost -Name $Name -Datastore $Datastore -Template $Template -ResourcePool $VMHostCluster
If there is a specific Resource Pool mentioned, then
$New_VM = New-VM -VMHost $VMHost -Name $Name -Datastore $Datastore -Template $Template -Location $Location -ResourcePool $ResourcePool
But even after mentioning the VM Host Specifically, it moves the VM to a Different Host as soon as the VM is started.
I verified that when the VM is provisioned, it goes to the Correct Host, But the moment it is Started, the host changes.
Below is the PowerCLI version details.
Looks like DRS is selecting another ESXi node to start your VM.
Before starting the VM try to disable DRS automation for the VM.
You could do that with
Set-VM -VM $vm -DrsAutomationLevel Disabled -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD : Can you please check if possible ?
Looks like DRS is selecting another ESXi node to start your VM.
Before starting the VM try to disable DRS automation for the VM.
You could do that with
Set-VM -VM $vm -DrsAutomationLevel Disabled -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference