Windspirit
Hot Shot
Hot Shot

remidiate Host Profiles

Hi all,

I been hammering away at this but I'm having trouble.

System: vCenter 6.7, vRO  7.6

Objective: remediate (apply host profile) to esxi after changing some content of the Answer file.

What I have: I have added a host profile to the Cluster, added a new ESXi, changed the answer file content

What I cant figure out: How to apply the host profile.

API tells me to use: VcHostProfileManager.applyHostConfig_Task() however it requires VcHostConfigSpec and I cant find to get them.

Anyone?

Tags (2)
Reply
0 Kudos
Windspirit
Hot Shot
Hot Shot

oh well...

Sometimes it helps just to step away...

here the answer:

profile=hostProfileManager.findAssociatedProfile(host)[0];

exec=profile.executeHostProfile(host);

taskID=hostProfileManager.applyHostConfig_Task(host,exec.configSpec);

stuff=System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(taskID,false,2);

The problem was that I didn't realize that the type vc:Profile is the same as the type vc:HostProfile

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

View solution in original post

aslk5
Enthusiast
Enthusiast

Hi Daniel,

Can you share part of your code for what you did to edit the answer file? I've managed to pick the profile I want, apply it to the host and do the remediation (with the help of your code above) but the trying to feed in all the answers are giving me a little trouble.

Anything you can share would be helpful

thanks

Reply
0 Kudos