VMware Cloud Community
yosingh
Enthusiast
Enthusiast
Jump to solution

Powercli to list HostProfile version

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
Jump to solution

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
Jump to solution

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
Jump to solution

Excellent !!! Thanks a lot for your help!

Reply
0 Kudos
yosingh
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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
Jump to solution

Thanks a lot!

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

Reply
0 Kudos
yosingh
Enthusiast
Enthusiast
Jump to solution

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?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
yosingh
Enthusiast
Enthusiast
Jump to solution

Thank you!

Reply
0 Kudos