官术网_书友最值得收藏!

Using host profiles

In the preceding section, we learned how to manipulate and create custom ESXi images using PowerCLI cmdlets. So, now let's take a closer look at how to manipulate host profiles so that we can use both at a later stage in order to automate ESXi deployments. In case of VMware technologies, a host profile is a profile that stores all the configuration information of a host. We can configure an ESXi host as required and mark the host as the golden standard. Next, we create a host profile from the configuration of this host. Once the profile is ready, we can simply apply the profile to other hosts so that they can be automatically configured. This way, we can ensure consistency between host configurations across the entire infrastructure.

For this lab, we will get the following architecture:

Using host profiles

We have a vcenter.lab.com server as a vCenter server. Under this, we have a datacenter named Datacenter. A cluster named Lab Cluster is created under Datacenter. The cluster has two ESXi hosts: esxi1.lab.com and esxi2.lab.com. We have chosen esxi1.lab.com as the golden host and will apply the host profile to the other host.

First, let's get a list of the commands available to manage a host profile.

Using host profiles

So, first create a host profile from the command line using a standard host:

PS C:\Users\vcadmin> New-VMHostProfile -Name TestHostProfile -Description "Test Profile for Auto Deploy" -ReferenceHost esxi1.lab.com
Using host profiles

We can check the status of the host profiles with the Get-VMHostProfile cmdlet.

Since we have created a host profile, we now need to apply the profile to a host or cluster so that we can run further tasks on the profile.

We can apply a host profile to a host or cluster. In this example, we will apply this on a cluster and keep the level as –AssociateOnly. As the name suggests, it will only associate the host profile with the host and will do nothing else.

Using host profiles

Now, we can check the compliance of a host in this cluster with the host profile that we attached to it.

Using host profiles

Clearly, the host is not compliant with the profile. So, let's apply the profile now. We can apply the profile with the same Invoke-VMHostProfile cmdlet but without the –AssociateOnly switch; however, before we go ahead and apply the profile, we need to put the host into maintenance mode. While we apply the policy, we can see that certain values need to be provided first (for example, vMotion IP and so on).

Using host profiles

We can supply the required values to a variable and then apply the variable to get the end result.

主站蜘蛛池模板: 武定县| 庆城县| 盈江县| 静乐县| 乌兰浩特市| 郑州市| 丹巴县| 旺苍县| 石城县| 吉水县| 上虞市| 安多县| 堆龙德庆县| 开江县| 普陀区| 千阳县| 渝北区| 招远市| 迁安市| 衡山县| 芷江| 赤壁市| 怀安县| 长垣县| 新闻| 龙门县| 孝义市| 天气| 澎湖县| 余姚市| 清远市| 马关县| 吕梁市| 深水埗区| 涟水县| 宜阳县| 高安市| 肥西县| 新郑市| 宜兴市| 东乌珠穆沁旗|