Deploying VMware ESXi (Part 3)
Deploying VMware ESXi with vSphere Auto Deploy
vSphere Auto Deploy is a network deployment service that enable ESXi hosts to be built of an image template over a network connection. No mounting of installation media is required to get an ESXi host up and running if it is installed using Auto Deploy. You need to address a number of prerequisites before using Auto Deploy. They are listed here, but before I get too far into this section I wanted to mention the requirement for a vCenter server. Auto Deploy requires an installed vCenter server to operate.
vSphere Auto Deploy can be configured with one of three different modes:
- Stateless
- Stateless Caching
- Stateful Install
In the Stateless mode, you deploy ESXi using Auto Deploy, but you aren't actually installing ESXi. Instead of actually installing ESXi onto a local disk or a SAN boot LUN, you are building an environment where ESXi directly loaded into memory on a host as it boots.
In the next mode, Stateless Caching, you deploy ESXi using Auto Deploy just as with Stateless, but the image is cached on the server's local disk or SAN boot LUN. In the event that the Auto Deploy infrastructure is not available, the host boots from a local cache of the image. In this mode, ESXi is still running in memory but it's loaded from the local disk instead of from a Auto Deploy server on the network.
The third mode, Stateful install, is similar to Stateless Caching except the server's boot order is reversed: local disk first and network is second. Unless the server is specifically told to network boot again , the Auto Deploy service is no longer needed. This mode is effectively just a mechanism for network installation.
Auto Deploy uses a set of rules (called deployment rules) to control which hosts are assigned to particular ESXi image (called an image profile). Deploying a new ESXi image is as simple as a modifying the deployment rule to point that physical host to a new image profile and then rebooting with the PXE/network boor option. When the host boots up, it will receive a new image profile.
There are several steps you have to accomplish before you are ready to deploy ESXi in this fashion:
- You must set up a vCenter server that contain a vSphere Auto Deploy service. This is the service that stores the image profile.
- You must set up and configure a TFTP server on your network.
- A DHCP server is required on your network to pass the correct TFTP information to hosts booting up.
- You must create an image profile using PowerCLI.
- Using PowerCLI, you must also create a deployment rule that assigns the image profile to a particular subset of hosts.
Once you have completed these five steps, you are ready to start provisioning hosts with ESXI. When everything is configured and in place, the process looks something like this:
- When the physical server boots, the server starts a PXE boots sequence. The DHCP server assigns an IP address to the host and provides the IP address of the TFTP server as well as a boot file name to download.
- The host contacts the TFTP server and download the specified filename, which contains the gPXE boot file and a gPXE configuration file.
- gPXE execution; this causes the host to make an HTTP boot request to the Auto Deploy server. This request include information about the host, the host hardware, and host network information. This information is written to the server console when gPXE is executing.
- Based on the information passed to it from gPXE, the Auto Deploy server match the server against a deployment rule and assign the correct image profile. The Auto Deploy server then streams the assigned ESXi image across the network to the physical host.
When the host has finished executing, you have a system running ESXi. The Auto Deploy server can also automatically join the ESXi host to vCenter server and assign a host profile for further configuration. As you can see, this system potentially ofers administrators tremendous flexibility and power.
Finding the vSphere Auto Deploy Server
The vSphere Auto Deploy server is where the various ESXi image profile are stored. The image profile is transferred from this server via HTTP to a physical host when it boots. The image profile is the actually ESXi image, and it consists of multiple vSphere installation bundle (VIB). VIBs are ESXi software packages; these could be drivers, common information management (CIM) providers, or other applications that extend or enhance the ESXi platform. Both VMware and VMware's partners could distribute software as VIBs.
The vSphere Auto Deploy service is installed but not enable by default bu vCenter server. Previous versions of vSphere required a separated install of Auto Deploy.
- Open up the vSphere web client and connect to vCenter server.
- navigate to vCenter Inventory lists--->vCenter--->Manage--->Manage setting--->Auto Deploy
You will see information about the registered Auto Deploy service.It shows the Auto Deploy screen after we installed vCenter and enable Auto Deploy service.
That's it for the Auto Deploy server itself; once it's been installed and is up and running, there is very little additional work or configuration required, except configuration TFTP and DHCP on your network to support vSphere Auto Deploy.
Configuring TFTP nad DHCP for Auto Deploy
The procedures for configuring TFTP and DHCP will vary based on the specific TFTP and DHCP servers you are using on your network. For example, configuring ISC DHCP server to support vSphere Auto Deploy is completely different from configuring the DHCP server service provided with Windows server. Therefore, I can provide only high-level information in the following section.
Configuring TFTP
For TFTP, you need only upload the appropriate TFTP boot file to the TFTP directory. The download TFTP Boot ZIP link provides the necessary files. simply download the ZIP file using that link, unzip the file, and place the contents of the unzipped file in the TFTP directory on the TFTP server.
Configuring DHCP
For DHCP, you need to specify two additional DHCP options:
- Option 66, referred to as next-server or as Boot Server Host Name, must specify the IP address of the TFTP server.
- Option 67, called boot-filename or Bootfile Name, should contain the value undionly.kpxe.vmw-hardwired.
If you want to identify hosts by IP address in the deployment rules, then you will need a way to ensure that the host gets the IP address you expect. You can certainly use DHCP reservation to accomplish this, if you like;just be sure that options 66 and 67 apply to the reservation as well.
Once you have configured TFTP and DHCP, you are ready to PXE boot your server, but you still need to create the image profile to deploy ESXi.
Create an image profile
The process for create an image profile may seem counterintuitive at first; it did for me. Creating an image profile involves first adding at least one software depot. A software depot could be a directory structure of files and folders on a HTTP server, or (more commonly) it could be an offline depot in the form of a zip file. You can add multiple software depots.
Some software depots will already have one or more image profiles defined, and you can defined additional image profiles (usually by cloning an existing image profile). You will then have the ability ti add software packages (in the form of VIBs) to the image profile you have created. once you have finished adding or removing software packages or drivers from the image profile, you can export the image profile (either to an ISO or ZIP file for use as an offline depot).
All image profile tasks are accomplished using PowerCLI, so you will need to ensure that you have a system with PwerCLI installed in order to perform these tasks. I will walk you through creating an image profile offline depot zip file.
Perform the following steps to create an image profile (vSphere 6):
- At a PowerCLI prompt, use the Connect-VIServer cmdlet to connect to vCenter server.
- User the Add-EsxSoftwareDepot command to add the ESXi offline depot file Also if you need other software depots repeat the command, after command mention local of online address.
- Use the Get-EsxImageProfile command to list all image profiles in all currently visible depots.
- To create the new image, clone an existing profile (existing profiles are topically Read-Only) using the New-EsxImageProfile command: New-ExImageProfile -CloneProfile "EXISTING PROFILE" -Name "NEW PROFILE"
Once you have an image profile established, you can customized it by adding VIBs or you can export it. You might want to export the image profile because after you exit a PowerCLI session were you have created image profiles, the image profile will not be available when you start a new session. Exporting a image profile as a ZIP file offline depot, you can easily add it back in when you start a new session.
To export an image profile as a ZIP file offline depot, run this command: Export-EsxImageProfile -ImageProfile "YOUR PROFILE" -ExportToBundle -FilePath "PATH AND NAME.zip"
When you start a new PowerCLI session to work with an image profile, simply add this offline depot with the Add-EsxSoftwareDepot command.
The final step is establishing deployment rules that link image profiles to server s in order to provision ESXi to them at boot time.
Establishing Deployment Rules
when you define a deployment rules, you are linking an image profile to one or more hosts. At this point vSphere Auto Deploy will copy all the VIBs defined in the specified image profile up to the Auto Deploy Server so they are accessible from the hosts. When a deployment rule is in place, you can actually begin provisioning hosts via Auto Deploy.
As with image profiles, Deployment rules are managed via PowerCLI. you will use the New-DeployRule and Add-DeployRule commands to define new deployment rules and add them to the working rule set.
Perform the following steps to define a new deployment rule:
- In a PowerCLI session where you have previously connected to vCenter server and define an image profile, use the New-DeployRule command to define a new deployment rule that matches an image profile to a physical host: New-DeplyRule -Name "NAME" -Item "PROFILE" -Pattern "vendor=VENDOR" , "ipv4=XXX.XXX.XXX.XXX,YYY.YYY.YYY.YYY" This rule assigns the profile named PROFILE to all hosts with VENDOR in the vendore string and that have the IP address XXX.XXX.XXX.XXX or YYY.YYY.YYY.YYY. You also could specify IP range.
- Next, create a deployment rule that assigns the ESXi host to a cluster within vCenter server: New-DeployRule -Name "CLUSTER" -Item "CLUSTE-1" -AllHosts This rule puts all hosts into the cluste named CLUSTER-1 in the vCenter server with which the Auto Deploy server registered.
- Add these rules to the working rule set: Add-DeployRule Img-Rule Add-DeployRule Default_Cluster As soosn as you add the deployment rules to the working rule set, vSphere Auto Deploy will, if necessary, start uploading VIBs to the Auto Deploy server in order to satisfy the rules you have defined.
- Verify that these rules have been added to the working rule set with the Get-DeployRuleSet command.
Now that a deployment rule is in place, you are ready to provision via Auto Deploy. Boot the physical host that matches the patterns you define in the deployment rule, and it should follow the boot sequence described at the start. Wen the server comes up, they will boot the newly assigned ESXi image via PXE.
The next part of this document will be the last, It will contains Auto Deploy in vSphere 6.5 and all 3 modes conditions.