VMware Cloud Community
Windspirit
Hot Shot
Hot Shot
Jump to solution

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
1 Solution

Accepted Solutions
Windspirit
Hot Shot
Hot Shot
Jump to solution

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

2 Replies
Windspirit
Hot Shot
Hot Shot
Jump to solution

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.

aslk5
Enthusiast
Enthusiast
Jump to solution

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