Hi,
I have a vCenter which has around 50 -60 ESXi 5.0 host. Which was newly installed which has Intel processor. I just want to ensure all the hosts Intel VT enabled or not. If anyone has the PowerCLI script to validate this please share it with us. Thanks in advance.
Regards
Suresh Dhanaraj
Can't you just do
$esxcli = Get-EsxCli -VMHost "esx1.local.test" $esxcli.hardware.cpu.global.get()
and check the value of the HVSupport property ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
really good question - can you do a cat /proc/cpuinfo from the ESXi shell?
You could use esxcfg-info command as described in the following kb :http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=101171...
To script this for a large environment, you can use plink in combination with the cmdlet Invoke-Expression:
$plink = "plink.exe"
$plinkoptions = " -v -batch -pw $Password"
$remoteCommand = '"' + $Command + '"'
$PlinkCommand = $plink + " " + $plinkoptions + " " + $User + "@" + $VMHost + " " + $remoteCommand
$Output = Invoke-Expression -command $PlinkCommand
Hi,
Thanks. I already have this script and placed the plink.exe at the execution path. It’s ruing w/o any error but it says the table title as “output” but no output data available. Please suggest.
Sample Output from PowerCLI:
---------------------------------------------------------
Host Output
---- ------
test09.corp.com
test10.corp.com
test11.corp.com
test12.corp.com
test13.corp.com
test14.corp.com
test15.corp.com
test16.corp.com
Script:
-----------------------
Can't you just do
$esxcli = Get-EsxCli -VMHost "esx1.local.test" $esxcli.hardware.cpu.global.get()
and check the value of the HVSupport property ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD & Team,
Thanks a lot for the reply. It’s really awesome it works perfect. After going through VMworld 2011 PowerCLI videos I became fan of you & Alan. Thanks a lot for sharing valuable information.
Regards
Suresh Dhanaraj
LucD,
1st of all, thanks for the 2 liner.
2nd, quick Q for you. Is there a way of exporting the HVSupport attribute into a CSV e.g. @{N="VT Support";E={$_. ..........}}, ?
Sure, by using the info from KB1011712 you can even use a meaningful text instead of the number.
Something like this
$HVinfo = "VT/AMD-V indicates that support is not available for this hardware.",
"VT/AMD-V indicates that VT or AMD-V might be available but it is not supported for this hardware.",
"VT/AMD-V indicates that VT or AMD-V is available but is currently not enabled in the BIOS.",
"VT/AMD-V indicates that VT or AMD-V is enabled in the BIOS and can be used."
Get-VMHost | Select Name,
@{N="HVSupport";E={
$esxcli = Get-EsxCli -VMHost $_
$index = $esxcli.hardware.cpu.global.get() | Select -ExpandProperty HVSupport
$HVinfo[$index]
}} |
Export-Csv C:\HV-report.csv -NoTypeInformation -UseCulture
Note that this will only work for ESXi 5.* hosts this way.
With ESXi 4.* hosts you will have to do a Connect-VIServer to each one before doing the Get-EsxCli.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference