yosingh
Enthusiast
Enthusiast

Powercli to list HostProfile version

Jump to solution

Hi,

How to print host profile version using powercli. I have used below below command to list hostprofile. but not able to print the version i.e host profile name : version(5.0,6.0 etc)

Get-VMHostProfile | ? { $_.ExtensionData.Config.ApplyProfile.ProfileVersion -like "5*" }

Also is there any way we can upgrade host profile online?

Help is appreciated.

1 Solution

Accepted Solutions
LucD
Leadership
Leadership

You mean like this?

Get-VMHostProfile |

Select Name,@{N='Version';E={$_.ExtensionData.Config.ApplyProfile.ProfileVersion}}

Afaik, there is no direct method to upgrade the version of a HostProfile.

But you could use the Export-VMHostProfile and Import-VMHostProfile cmdlets.

The HostProfile would probably take the hostprofile version of the platform on which you run the import.


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

View solution in original post

8 Replies
LucD
Leadership
Leadership

You mean like this?

Get-VMHostProfile |

Select Name,@{N='Version';E={$_.ExtensionData.Config.ApplyProfile.ProfileVersion}}

Afaik, there is no direct method to upgrade the version of a HostProfile.

But you could use the Export-VMHostProfile and Import-VMHostProfile cmdlets.

The HostProfile would probably take the hostprofile version of the platform on which you run the import.


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

yosingh
Enthusiast
Enthusiast

Excellent !!! Thanks a lot for your help!

0 Kudos
yosingh
Enthusiast
Enthusiast

Can you please help me to add filter to list the hosts attached with profile.

0 Kudos
LucD
Leadership
Leadership

Try like this

Get-VMHostProfile |

Select Name,@{N='Version';E={$_.ExtensionData.Config.ApplyProfile.ProfileVersion}},

   @{N='Attached VMHost';E={(Get-View -Id $_.ExtensionData.Entity -Property Name).Name -join '|'}}


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

yosingh
Enthusiast
Enthusiast

Thanks a lot!

@LucD Your response is faster than VMware BCS :smileygrin:

0 Kudos
yosingh
Enthusiast
Enthusiast

While importing host profile it is still taking old host profile version. I think i need to create a new one or is there any way i can just duplicate the settings to new host profile?

0 Kudos
LucD
Leadership
Leadership

I was afraid of that, the Version seems to be part of the export-import.

Which makes sense in a way.

I checked the underlying vSphere methods related to HostProfile, but it looks as if there is no method to just upgrade the version of a HostProfile.

When you created the HostProfile from an existing ESXi node, you could just recreate it in the new environment.

Otherwise you will have to make sure that all settings are specified in the new HostProfile.


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

0 Kudos
yosingh
Enthusiast
Enthusiast

Thank you!

0 Kudos