Using vSphere 5 auto-deploy in your home lab

25 August, 2011

I was just playing around with auto-deploy and I figured I would quickly scribble down the steps required to configure it. The documentation is okay but it often refers me back and forth in the document which makes it difficult to read at times. Here is what I did to get it working. I was in doubt if I would add screenshots, but that would make this article fairly lengthy and I am sure that most of you wouldn’t need it any way. I have my complete lab virtualized at home, so this whole setup is running in VMware Workstation.

Download vCenter Server 5

Download the ESXi 5.0 Offline Bundle

Install vCenter Server 5

Install Powershell 2.0 (installed it on the vCenter Server)

Install PowerCLI (installed it on the vCenter Server)

Install Auto-deploy (also located on vCenter iso) (installed it on the vCenter Server)

Install TFTP Server (I used Solarwinds) (installed it on the vCenter Server)

Click “File” and “Configure” and start the TFTP Server

A folder C:\TFTP-Root will be created

Make sure if you are running this on Windows that the Firewall is open for TFTP

Copy the location of “BIOS DHCP File Name as mentioned in your Auto Deploy screen. This will be “undionly.kpxe.vmw-hardwired”.

Go to your DHCP Server and add the filename and the ip address of the

In my case this is what I added to the advanced settings in my Tomato Router/DHCP server:
dhcp-boot=undionly.kpxe.vmw-hardwired,,192.168.1.45

