Pages

Sunday, January 5, 2014

Configuring Auto Deploy: Changing a host profile and checking compliance

I desperately needed a second host in my lab network, the primary host isn't overloaded in terms of resources, but in working on it I would sometimes have to restart it, which meant shutting down all of my VMs, some of which provided services for my home network (like the firewall to the outside world).  I dug up an old Dell Precision workstation that I haven't used in a while and decided to put it in to service.  I also figured it was time for me to gain some experience with Auto Deploy.
I used a combination of two great blog entries on setting up Auto Deploy as a starting guide.
     vSphere 5 Auto-deploy in 20 steps over at vClouds.nl
     Using vSphere 5 auto-deploy in your home lab from Duncan Epping over at Yellow-bricks.

Those entries got me through most of the setup, but after getting the host to boot up, I decided I wanted to make some changes to the image and the rules.  After adding changes to the ruleset, I had to test compliance to get the rules to update.  I was curious how I could verify the changes, so in my research, I came across a KB for troubleshooting Auto Deploy that pointed me to this page you can access on your autodeploy server

     http://autodeployserver:port/vmw/rdb/

From here I can look at registered hosts as well as the Auto Deploy cache information.  By selecting my host, prior to testing compliance of the rule set, I saw this information:
Notice that the PxeProfile that is cached does not match the new rule listed below it.  To test and repair the rule set, I ran the following commands:

     PowerCLI C:\> $tr = test-deployrulesetcompliance esxi50.starship.local
     PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $tr.itemlist
     CurrentItem                                                 ExpectedItem
     -----------                                                 ------------
     ESXi-5.1.0-799733-standard                                  ESXiHA

     PowerCLI C:\> Repair-DeployRuleSetCompliance $tr

At this point, if I go back to the host on the autodeploy page, I now see:
Notice that at this point the PxeProfile matches on the top and the bottom.  At this point when I reboot the host it will load the new image.

Seeing what exactly is in the PxeProfile is a little bit more tricky.  If you look in the cache, you can locate PxeProfile-2, and from there, determine the locate of the imgprofile.xml file location.  If you log in to the Auto Deploy server, in my case the VCVA, and go to /var/lib/rdb/cache and locate the file to view it's contents.