VMware vSphere Auto Deploy configuration guide – Part 2

VMware-vSphere-Auto-Deploy-configuration-guide-Part2

In the second part of Auto Deploy configuration guide, we will continue with setup and we will boot ESXi.

vSphere Auto Deploy Software Depot – PowerCLI basic deployment

In order to provision ESXi hosts with Auto Deploy, we need to create Software Depot. In order to do it, you need to install PowerCLI. I am using latest version 5.5 which you can download from VMware website PowerCLI 5.5 Download link.

Connect to a vCenter server and start PowerCLI.

After successful connection, we have to add ESXi Offline Bundle ZIP file into the repository. But hey, first we need to download it. As always you can find it on VMware website, but I will provide direct URL to file – ESXi 5.5 Offline Bundle.

I placed it in following directory E:\SoftwareDepot\ and we add the repository using the following command in PowerCLI.

VMware vSphere Auto Deploy Software Depot Powercli - 1

Now after creating Software Depot we can create first deployment rule

And as you see Image is imported into Auto Deploy.

 

After successful import, we just need to activate rule set by typing following command in PowerCLI.

As you see on screenshot ESXi is booting using Auto Deploy.

VMware vSphere Auto Deploy Software Depot Powercli - 2

VMware vSphere Auto Deploy Software Depot Powercli - 3

vSphere Auto Deploy Host Profile

After successful boot from the network, we have three new ESXi hosts connected to vCenter.

VMware vSphere Auto Deploy - Booted

We see that deployment works fine but to make this easier and less time-consuming we will use Host Profile. Host Profile is captured configuration of ESXi hosts (we can call it a template or golden image) which can be applied to other ESXi hosts to have consistent and standardized configuration in the environment.

  1. Select ESXi hosts which are already configured so when you will apply host profile to Auto Deployed servers they will be already configured. In order to do it navigate to Host and Clusters and select host. Click Host Profile and Create Profile from Host.
    VMware vSphere Auto Deploy - Host Profiles - 1
  2. Provide a name for host profile and/or description and click Finish.
  3. Go to Host Profiles and you will see that profile was created.
    VMware vSphere Auto Deploy - Host Profiles - 2

vSphere Auto Deploy Software Depot – PowerCLI advanced deployment

In order to do more advanced and more automated deployment, we have to make adjustments in Software Depot. In just a few minutes we will create rules which will allow us to boot ESXi using Auto Deploy with enabled HA agent. The host will be added to the cluster and Host Profile will be applied.

Let us first drop previously created rule to avoid any confusion by typing

In order to check if any rules are still present use following command

  1. We add Software Depot – just VMware Offline Bundle.
  2. We add HA Software Depot from vCenter.
  3. We clone existing depot to add HA features. If you will be asked for vendor type it. In my case, it is VMware, Inc.
  4. We add HA features into an ESXi_5.5 profile.
  5. It is good to export newly created profile into Offline Bundle to store it locally after all changes we did. In order to do that use following command.
  6. We will create deployment rule. Where: -name is Rule name -item is Image Profile name, AutoDeploy is Host Profile name and Cluster2 is cluster name in vCenter. -Pattern might be vendor ID or IP range.
  7. Now we need to activate rule by typing.
  8. As you see on screenshot during boot Host Profile settings are applied.
    VMware vSphere Auto Deploy - PowerCLI advanced 1
  9. All three ESXi hosts are booted using Auto Deploy.
    VMware vSphere Auto Deploy - PowerCLI advanced 2
  10. In order to complete our setup, we need to update Answer File.
    VMware vSphere Auto Deploy - Host Profiles - 3
  11. Click on the host and select Update Answer File.
    VMware vSphere Auto Deploy - Host Profiles - 4
  12. Fill all missing information
    VMware vSphere Auto Deploy - Host Profiles - 6
    and apply Host Profile.
    VMware vSphere Auto Deploy - Host Profiles - 7
  13. As you see on screenshot Cluster2 is compliant with host profile.
    VMware vSphere Auto Deploy - Host Profiles - 8

Stateful caching vs Stateless caching

Before we will finish the post with Cherry on Top let me explain what is stateful and stateless caching.

Stateful means that ESXi is deployed using Auto Deploy and image is saved to hosts internal storage. It can be a traditional hard drive or USB disk. First boot is initiated using network boot and image is deployed locally. Boot order on a host is set to boot from a network during first boot and later on, disk should be set to first. After other reboots disk is used to boot ESXi.

Stateless means that ESXi is deployed using Auto Deploy and image is cached to local USB. The host is using network boot, boot order is set to network first.

VMware vSphere Auto Deploy - Stateless vs Statefull

vSphere Auto Deploy – Stateful ESXi

In order to deploy Stateful ESXi, we need to select in section SystemImageCacheProfileSettings several settings. First, we select Enable stateful installs on the host, second thing is to give arguments for the first disk. In our case local is correct setting – you can provide your own parameters. We want as well to overwrite VMFS on existing disk.
VMware vSphere Auto Deploy - Stateful 1

Here we see what changes will be applied to ESXi.
VMware vSphere Auto Deploy - Stateful 2

