VMware Cloud Community
shivaganji
Contributor
Contributor

How to assign and apply a Host Profile to ESXi host

Hello Folks,

I am trying to apply  Host profiles to my new ESXi before adding it in to production cluster

with the below peace of code i able to pull the host profiles from my vCenter and able to associate the host profile to my new Esxi host.

var vCenterName = HostName.sdkConnection;

var vCProfile = vCenterName;

for each (var profile in vCProfile.hostProfileManager.profile) {

System.log("Profile Name :" + profile.name);

if (profile.name == "profile-Prod") {

var array1 = [];

array1.push(HostName)

profile.associateProfile(array1);

}

I facing a issue in finding the right object to apply host profile to my Esxi host. it will be a great appreciated  .... Smiley Happy

0 Kudos
1 Reply
Windspirit
Hot Shot
Hot Shot

I would assign the hostProfile to the cluster. This way any new Host joining the cluster will inherit the host profile and you just need to execute it on the host.

0 Kudos