VMware Cloud Community
Iyyoo93
Contributor
Contributor

Problem in using Powershell script to edit ESXi Host Profile

HI,

We have the requirement to Add/Edit the host profile's XML content and importing it on a ESXi host.

I have tried the below steps:

1) On ESXi host1, I have executed Export-VMHostProfile command which resulted in filename.vpf file with XML content in it.

2) Using Powershell I tried to add some XML content which sets as IP address to the ESXi host.

3) Then tried to Import the modified profile in step2 on ESXi host2 using Import-VMHostProfile command, which results in displaying following error.

Command Executed:

PowerCLi C:\Program Files <x86>\VMware\Infrastructure\vSphere PowerCLI> Import-VMHostProfile -FilePath c:\HostProfile\hostProfile_Autodeployed.vpf -Name HP_modified_Autodeploy_194

Error Displayed:

Import-VMHostProfile : 6/28/2016 2"39:10 AM Import-VMHostProfile A specified parameter was not correct: createSpec.profileConfigString

At line:1 char:1

+ Import-VMHostProfile -Filepath c:\HostProfile\hostProfile_Autodeployed.vpf - ..

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: <:> [Import-VMHostProfile], InvalidArgument

+ FullyQualifiedErroId: Client20_SystemManagementServiceImpl_ImportVMHostProfile_ViError,VMware.VimAutomation.Vicore.Cmdlets.Commands.Host.ImportVMHostProfile

Could you please look into this issue. Any solution is appreciated.

Is it recommended to pro grammatically edit(using technology like powershell script/ any other script) a host profile and apply to host?

Regards,

Iyyappan

Reply
0 Kudos
0 Replies