mtrohde
Enthusiast
Enthusiast

Need a powercli script to find EVC mode for VMs

Jump to solution

1st off I am looking for a complete script.  What I want script to do is connect to the vcenter, get VM name, get what is the VMs current EVC mode, get cluster the VM is on and what what is the EVC mode for the cluster.

Regards,

0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership

The following PowerCLI script will connect to a vCenter Server named vCenter and will display the required information about EVC modes for each virtual machine on the vCenter Server:

Connect-VIServer -Server vCenter

Get-VM | Select-Object -Property Name,

@{Name='MinRequiredEVCModeKey';Expression={$_.ExtensionData.Runtime.MinRequiredEVCModeKey}},

@{Name='Cluster';Expression={$_.VMHost.Parent}},

@{Name='ClusterEVCMode';Expression={$_.VMHost.Parent.EVCMode}}

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
6 Replies
RvdNieuwendijk
Leadership
Leadership

The following PowerCLI script will connect to a vCenter Server named vCenter and will display the required information about EVC modes for each virtual machine on the vCenter Server:

Connect-VIServer -Server vCenter

Get-VM | Select-Object -Property Name,

@{Name='MinRequiredEVCModeKey';Expression={$_.ExtensionData.Runtime.MinRequiredEVCModeKey}},

@{Name='Cluster';Expression={$_.VMHost.Parent}},

@{Name='ClusterEVCMode';Expression={$_.VMHost.Parent.EVCMode}}

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
mtrohde
Enthusiast
Enthusiast

RvdNieuwendijk,

First of all thank you for taking the time to respond.  The third data point the ClusterEVCMode is coming out blank.  I also tried the command Get-Cluster | select -Property Name,EVCMode and it reports the clusters names but not the EVCMode.  Any thought as to what is going on?

Regards,

0 Kudos
mtrohde
Enthusiast
Enthusiast

OK that is WEIRD I checked in the web client and EVC is enabled the two clusters I expected it to be on.  Now there are several clusters in the two vcenters that do not have EVC enabled but that is again expected. p

Again confused by the lack of output.

0 Kudos
RvdNieuwendijk
Leadership
Leadership

The support for EVC mode was introduced in PowerCLI recently. Which version of PowerCLI are you using? You can try using the latest PowerCLI version, currently version 6.3 Release 1. PowerCLI 6.3 R1 is compatible with VMware vCenter Server 5.0 and higher versions.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
mtrohde
Enthusiast
Enthusiast

I am using 5.5 R1, I will update and report back.  Thank you again!

0 Kudos
mtrohde
Enthusiast
Enthusiast

Issue resolved 6.3 R1 gets the script to work correctly.  Smiley Happy

Thank you again!

0 Kudos