And we have summary after Host Profile was applied.
VMware vSphere Auto Deploy - Stateful 3

And we are compliant 🙂
VMware vSphere Auto Deploy - Stateful 4

vSphere Auto Deploy – Stateless ESXi

In order to deploy Stateless ESXi, we need to enable it in section SystemImageCacheProfileSettings. First, we select Enable stateless caching on the host, second thing is to give arguments for the first disk. In our case local is correct setting – you can provide your own parameters.
VMware vSphere Auto Deploy - Stateless 1

After applying host profile and reboot, our host is compliant.
VMware vSphere Auto Deploy - Stateless 2
How do we check if it is really cached and not boot from disk? Simply we can see in host settings that it has only two iSCSI disks and CD-ROM. I removed as well disk from ESXi4 on purpose.
VMware vSphere Auto Deploy - Stateless 3

 

VMware vSphere Auto Deploy configuration guide – Part 2
Rate this post
Wojciech Marusiak
Social Media

Wojciech Marusiak

Senior Consultant at VMware Global, Inc.
I am innovative and experienced VMware and Windows Server Engineer with over 10 years in the IT industry specializing in VMware virtualization and Microsoft Server environment.

My experience and skills has been proven by leading vendor certifications like VMware Certified Implementation Expert 6 – Data Center Virtualization, VMware Certified Advanced Professional 6 – Data Center Virtualization Design, VMware Certified Professional 6 - Data Center Virtualization, VMware Certified Professional 6 - Network Virtualization, Microsoft MCITP Server Administrator, ITIL V3, VMware vExpert 2014 - 2017 and VMware vExpert NSX 2017 Award.

My blog wojcieh.net - was voted #43 in Top vBlog 2017 contest!
Wojciech Marusiak
Social Media

