Automation

 View Only
  • 1.  Need a powercli script to find EVC mode for VMs

    Posted Sep 11, 2016 06:34 AM

    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,



  • 2.  RE: Need a powercli script to find EVC mode for VMs
    Best Answer

    Posted Sep 11, 2016 12:57 PM

    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}}



  • 3.  RE: Need a powercli script to find EVC mode for VMs

    Posted Sep 12, 2016 04:26 AM

    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,



  • 4.  RE: Need a powercli script to find EVC mode for VMs

    Posted Sep 12, 2016 05:53 AM

    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.



  • 5.  RE: Need a powercli script to find EVC mode for VMs

    Posted Sep 12, 2016 06:28 AM

    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.



  • 6.  RE: Need a powercli script to find EVC mode for VMs

    Posted Sep 12, 2016 07:49 AM

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



  • 7.  RE: Need a powercli script to find EVC mode for VMs

    Posted Sep 12, 2016 08:28 AM

    Issue resolved 6.3 R1 gets the script to work correctly.  :smileyhappy:

    Thank you again!