ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

VMware vSphere AutoDeploy – Run some PowerCLI and you’re the Boss

By Vladan SEGET | Last Updated: November 1, 2014

Shares

Nice title he? But before you want to call yourself a Boss, you need to (still) learn the ins and outs of Autodeploy. Motivated? GO! In previous post we have already done the first part – the Autodeploy configuration.

Autodeploy uses rules. Those rules does the configuration when the ESXi image boots up. Those rules apply only at the first boot and if you change them, you must use Test and Repair operation within the PowerCLI.

To get started, just fire up a PowerCLI and connect to your vCenter > use this command to get all deploy commands:

Get-Deploycommand

View Available AutoDeploy Commands

You can set rules that will match patterns based on elements like model, MAC address etc…

During today's lesson we will principally use those two cmdlets:

New-DeployRule

Add-DeployRule

Let's create an Image Profile rule.

You must first quickly create an Image Profile rule, the one we've done in our first post where we were using Image Builder. We ended up with profile that we exported to ISO and to bundle. The bundle profile has a zip extension.

Quick recap of those steps:

Add-ESXSoftwareDepot

New-ESXImageProfile -CloneProfile ESXi-5.0.0-469512-standard -Name vcaptest

Export-EsxImageProfile -ImageProfile vcaptest -ExportToBundle c:vcaptest.zip

To quickly check the images that we currently have when we run this PowerCLI session (Note: when you exit the powerCLI session, the profile does not show, so you can't use it to create rules!!!)

Get-ESXImageProfile

The rule we are going to create will use the cmdlet New-DeployRule for hosts that will boot at our lab's 10.10.3.x subnet.

New-DeployRule -Name "firstboot" -Item "vcaptest" -Pattern "ipv4=10.10.3.50-10.10.3.100"

AutoDeploy Rules creation - VMware vSphere

Then we need to use command Add-DeployRule

Add-Deployrule firstboot

Add-DeployRule command for vSphere AutoDeploy

Great! We just created our first rule….-:)

What's next? Now this is optional, but cool. We can create a cluster rule, which will put the host into our lab cluster! We will use command Get-Cluster

vSphere AutoDeploy - Get-Cluster rule

New-DeployRule -Name "assigncluster" -Item "autodeploy" -Pattern "ipv4=10.10.3.50-10.10.3.100"

AutoDeploy Rule - vSphere Autodeploy

Excellent. Now, let's talk about host profiles. Host profiles are used to to have the exact same configuration on our hosts across cluster, which usually have same or similar hardware.

Host which boots with Autodeploy will by default puts itself into maintenance mode. This is to allow the administrator to finish the configuration – to place the host into cluster he wants and exit the maintenance mode. But we can (optionally)  use Autodeploy to automate that. We can use Autodeploy to configure our host with predefined profile.

If we have already created a host profile which will be used once our host boots up, we need this profile to be assigned to a host. We will be again using the same two commands as above!

New-Deployrule -Name "hostprofilerule" -Item "vesxi5-01" -Pattern "ipv4=10.10.3.50-10.10.3.100"

Well done! We can see the 3 rules in our Active rule set…

vSphere Host Profiles - assign host profile

So now when we have those 3 rules in place, we can possibly boot a host which will be assigned an IP address from our DHCP server (we will use reservation to assign an IP address to our ESXi host). We will also need to create DNS records for forward and reverse.

autodeploy-cluster

So as you can see, the host booted up and joined my “autodeploy” cluster… Nice.

But as my host came up in maintenance mode, I had to update my answer file, because the profile I created from my reference host did not match exactly the new host.

Another thing I had to deal with was a DNS. When I created my DHCP reservation and configured static DNS forward and reverse records, I didn't empty the DNS cache so when the host booted up it showed up with the IP address instead of FQDN. So I then emptied the DNS cache on the DNS server and restarted the DNS service for the modifications to take effect…. and the result, after a reboot of the host, you can see the image below on the right…

VMware vSphere AutoDeploy Ins And outs

At final I had a host in my cluster with a nice DNS name ready… Quick check at the host profile to verify if our host was compliant…

VMware vSphere Profile Compliance

Host profiles, Autodeploy and Image builder are very powerful. Those features will certainly be maintained in future releases because they allows automating many things from within the infrastructure. Hopefully we might see a GUI which is probably more convenient than remembering PowerCLI commands, but there aren't so much that you need to remember, and you can always ask via get-help ….

The whole serie so far:

  • VCAP Diary – VMware vSphere ESXi Image Builder
  • VMware vSphere AutoDeploy – Run some PowerCLI and you’re the Boss (this post)
  • VMware vSphere AutoDeploy – Install and configure
  • VCAP Diary – VMware vSphere Host Profiles
  • VMware vSphere Host Profiles – options and troubleshooting

The article was published first at ESX Virtualization website. Feel free to subscribe via RSS or by e-mail to get the latest news to be delivered via weekly newsletter. The latest 200 articles of daily updates can be found on our daily archives page.

Shares
4.5/5 - (2 votes)

| Filed Under: Server Virtualization Tagged With: VMware vSphere AutoDeploy

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Comments

  1. Tom EWERLING says

    February 12, 2014 at 7:24 am

    Thanks Vladan for this post explaining incredibly easy how Autodeploy works.
    This was way better than the description in the Optimize & Scale course!
    Now I think I’m ready for my VCAP 😉

  2. Jonathan says

    June 26, 2015 at 5:45 am

    Excellent article! This will be very useful to me. One question tho, how do you tell AutoDeploy to install the OS permanently on a specific drive? For some reasons ESXi is running from memory instead of running from disk…

    Thanks!

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • Veeam Backup & Replication v13 Beta: A Game-Changer with Linux
  • What is Veeam Data Cloud Vault and how it can help SMBs
  • Nakivo Backup and Replication – Malware Scan Feature
  • Zerto 10 U7 released with VMware NSX 4.2 Support
  • XorMon NG 1.9.0 Infrastructure Monitoring – now also with Veeam Backup Support
  • Heartbeat vs Node Majority StarWind VSAN Failover Strategy
  • Vulnerability in your VMs – VMware Tools Update
  • FREE version of StarWind VSAN vs Trial of Full version
  • Commvault’s Innovations at RSA Conference 2025 San Francisco
  • VMware ESXi FREE is FREE again!

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Sponsors

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Log in