Here in my post I’m going to show the way that you can configure this feature in the vSphere 6.0 vCenter server, I’m really sorry If I made this post long as I need to show you the every single step that I followed in my deployment, that might be really helpful to a new starter and those who new to Auto Deploy feature.
By default, hosts provisioned by the auto deploy pull down the ESXi image each time at the host boots. If the auto deploy server or the FTP server which is holding the ESXi image is down host will not boot using the auto deploy. You can see a similar error and your host will reboot frequently.
Also, confirm the Service status my vCenter is a Windows server and I can check my service status from “services.msc” console
Auto Deploy is keeping it’s OS in the RAM and it is not using a local storage to keep it’s log files. I believe you know the importance of the log files in a situation like PSOD. That’s where Syslog collector and ESXi dump collector come in to play. You can read my previous post regarding Syslog collector and ESXi Dump collector configuration for more information. We need to use VMware Host Profiles for this auto deploy Configuration and we need to configure this collectors in the reference host before create the Host Profile. Enable and start the “ESXi Dump collector” service.
Once you have successfully enabled the VMware Auto Deploy service go to your vCenter and select “Auto Deploy” under “Manage” tab. You can find the TFTP Boot zip this location and download the zip file. We need these files to setup the TFTP boot image.
Now, it’s time to jump in to my SolarWinds TFTP server and note the “Root” folder and start the TFTP service.
Extract the downloaded TFTP boot zip file to the TFTP Root directory
Let’s configure the DHCP options to stream the boot image as a PXE boot. Expand your DHCP server, right-click on the “Scope Option” and select the “Configure Options…”
Enable the DHCP option “066” and type the FQDN/IP of your TFTP server
Enable the DHCP option “067” and type the boot file name, you can find this from the listed extracted files in the TFTP Root directory, just copy and paste the “undionly.kpxe.vmw-hardwired” file name as the bootfile name.
So now, we have successfully configured the DHCP Options, TFTP server and enabled the Auto Deploy service in the vCenter. It’s time to create an Image Profile for the hosts. You can read more about Image builder and creating an image profiles from my previous post.
Creating an Image profile for Auto Deploy
Login to the VMware site and download the ESXi 6.0 Offline bundle to create the Image profile.
Again, I’m not going to show you the deep configuration of the Image builder, I’m just showing only the required steps for the Auto Deploy Configuration.
Add your downloaded ESXi offline Bundle to your software depot by typing “Add-EsxSoftwareDepot ‘<path to your offline bundle>’ command using the VMware PowerCLI. Hope you already know how to use the PowerCLI
Check the ESXi image profile which is in the offline bundle using “Get-EsxImageProfile” command
Also, you can just get the image profile name without the other details, we need this to clone an existing image profile and create a new one. Use “Get-EsxImageProfile | select name” command
I’m cloning an existing Image profile and create a new one. Use “New-EsxImageProfile -CloneProfile “<name which we obtained in the previous step>” -Name “<name of the new profile>” -Vendor “VMware,Inc.”” PowerCLI command
Check and confirm the Cloned Image profile
Also, at this stage you can add any third party drivers and any plugins to the image profile. You can read my “Image Builder” post for more details.
Export created Image profile to an ISO or Zip file at the next step. Power CLI command is “Export-EsxImageProfile -ImageProfile “<image profile name>” -ExportToIso -File “<location>””
Check the created ISO image inside the folder and we are done with the Image Profile creation for Auto Deploy
Host Profile Creation for Auto Deploy
Hope you already know about VMware Host Profiles which we can place all the ESXi configuration and apply to a new ESXi host and get all the configuration at once before we release to the Production. I would recommend you to do all the configuration in a single host and create a Host Profile referencing the configured host.
I’m showing you how to Extract the configuration from a reference host as Host Profile creation is a separate part to discuss.
Right-click on the fully configured ESXi host which is added to your vCenter and select “Host Profiles” and “Extract Host Profile…” from the Web UI.
Provide a name and a description click “Next” and click “Finish” at the final window.
Creating Auto Deploy Rules
Now we have successfully completed more than 80% of the configuration and to automate the process you need to have set of rules to perform the tasks such as boot the Host using the Image Profile, attach and apply the Host Profile, add Host in to a cluster automatically without a user interaction.
Basically, in this rule set it defines the boot image, Host Profile, Cluster which this host needs to be added. Also, we need to specify the IPv4 address range which these hosts reside. Let’s jump in to create the Auto Deploy rules.
Firstly, we need to upload the created Image profile as the boot image. Use this command to create the rule
“New-DeployRule -Name “<specify a name for the rule>” -Item “<Image profile name>” -Pattern “ipv4=<dhcp address range of the hosts>””
Uploading image will take couple of minutes and wait until it complete the upload, you can see the status in the Power CLI window.
Once the Image profile uploaded and complete the rule creation you can see the added rule as below
Add the created boot image Deploy Rule to the Auto Deploy process by using “Add-DeployRule <created rule name>. Similar output can be seen after the complete addition.
Let’s create a rule to add this host to a specified cluster while it deploying the host. You need to create a cluster in the vCenter, in my case my cluster name is “ARAutoDeployCluster”. Use “New-DeployRule -Name “<name of the rule>” -Item “<Cluster name>” -Pattern “ipv4=<host address range>”” command to create the rule. Rule output can be seen as below.
Host Profile needs to be added to the host to get the exact configuration and we need to create a rule for that. Use “New-DeployRule -Name “<rule name>” -Item “<Created Host Profile Name>” -Pattern “ipv4=<host address range>”
We have created the rules and still didn’t add the rules to the process. Add these rules using “Add-DeployRule” command
Great! now we are almost done. You need to set the first boot device as the Network boot to stream the boot image from the TFTP server and restart the host. It will get an IP address and boot image details from your DHCP server and will start to deploy the host.
Check your vCenter and your new host will appear and add to your Cluster as you specified in the rule set.
Sometimes, you might use the FQDNs to add hosts to the vCenter but here you can see the host added with IP address. That’s a good point, as a best practice we use either IPs or FQDNs to add host to the vCenter. But here my host added with the IP and I wanted to fix it.
This also a very important when you are using Auto Deploy in your environment since the IPs obtain through the DHCP IPs will change, I recommend to use the IP reservation for the Auto Deploy hosts. Also, creating A and PTR records in your DNS server these Hosts will connect with the FQDNs.
I got the MAC address of my new host and created an IP reservation in my DHCP scope.
Try to remove the Host from the vCenter if it added with the IP address and reboot the host. Check the status your Host will connect with the FQDN. So that’s all done.