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

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.

主站蜘蛛池模板: 桂阳县| 舟曲县| 贺州市| 五寨县| 县级市| 宁南县| 瑞金市| 泾源县| 普宁市| 马关县| 略阳县| 柳河县| 南靖县| 新蔡县| 陆良县| 江城| 昂仁县| 石屏县| 华蓥市| 岗巴县| 宁明县| 会东县| 辉县市| 鱼台县| 连州市| 南召县| 义乌市| 安义县| 九江县| 吐鲁番市| 景洪市| 阜新市| 武冈市| 安庆市| 谢通门县| 姜堰市| 托克逊县| 班戈县| 石门县| 长白| 霞浦县|