Auto Deploy

You are currently browsing articles tagged Auto Deploy.

In the last post we got a VM to auto deploy.  In this post, we’ll wrap up that config (clean it up) and talk about host profiles.  But first, lets talk about use case.  Auto deploy is a neat feature, but I think there’s some misconceptions about how it works.  For instance, when I first read about it, I assumed that you could PXE boot a host right into a new cluster and instantly add capacity.  As it turns out, not so much.  Auto deploy is really just a way to boot machines over the network with a centralized configuration and policy.  Here’s a quick run down of how this process works.

-Configure Auto Deploy to get a new machine to PXE boot
-Configure an Auto Deploy policy to tell the machine what host profile and what cluster you want the host in
-PXE boot a VMware depot image to load ESXi
-The machine loads into vCenter but is in maintenance mode
-Configure that machines answer file for unique machine information
-Reboot the machine again
-The machine should load, vCenter reconnect, and the machine load directly into the cluster

So that’s a super quick run down of how it should work.  Obviously there are a few pieces missing but I’ll run through those in the actual config below.  To start off, lets undo some of the config we did yesterday in VMware power CLI to make the configuration more generic. 

So let’s take a look at what’s already configured first.

Log into the vCenter instance…

image 
Now let’s take a look at the existing deployment rules…

image 
We see the ‘NormalBoot’ rule we created yesterday.  Now, let’s remove that rule entirely from the configuration…

image 
So wait…  We just deleted it and it’s still there?  Yep.  See when you remove the deploy rule, you are essentially just taking it out of the active deployment policy.  If you want to actually remove the policy, you need to add the ‘-delete’ flag to the command.  Since that’s what we want to do, let’s try again.

image 
That’s better.  Now, let’s make our new generic deploy policy.  Im going to run this command to create it…

New-DeployRule –Name “WindowsServerCluster” –Item “ESXi-5.0.0-469512-standard”, “WindowsServer”, “AutoDeploy” –Pattern “ipv4=10.20.30.1-10.20.30.10”

So the first part is just like the last one we did however we are specifying a couple of other items here.
"WindowsServer" – The name of the cluster I want the host join.  You need to create this ahead of time
"AutoDeploy" – The name of the Host Profile I want the host to use. 
-Pattern “ipv4=10.20.30.1-10.20.30.10” – Here I specify what servers I want this policy to apply for.  So I’m saying, any server with an IP between 10.20.30.1 and .10 should match this policy.  I’m actually using MAC address reservations on my switch to make sure that the server get’s an IP in that part of the DHCP scope. 

So let’s plug that in and see what happens…

image 
It didn’t like the command claiming that it cant find the ESXi image I specified.  This is another weird one.  Each time you load PowerCLI to configure a new policy, you need to reload the depot.  So let’s do that and try again…

image 
Last we need to actually activate this policy…

image

Bingo.  New policy loaded.  So now let’s talk about host profiles a little bit.  Host profiles essentially allow you to create a default configuration for ESXi hosts.  When the profile is applied to a host, the host can either be compliant or non-compliant.  In addition, since not each host can be totally identical, the host profiles have something called answer files.  The answer files get associated with particular hosts and provide specific information that’s unique on each host.  I think the easiest way to explain them is to just jump into the config, I’m sure you’ll pick it up quick. 

Start off by going into ‘Hosts and Clusters’ view in vCenter….

image 
Now since I have my vCenter server virtualized I already have a ESXi host loaded and configured the way I want it.  Let’s use that host’s configuration as our baseline (or host profile).  Right click on the host, go to Host Profile, and click Create Profile from host.

image

Give the profile a name click Next, and then Finish.

image 
Now go back to the home page in vCenter, and select the Hosts Profiles link.

image 
You should now be in the Host Profile menu…

image 
Right click your new profile, and select ‘Edit Profile’…

image 
This view allows you to tweak all of the settings associated with the profile.  If you pop into network configuration, you can see that the network configuration is present from the host we created the profile off of…

image 
We want to make a couple of quick changes to the profile for future hosts.  First’ despite using DHCP and MAC reservations for the management vmKernel interface, I still prefer to hard set the IP of the host just incase.  So let’s tell the profile to hard set that IP as part of the answer file. 

image  
Then let’s tell it to prompt for the storage (iSCSI) IP address as part of the answer file configuration. 

image 
Quick note.  It is incredibly important that the Management Network be the first item defined under Host port groups!  If it isn’t the host will boot using a different IP as the management interface.  I lucked out and mine were in the right order, but if yours aren’t, then you’ll need to remove any of the other other policies and recreate them underneath the management interface.

image 
So let’s close this profile, and PXE boot our new host.  The host should boot into the range you defined in your auto deploy rule and with any luck, you should see it load into vCenter.  Note that the host will load in maintenance mode.  This is because we need to finish it’s configuration with an answer file. 

image 
At this point, let’s go back to the host profile view in vCenter. Select Home, Host Profiles, then click your AutoDeploy policy on the far left.  Once the policy loads, select the ‘Hosts and Clusters’ tab on the right hand pane.  

image 
Now right click on the host and click ‘Check Answer file’.  When the process has finished your host should look like this…
 image

 

Now, right click on the host again and choose ‘Update answer file’.

image 
This is essentially a wizard that walks you through all of the items that vCenter needs before it can apply the host profile to the new auto deploy host.  Walk through each item and fill out the information required hitting the ‘Next’ button at the bottom to go to the next item.  When you are done with all of the items, click update to close the screen.  

image

