VMware Cloud Community
umeyer100
Contributor
Contributor

Start VM with Powershell on a certain host

Hi,

is it possible to start a VM with the Powershell CLI command "start-vm" on a certain host in a cluster?

I see only the -server option, but i think this is for the vcenter server...

Can someone help?

Regards

Uwe

Tags (1)
0 Kudos
6 Replies
sjesse
Leadership
Leadership

You can connect to the host directly with the connect-viserver cmdlet instead of the vcenter server and use start-VM,I use it in my nested lab to shutdown the nested esxi hosts  when I want to power everything off.

0 Kudos
scott28tt
VMware Employee
VMware Employee

Moderator: Thread moved to the PowerCLI area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
scott28tt
VMware Employee
VMware Employee

I assume you mean a cluster enabled for DRS? If so, connecting directly to the host will be the method - bypassing vCenter Server which would otherwise control the VM placement.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
LucD
Leadership
Leadership

It depends if that ESXi node is part of a cluster with DRS active.

Normally you can move the VM to the intended ESXi node and then start it.

But when DRS is active, then DRS might decide to start it on another node in the cluster.

One option is to temporarily disable DRS


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
LucD
Leadership
Leadership

Even if you connect to the ESXi node directly, if that ESXi is part of a cluster with DRS active, DRS might still start/move it on/to another node in the cluster.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
umeyer100
Contributor
Contributor

Hi,

thanks for the information. It works now.

Regards

Uwe

0 Kudos