Latest posts by Wojciech Marusiak (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Dzięki za tutorial 🙂
    wkradł się błąd:
    New-DeployRule -Name “ESXiFTW!” -Item “VMware ESXi-5.5.0-1331820-standard” -AllHosts

    powinno być:

    New-DeployRule -Name “ESXiFTW!” -Item “ESXi-5.5.0-1331820-standard” -AllHosts

    (na screenie jest dobrze ;o))

    • Dzięki Karol za zwrócenie uwagi. Tak to jest jak się pisze posta przez kilka dni wieczorami – może coś uciec uwadze. Najważniejsze, że działa 😀

  2. Pingback: Upgrade ESXi 5.1 to 5.5 Part 4 - vSphere Auto Deploy | w o j c i e h . n e t

  3. I am facing issue . trying stayful method and trying to i have image in local disk and i have mentioned local in arguments for first disk but when i boot via HDD its failing , FYI i added the local disk as a datastore , Pls explain in detail whether i missing anything here..

    Thanks..

    • It got resolved, i found the local kernel driver name for my disk ( HP smart array ) is hpsa..Once i updated hpsa instead of local it worked….i used below command to find the driver name…esxcfg-scsidevs -a or esxcli storage core adapter list….

  4. Hi All,

    When I was trying to create a new deploy rule getting the below error.please help…
    ——————————————————–
    Welcome to the VMware vSphere PowerCLI!

    Log in to a vCenter Server or ESX host: Connect-VIServer
    To find out what commands are available, type: Get-VICommand
    To show searchable help for all PowerCLI commands: Get-PowerCLIHelp
    Once you’ve connected, display all virtual machines: Get-VM
    If you need more help, visit the PowerCLI community: Get-PowerCLICommunity

    Copyright (C) 1998-2014 VMware, Inc. All rights reserved.

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Connect-
    VIServer -Server VC5-1.homelab.com -User [email protected] -Password I
    [email protected]
    WARNING: There were one or more problems with the server certificate for the
    server vc5-1.homelab.com:443:

    * The X509 chain could not be built up to the root certificate.

    Certificate: [Subject]
    [email protected], CN=VMware default certificate,
    OU=vCenterServer_2014.11.27_015959, O=”VMware, Inc.”

    [Issuer]
    [email protected], CN=VC5-1.homelab.com,
    OU=vCenterServer_2014.11.27_015959, O=”VMware, Inc.”

    [Serial Number]
    100002

    [Not Before]
    11/26/2014 2:09:14 AM

    [Not After]
    11/24/2024 2:09:15 AM

    [Thumbprint]
    0DA0F00DF7A25779A2C01178BE2891AAB101891A

    The server certificate is not valid.

    WARNING: THE DEFAULT BEHAVIOR UPON INVALID SERVER CERTIFICATE WILL CHANGE IN A
    FUTURE RELEASE. To ensure scripts are not affected by the change, use
    Set-PowerCLIConfiguration to set a value for the InvalidCertificateAction
    option.

    Name Port User
    —- —- —-
    VC5-1.homelab.com 443 VSPHERE.LOCAL\Administrator

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> set-powe
    rcliconfiguration
    Set-PowerCLIConfiguration : You must specify at least one parameter.
    At line:1 char:26
    + set-powercliconfiguration <<< Add-esxs
    oftwaredepot c:\depot\VMware-Esxi-5.1.0-799733-depot.zip

    Depot Url
    ———
    zip:C:\depot\VMware-Esxi-5.1.0-799733-depot.zip?index.xml

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> get-esxi
    mageprofile

    Name Vendor Last Modified Acceptance Level
    —- —— ————- —————-
    ESXi-5.1.0-799733-no-tools VMware, Inc. 8/2/2012 3:0… PartnerSupported
    ESXi-5.1.0-799733-standard VMware, Inc. 8/2/2012 3:0… PartnerSupported

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> New-Depl
    oyRule -Name “initialboot” -Item “VMware-Esxi-5.1.0-799733-standard” -AllHosts
    New-DeployRule : 12/1/2014 11:22:07 PM New-DeployRule Could not find
    VIObjectCore with name ‘VMware-Esxi-5.1.0-799733-standard’.
    At line:1 char:15
    + New-DeployRule <<<

  5. Name Port User
    —- —- —-
    VC5-1.homelab.com 443 VSPHERE.LOCAL\Administrator

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> set-powe
    rcliconfiguration
    Set-PowerCLIConfiguration : You must specify at least one parameter.
    At line:1 char:26
    + set-powercliconfiguration <<< Add-esxs
    oftwaredepot c:\depot\VMware-Esxi-5.1.0-799733-depot.zip

    Depot Url
    ———
    zip:C:\depot\VMware-Esxi-5.1.0-799733-depot.zip?index.xml

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> get-esxi
    mageprofile

    Name Vendor Last Modified Acceptance Level
    —- —— ————- —————-
    ESXi-5.1.0-799733-no-tools VMware, Inc. 8/2/2012 3:0… PartnerSupported
    ESXi-5.1.0-799733-standard VMware, Inc. 8/2/2012 3:0… PartnerSupported

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> New-Depl
    oyRule -Name “initialboot” -Item “VMware-Esxi-5.1.0-799733-standard” -AllHosts
    New-DeployRule : 12/1/2014 11:22:07 PM New-DeployRule Could not find
    VIObjectCore with name ‘VMware-Esxi-5.1.0-799733-standard’.
    At line:1 char:15
    + New-DeployRule <<<

  6. Pingback: 2014 Year review | w o j c i e h . n e t

  7. Hi,

    I tried to download the ESXI Offline bundle from the link you provided,but seems download link greyed out.unable to download.please advice

  8. Thanks for the steps. This is very useful.

    I am trying to attach few vibs to the image profile which is not present by default. I am able to add software dept and later attached the vib using add-esxsoftware package to image profile. When i tried to new-deploy rule i am getting below error. Could you help me out??

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> New-Depl
    oyRule -Name “ESXi5.5-normal” -Item “ESXi5.5”, AutoDeploy, Suresh -Pattern “ipv4
    =192.168.8.10-192.168.8.30”
    Downloading net-qlcnic 5.5.190-1OEM.550.0.0.1331820
    Unable to delete temporary file C:\Users\Administrator\AppData\Local\Temp\2\tmp4
    ED4.tmp: System.IO.IOException: The process cannot access the file ‘C:\Users\Adm
    inistrator\AppData\Local\Temp\2\tmp4ED4.tmp’ because it is being used by another
    process.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.File.Delete(String path)
    at VMware.DeployAutomation.RbdHelper.ConvertToPxeProfile(RbdClient rbdClient,
    RemoteImageProfile profileWrapper)

    Above error says some temp file already opened and hence gives error. If i remove the added vib from image profile, Above step is successful.

    PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> New-Depl
    oyRule -Name “ESXi5.5-normal” -Item “ESXi5.5”, AutoDeploy, Suresh -Pattern “ipv4
    =192.168.8.10-192.168.8.30”

    Name : ESXi5.5-normal
    PatternList : {ipv4=192.168.8.10-192.168.8.30}
    ItemList : {ESXi5.5, Suresh, AutoDeploy}

    Any help??

    Thanks,
    Suresh

      • Thanks for your response.

        I am able to fix it by marking signature check as true .Mentioned below.

        PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $DeployNosignatureCheck=$true
        PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> New-DeployRule -name “ESXi5.5-Normal” -Item “ESXi5.5”, AutoDeploy, Suresh -Pattern “ipv4
        =192.168.8.10-192.168.8.30”
        Downloading net-qlcnic 5.5.190-1OEM.550.0.0.1331820
        Download finished, uploading to AutoDeploy…
        Upload finished.
        Downloading qlnativefc 1.1.52.0-1OEM.550.0.0.1331820
        Download finished, uploading to AutoDeploy…
        Upload finished.

        Name : ESXi5.5-Normal
        PatternList : {ipv4=192.168.8.10-192.168.8.30}
        ItemList : {ESXi5.5, Suresh, AutoDeploy}

        I got another question. Can I have multiple deploy rules get activated?? I got multiple host. I wanted each host to boot with different deploy rule.

        Is it possible???

        Thanks,
        Suresh

  9. Pingback: VMware vSphere Auto Deploy configuration guide - Part 1