VMware Cloud Community
sujeetkp
Contributor
Contributor
Jump to solution

Virtual Machine moves to a Different Host (Inside a Host Cluster) Even if the Host is Mentioned Separately in New-VM

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.

PowerCLI Version.png

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

Reply
0 Kudos
2 Replies
sujeetkp
Contributor
Contributor
Jump to solution

LucD​ : Can you please check if possible ?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos