Ok!  Here we go!  AutoDeploy!  Now that we have covered both Image Builder and Host Profiles we can have a look at how to setup AutoDeploy!  Now I don't really expect to have to go through this process from start to finish on the exam, it was quite a big job to get it running.  That said, there are a lot of little tiny task involved in making AutoDeploy work properly that could be fair game on the exam.  Also, I know that we already covered Image Builder and Host Profiles, but I will quickly go over what needs to be done again, as it will help to engrave it into my mind. πŸ™‚

First off, AutoDeploy Installation and Configuration

I'm not going to cover very much in regards to the installation – I mean, you run the vCenter installer, click next next next finish, then enable the plugin in your client.  Yup, that easy!  Configuration however, that will create you some work.  AutoDeploy is cool, but it doesn't come without its fair share of requirements and infrastructure that needs to be in place.  Let's go over some of that!

TFTP Server

First up is a TFTP server!  This needs to be in place!  So go and find a free one if you want or use one that you already have.  If you are using AutoLab then I've got great news for you, there is one already there.  It's installed on your domain controller!  Either way what we need to do is grab a zip file and extract it into our TFTP root.  The zip file can be found by going into the 'AutoDeploy' settings from your vSphere Client.  You should see an option there to 'Download TFTP Boot Zip'.  Basically, just download this and extract it to your TFTP root.  


DHCP Settings

Another third-party component that we need in place to use AutoDeploy is DHCP.  And whatever DHCP server you use you need the ability to set Options 66 and 67 in your scope settings.  What these do is specify where the TFTP server is and what boot file to use.  You can see in the above image that the boot file we need to use is called undionly.kpxe.vmw-hardwired – I'll leave the IP of your TFTP server up to you.  So go ahead and set those options on your DHCP server, 66 being the IP and 67 being the bootfile.  You can see below how I have done using the Windows DHCP server that is configured with AutoLab.


Basically, once you have installed AutoDeploy, TFTP, and setup DHCP with the proper boot server and file options we can go ahead and start with some of the goodness that is AutoDeploy.  Next up, Image Builder!

Image Builder

Remember, we went over this in depth here – but hey, let's build a quick image again!  First, let's get access to our offline depot.

Add-EsxSoftwareDepot C:\OfflineBundle\update-from-esxi5.0-5.0_update03.zip

From there let's go ahead and clone one of the ESXi images into our own new profile that we can use to deploy to hosts.  First, let's get just the name of the Image Profiles so we can easily just copy/paste it πŸ™‚

Get-ESXImageProfile | Select Name

And now, we can do the clone process.

New-EsxImageProfile -Name VCAP_Image_Profile -CloneProfile ESXi-5.0.0-20131002001-standard -Vendor mwpreston.net

At this point we are good unless we wanted to add some external vibs.  For the sake of this article let's just leave it at that.

Host Profiles

I'll let you go over the Host Profiles section that I wrote up yourself.  Basically, we just need a Host Profile setup that will further configure our host after it has been installed by AutoDeploy.

AutoDeploy Rules

Ok, so we have TFTP, we have DHCP, we have our Image Profile and our Host Profile, time to create some AutoDeploy rules.  An AutoDeploy rule basically applies either an image, cluster configuration, or host profile to a host based on a specific component of that host matching a setting.  By that I mean we can match on the IP address, MAC, vendor, model, etc..  I will be using model in this example.  

So there are three auto deploy rules that we need to create and we need to do this in order.  First the Image, then state which cluster we want to join, and finally stating which host profile we would like to apply.  So, let's get started with the image.

New-DeployRule -Name IntialBootRule -Item VCAP_ImageProfile -Pattern "vendor=VMware, Inc."
Add-DeployRule -DeployRule InitialBootRule

And on to the cluster we want the host to join…

New-DeployRule -Name ClusterRule -Item VCAP_ImageProfile -Pattern "vendor=VMware, Inc."
Add-DeployRule -DeployRule ClusterRule

And finally the host profile we wish to apply to the host…

New-DeployRule -Name HostProfileRule -Item VCAP_ImageProfile -Pattern "vendor=VMware, Inc."
Add-DeployRule -DeployRule HostProfileRule

We can also specify the boot image, cluster, and host proflile all in one rule if we want to.  This is done by specifing them separated by a comma as follows

New-DeployRule -Name AutoDeployNestedVMwareHosts -Item VCAP_ImageProfile,MyCluster,MyHostProfile -Pattern "vendor=VMware, Inc"
Add-DeployRule -DeployRule AutoDeployNestedVMwareHosts

At this point we are basically done configuring everything.  You should be able to deploy a host successfully!  But this is the VCAP right?  So I bet they will have this partially setup, or something that needs to be fixed.  I can't see having to go through this whole process.  So, we had better brush up on a few of the other AutoDeploy cmdlets that are available…

Get-DeployRuleSet – gets that current ruleset that we just loaded.

Set-DeployRuleSet – allows you to set the list of rules in the ruleset (Get-DeployRule Rule1, Rule2 | Set-DeployRuleSet)

Set-DeployRule – Update an existing rule (Set-DeployRule -Name "HostProfileRule" -Item "NewHostProfile"

Get-VMHostMatchingRules – Checks to see which rules match on a given host.

Repair-DeployImageCache – used to rebuild the Auto Deploy cache in the case it is deleted

And the most important one to remember for VCAP since it will remind you of the syntax for them all..


Repair-DeployImageCache – used to rebuild the Auto Deploy cache in the case it is deleted

Also another notable mention is the pattern.  AutoDeploy can match on a number of different characteristics of a host to determine which rules to apply.  By simply running Get-VMHostAttributes on a given host we can see all of the different items we have to match on in terms of a pattern


Ok!  At this point I think we are done!!!!  I know this was lengthy but hopefully helpful!!  I'm going to have to go over this stuff a few times in my lab as it is a lot to remember!!!  Good Luck!