Shutdown a Virtual Machine on a Hyper-V Cluster

There are several comdlets in the PowerShell module failoverclusters, but I have not found one that actually shuts the VM down.

On TechNet Microsoft describes the cmdlet as:

Take one or more clustered services and applications (also known as resource groups) offline on a failover cluster.

In my experience this cmdlet actually suspends the VM rather than shutting it down.

On the other side, the PowerShell module hyperv provides a cmdlet to shutdown a VM:

Initiates an operating system shutdown operation on the associated child virtual machine

Here is the msdn Acticle that describes the cmdlet.

However, this module is not explicitely targeted for Hyper-V clusters (failover clusters). E.g. if you want to enumerate all VMs on the cluster, you would need to specify the cluster nodes:

What I was looking for was a combination of the two mudules:
Using the failoverclusters PoSh module whenever possible, but also shutting down the VMs rather than suspending them.

Here is my approach.

Please make sure you installed the Hyper-V Integration Services correctly as described in the msdn Article Managing Hyper-V Integration Service.
If you have not, the VM will be turned off instead of shutting down.

1436 Total Views 2 Views Today
Please follow and like:
My RSS Feed
Follow me by Email
Like it on Facebook
Share on Google+
Share on Twitter
Share on LinkedIn
Share on Xing

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)