DanMan3395
Enthusiast
Enthusiast

Use powerCLI to check and set the MTU settings in Host Profiles

I want to scan all the host profiles in our environment and validate the MTU settings on all the vmk's in the profiles. However, there seems to be little to no documentation on how to access the information in a host profile via powerCLI. I want to assume all the information in a host profile can be found somewhere under the results returned from a Get-VMHostProfile but these things are massive just combing through it is not helping. This is made harder by the fact that none of the extension data in this object seems to be named or categorized the same as in the GUI...rac

Anyone else already crack this nut and willing to share the code?

5 Replies
scott28tt
VMware Employee
VMware Employee

Moderator: Thread moved to the PowerCLI area.

0 Kudos
LucD
Leadership
Leadership

Not really.

I normally start from the HostApplyProfile object as documented in the API Reference.
From there you go into the subprofiles, but there is a lot of reverse engineering involved afaik.

I published one simple attempt in Change The Root Password In Hosts And Host Profiles
But it is admittedly a simple one (and I'm not even sure if it works in all vSphere versions).


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

DanMan3395
Enthusiast
Enthusiast

yeah I saw your other answer explaining this and citing that root password script. I read through it and attempted to extrapolate the method for this purpose but due to the lack of documentation I cannot find where the actual entries in the host profile are for each setting they store. There are hundreds and they do not appear to be named in any useful way so without a doc to translate what I am looking at, I am not sure this is even possible.

If LucD says it cannot be done, I can accept that as fact. Smiley Happy

0 Kudos
LucD
Leadership
Leadership

I'm not saying that it can't be done, but it will require a lot of trial-and-error and reverse engineering :smileygrin:
Plus what works in version x.y is not guaranteed to work in version x.z (see KB52932).


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

DanMan3395
Enthusiast
Enthusiast

yeah and considering that the newer releases have SMARTLY changed the host profiles to a JSON format. I think i may just wait until we upgrade. I was just wondering if the legacy host profiles weren't actually as bad as they seemed and I was missing something. Thanks for the info!

0 Kudos