In the case of a MS DHCP Server you will need to follow this MS KB article. (#66 and #67 should be sufficient)

Now it should be possible to boot your host, however you should see a screen that tells you that there no ESXi image associated yet. Now we need to do some PowerCLI magic…

First of all we will need to set the execution policy to “remotesigned” if you haven’t done so already, in my case I haven’t as this is a brand new installed Windows VM:
Set-ExecutionPolicy RemoteSigned

Now you can open up PowerCLI and connect to your vCenter Server:
Connect-VIServer <vcenter name>

Next we will need to add a software depot, this is the Offline Bundle file you downloaded at the beginning:
Add-EsxSoftwareDepot c:\tmp\VMware-ESXi-5.0.0-469512-depot.zip

Now that you’ve added the depot you will need to identify the ImageProfile you wan to use. Run the following command to list the image profiles:
Get-EsxImageProfile

In my case it returns the following:
Name
——-
ESXi-5.0.0-469512-no-tools ….
ESXi-5.0.0-469512-standard ….

We will use the “Standard” image profile as we want to be able to install VMware Tools as well through vCenter. In order to use it we will need to define a rule. This basically tells the client which image it should pick up during the PXE Boot. No key thing with this command is the “-Pattern” as that basically defines which machines will get boot the image. In my case everything is running within VMware Workstation and the vendor will always be “VMware Virtual Platform” so I decided to use that is the identifier for this specific rule.
New-DeployRule –Name “FirstTimeBoot” –Item “ESXi-5.0.0-469512-standard” –Pattern “model=VMware Virtual Platform”

This will take a while as it is unzipping and uploading the required packages. When it has successfully completed we will need to make this deploy rule active:
Add-DeployRule -DeployRule FirstTimeBoot

That’s it, now the host should be able to boot up using the assigned image profile. See the screenshot below of my PXE booted ESXi host within VMware Workstation

Now if you would go to vCenter and check your Datacenter you will see a host appearing. This host however will still need to be configured and that is the second portion of this exercise…

What we creating here is a stateless configuration. That means we will need to use host profiles in order to configure this host correctly after reach reboot. These are the steps I took to create a host profile for my Lab hosts:

After creating the host profile you will need to attach the host to the profile and check for compliancy. This test should fail as you will need to create an answer file first.

Right click the host and select “Update Answer File”

Check all settings (ip-address etc) and when finished click “update”

Right click the host and select “Check Answer File”, result should be “x”

Select the host and click “Check Compliance”, result should be “compliant”

Before we will create a new deploy rule we will want to add the HA depot and create a new image profile which includes the HA agent as we will want our hosts to be part of that. If you don’t add it the “new-deployrule” statement will throw a message that you will need to add it. First we will add the vSphere HA depot. The ip-address should of course be replace with the ip-address of your own vCenter server:
Add-EsxSoftwareDepot http://192.168.1.45:80/vSphere-HA-depot

Now we will create a new deploy rule and associate it with the just created host profile called “ESXiLabHostProfile”. We will also directly enable this new rule. Note that “HA-DRS” is the name of my cluster in this case. First we will remove the old rule to make sure we start with a clean slate:
Remove-DeployRule -DeployRule FirstTimeBoot -delete
New-DeployRule –Name “ProductionBootRule” –Item “ESXiHA”, ESXiLabHostProfile, HA-DRS –Pattern “model=VMware Virtual Platform”
Add-DeployRule -DeployRule “ProductionBootRule”

Now you can restart the ESXi host and it should end up in the cluster (HA-DRS) with the correct host profile (ESXiLabHostProfile) and completely configured ready for action! (Note that for the next host you will need to create the answer file as well initially for it to work correctly.)

That’s it for today… Hope it helps, I had a lot of fun exploring this cool new feature! I love it but boy do I feel like a n00b playing around with PowerCLI after having seen some of Alan‘s or Luc‘s magic. Gabe also has a nice article on this topic… check it out, worth reading!

Thanks for posting a wonderful topic, i have one query on this. i am getting bellow error message when i am running Get-EsxImageProfile in vSphere Power CLI.

[vSphere PowerCLI] C:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-
EsxImageProfile
The term ‘Get-EsxImageProfile’ is not recognized as the name of a cmdlet, funct
ion, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:20
+ Get-EsxImageProfile <<<<
+ CategoryInfo : ObjectNotFound: (Get-EsxImageProfile:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

The above Add-PSSnapin comment saved me some added frustration so thanks for that. I installed the latest version PowerCLI (5.1.0-793510) on a fresh Win2K8-R2 box and the image building commands weren’t listed or available. Kinda hard to test VSphere 5.1 Autodeploy if you can create a custom image! The Add-PSSnapin comment did the trick.

Thanks for the great article Duncan. I have been running vmware in workstation 7.1.4 for a long time. ESXi and everything, no problems.
Now I tried to install ESXi 5.0 from the install ISO, not the offline bundle and it comes up with the error

I know the message is not correct as it is turned on in the BIOS and I do not experience the same error in ESXi 4.1. Did you got the same message during your installs? Do you think workstation just need an update to fully support 5.0?
Thoughts?

I receive a warning on the installation of ESXi 5 that says: “HARDWARE_VIRTUALIZATION WARNING: Hardware Virtualization is not a feature of the CPU, or is not enabled in the BIOS”. I checked the BIOS on my laptop (Dell M6500) to verify that virtualization is enabled, but I am wondering if the error is originating from the BIOS of the VM. A peek into the PhoenixBIOS Setup Utility of the VM shows no option to enable virtualization that I can see. Am I missing something?

I am trying to install ESXi 5 as a VM in VMware Workstation 7.1.4 (latest available build), but I don’t see ESXi 5 as a supported operating system.

I am also wondering how to simulate shared storage that would normally be configured as SAN attached storage if I were installing ESXi on bare-metal servers. Can anyone point me in the right direction?

Duncan,
Do you have any insight into why PXE Manager was not GA’d for this role instead of Auto-Deploy? I have been using in on a lab in a laptop for switching between 4.1 and 5 and to show the power of stateless computing. The auto-deploy seems to rely on downloading 3rd party software and a lot more manipulation. I thought the PXE manager was an unbelievable tool. Thanks.

I had to delete the HA-DRS in “New-DeployRule –Name “ProductionBootRule” –Item “ESXiHA”, ESXiLabHostProfile, HA-DRS –Pattern “model=VMware Virtual Platform””. Maybe a mistake by editing the naming scheme? However, great work and have fun in Vegas.

replace vcenter-server-name with the name of your vCenter server OR the ip-address and yes you will need to be able to access this url via a browser as well and it should return a blank page. Can you access http://vcenter-server-name ?

FYI: I tried this with the vCenter Appliance and I was successful. I skipped the following steps:
Install Powershell 2.0 (installed it on the vCenter Server)
Install Auto-deploy (also located on vCenter iso) (installed it on the vCenter Server)

I installed the TFTP server and PowerCLI onto mylaptop. Everything worked as it should. I am unsure if the TFTP server is included with the vCenter Appliance. Is a command-line available for the vCenter Appliance? root/vmware did not let me in…

Interesting results:
1. I added the VEM offline bundle to the image
2. I added my host to the 1000v
3. I updated my host profile
4. I removed the AutoDeployRule
5. I created a new AutoDeployRUle with the updated host-profile.

Upon reboot the networking seems to revert back to a standard vSwitch. It actually creates a new one called “M-switch”. I was hoping I would be able to have auto-deploy automatically place a host into the 1000v dvSwitch. I will keep troubleshooting and let you know if I get it working.

For some reason, that was set to VLAN 200, while my PXE boot environment was on the native VLAN. The host would come up, install ESXi stateless, and when it tried to apply the host profile, it put itself in VLAN 200, effectively disconnecting it from my DHCP, and losing connectivity.

How can I get the deployed hosts licensed? I have atztached a license to my Reference host. I have updated the profile, applied the profiule to the depolyed hosts, but they run in Eval mode. How can I incroporate the license in the profile?

On the profile, it does not setup the VMKernel NIC on the distributed switch and also does not remove the VM Network Port Group on the Standard switch. Both are configured in Host Profile and setup in the Answer File.

If we set the host to maintenance mode and apply the profile manually all is fine. Once we reboot the host all config is reset, we get again the “VM Network” and the VMKernel NIC is gone again. That is why I think it simply doesn’t use the attached host profile…

Found it under home>management>host profiles>yourvcentername menu, check “host and clusters” tab. Not directly right click on your host in your inventory -_-

Also the host profile is not compliant but only when you edit the host profile after creation and change some values of some fields like “hostname” under dns section to “user speficied while applying the configuration”.

Thanks for the wonderful blog.
However I have two questions:
1. For “Add-ESXSoftwareDepot” cmdlet to work do I need “AutoDeploy”
2. Are there any pre-requisites for Auto deploy installation, as am unable to install AutoDeploy.

Has anyone else run into problems downloading the deploy-tftp.zip file from vCenter? The download starts but never completes, despite being only 500k! I’ve got this issue in my lab and at least one other person has also found the same problem;http://communities.vmware.com/message/1991704#1991704

I’ve worked around it for the time being but curious to know the root cause.

Thanks for this article, I’m finding it very useful. Am having difficulties though. My server seems to hang just after the “Booting through VMware Autodeploy” screen (with the list of machine attributes, and the ESXi image). All looks okay but it just hangs at the line /vmw/cache…

I’m using Auto Deploy in 5.1 (home lab 2 servers) and wonder if I should forget all about static ips. I used to set static for about all networking iSCSI, vMotion and the hosts.
Seems like hard to set in Host Profiles….

IN DNS and Routing I used to name my hosts. Now they come up as localhost…can host profiles auto name hosts?

I have a question about redirecting the TFTP-Root files to a sub-directory of TFTP-Root.

In a shared environment with multiple pxe boots taking place from the same tftp server this is a critical design element for me to deploy this technology.

I have looked at the Auto Deploy documentation and I do not see any information about using a subfolder. Is there a way to specify this, for example, when creating the option 66 value on the DHCP scope?

Thank you for the great walk through. I am wondering however about where you would put the servers for this in a real production environment. I always worry about the worst case of the entire datacenter losing power and me having to boot from a cold room so I don’t see how I could have this virtualized. Seems a dedicated server would be needed but I am very interested in your thoughts.

The sole reason why we are looking at using Auto deploy was to simplify the deployment and update process.
IE update the repository with the new Image, reboot the hosts the new image is installed and it joins it back into the cluster again.

However if we want the resilience of stateless caching we can add it into a HA cluster is this correct or am I reading this wrong?

I have a lab with two physical ESXi 5.5 hosts (ESX03, ESX04). I thought it would be sweet to prove out Auto Deploy in this lab by attempting to install ESX05 into a VM and join the VM into the cluster (not to actually host nested VMs, just to prove out Auto Deploy, then shut the virtual host down). I was attempting the PXE boot portion using IOS DHCP, this was failing and I don’t know why, configuration is below. Any ideas?

I interpreted TFTP open timeout under these conditions to mean that the VM itself wasn’t receiving the DHCP options from IOS DHCP, I just can’t seem to prove it. I was not able to confirm options sent from IOS DHCP to the client via Cisco debug but I don’t know if that’s part of the typical debug output anyways.

I moved from IOS DHCP to Microsoft, the PXE portion now looks fine, I now need to deal with setting up my images. I also added to the end of my VMX file changes to allow me to run ESXi within a VM:
vhv.enable = “TRUE”
hypervisor.cpuid.v0 = “FALSE”

I probably won’t spend much more time messing with IOS DHCP. At this point I’m less curious about solving that problem and more curious to have this question answered:

Reboot VM and wallah. VM PXE boots the ESXi image over the network loads into memory. The VM has no 'hard disk' (VMDK) at all, just CPU and RAM.

I may try to fix IOS DHCP problem just because I'm curious though this would probably never get deployed in a customer environment. I'll probably work on fine tuning, Host Profiles and such, but there you have it, Auto Deploy proven with no physical host, used a VM to emulate what would happen on a real host instead.