Couple of quick notes.  Make sure that your iSCSI storage initiator name is configured on your SAN so that the box can load the appropriate data stores on the first reboot.  Also, make sure that the IP’s you specify are valid for the iSCSI connectivity. 

Once the update has finished, right click the host again and click ‘Check Answer File’.  The status should change to complete as shown below…

image 
Now for fun, I’m going to add the new host to the DRS cluster that the 10.20.30.5 host is already a part of.  With any luck, the new host (10.20.30.6) should boot, have the host profile applied, exit maintainence mode, and DRS should move at least one of my other running Vms onto 10.20.30.6.

image 
Now reboot the host and let’s see what happens!

After a few minutes, the host comes back online, vCenter reconnects the server, and DRS vMotions a VM over to it!

image 
So there you have it a successful auto deploy scenario.  I learned a lot about host profiles and the auto deploy technology in these last two posts but I’m interested to hear if anyone is running this in production.  If so, how does your configuration differ?

Tags: , ,

The auto deploy function of Sphere allows you to load a new ESXi host from scratch over the network.  There are a couple of main pieces that need to be installed to make this work so let’s get those out of the way first.

The VMware Auto Deploy Server
Installing the Auto Deploy server is another installation option of the main vCenter install media.  Load up the auto run menu from the disk and you should see ‘VMware Auto Deploy’  Click that link and select Install to start…

image

Select your language, click OK, and let the installer load…

image

Next, Next, Accept license agreement, and on the ‘Destination Folder’ window you can leave the defaults as shown.

image
Then click Next to get the vCenter server information page.  Enter your vCenter server information and click Next. 

image 

Leave the Auto Deploy port as the default (6501) on the next page and click Next.  On the next page, select the IP from the vCenter server that you want Auto Deploy to use.  In my case the server only had one IP so I used that.image 
Click Next and on the last page and then click Install on the following page.  Then just kick back and let the installer wrap up.

image
When it’s all done.  Click Finish and close the installers.  Now, pop back into vCenter through the VI client and go to the home page.  You should now see the Auto Deploy option under ‘Administration’.

image 
A TFTP Server
I just downloaded and used the Solar Winds free TFTP server.  I’m not going to walk through how to install and configure the application since it’s pretty straight forward. 

A DHCP Server
My lab is connected to a Cisco workgroup switch.  I’ll be using the DHCP functionality of that switch to provide the required DHCP server.  Here’s what the DHCP scope looked like on my MLS…

ip dhcp pool servers
   network 192.168.127.0 255.255.255.0
   bootfile undionly.kpxe.vmw-hardwired
   next-server 192.168.127.10
   default-router 192.168.127.1
   domain-name servers.lab

Note that the ‘next-server’ command is option 66 and that the ‘bootfile’ command is option 67.  Big thanks to Sean Crookston fop pointing this out to me on his blog.

VMware PowerCLI
Much like it sounds, this is a CLI interface for vSphere and it is required in order to configure some of the Auto Deploy features.  I’m not going to walk through the step by step of this install since it’s very well documented at this site. 

http://blogs.vmware.com/vipowershell/2011/06/back-to-basics-part-1-installing-powercli.html

You’ll need to make sure you have the Windows pre-reqs (Windows powershell and .net framework version) before you can install the VMware powershell. 

The PXE boot
Now that we have the 4 necessary parts installed, we can look at the actual configuration required to get this to work. 

First thing is to install the PXE boot files on the TFTP server and make sure that a server can successfully PXE boot.  To do this, go back in vCenter, go to the home page, and click on Auto Deploy.  Click the hyperlink called ‘Download TFTP Boot Zip’ and save the file on your auto deploy server.

image 
Extract the contents of the ZIP file into the root of the TFTP directory.  Now, give one of your test servers a boot to see if PXE is working.  Make sure your BIOS is configured to perform a PXE boot.  If all goes well, you should see something like this series of screens…

image

image
So if you got this far, then PXE boot is working.  We just need to wrap up some of the final configurations for the image we want to load.

The Configuration
So all of the documentation I’ve read so far lists the next step as ‘downloading the offline depot’ and using it’s files for the depot configuration.  Here’s the crappy part, you can’t download the offline depot with an eval license (VMware just lost some points in my book on this one…).  Luckily Nick Marshall had a fix for me on this piece.  Basically, you can configure an online (or network) based depot.  So the steps going forward here will use the online depot that Nick pointed out.

So the rest of the configuration is done via the VMware power CLI.  So let’s jump right in. 

In the VMware power CLI enter the following commands…

Connect to vCenter
connect-viserver 192.168.127.10

Add the ESX Software Depot (Following command should be all one line)
Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

Create a new deployment rule (Following command should be all one line)
New-DeployRule –Name “NormalBoot” –Item “ESXi-5.0.0-469512-standard” –Pattern “model=VMware Virtual Platform”

Add a new deployment rule
Add-DeployRule -DeployRule NormalBoot

At this point give your test server a boot and see what happens.  With any luck you’ll see this…

image

And eventually this…
 image

A couple of things to note.  I’m having issues getting the physical server I running to PXE boot so this initial test was run using a virtualized ESXi instance.  That’s why the deployment rule specifies ‘VMware Virtual Platform’ as the model.  Also, it took an incredibly long time for ESXi to load during my testing.  I’m not sure why at this point but I’ll have to dig into it a little bit more to determine that. 

Also, while this is ‘cool and all’, it doesn’t seem super useful at this point.  That’s because we just scratched the surface.  In the follow up post we’ll talk about making the deployment’s more purposeful as well as using host profiles.

Tags: , ,