---
title: "VMware vSphere Auto Deploy configuration guide – Part 2"
date: "2014-03-03T08:26:33Z"
tags: ["Auto Deploy", "ESXi", "Host Profile", "PowerCLI", "Stateful", "Stateless", "vCenter Server"]
categories: ["VMware"]
---

![VMware vSphere Auto Deploy configuration guide Part2][1]

In the second part of Auto Deploy configuration guide, we will continue with setup and we will boot ESXi.
<!--more-->
<!--adsense-->
## 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 <a title="PowerCLI 5.5 Download link" href="https://my.vmware.com/web/vmware/details?downloadGroup=PCLI550&productId=352" rel="noopener">PowerCLI 5.5 Download link</a>.

Connect to a vCenter server and start PowerCLI.

```PowerShell
Connect-VIServer -Server VCENTER-FQDN -User DOMAIN\Username -Password Password
```

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 - <a title="ESXi 5.5 Offline Bundle" href="https://my.vmware.com/web/vmware/details?productId=352&downloadGroup=ESXI550" rel="noopener">ESXi 5.5 Offline Bundle</a>.

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

```PowerShell
Add-EsxSoftwareDepot E:\SoftwareDepot\VMware-ESXi-5.5.0-1331820-depot.zip
```

![VMware vSphere Auto Deploy Software Depot Powercli - 1][2]

Now after creating Software Depot we can create first deployment rule

```PowerShell
New-DeployRule -Name "ESXiFTW!" -Item "ESXi-5.5.0-1331820-standard" -AllHosts
```
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.

```PowerShell
Add-DeployRule -DeployRule "ESXiFTW!"
```

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

![VMware vSphere Auto Deploy Software Depot Powercli - 2][3]

![VMware vSphere Auto Deploy Software Depot Powercli - 3][4]

## vSphere Auto Deploy Host Profile

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

![Mware vSphere Auto Deploy - Booted][5]

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**.<br>
![VMware vSphere Auto Deploy - Host Profiles - 1][6]
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.<br>
![VMware vSphere Auto Deploy - Host Profiles - 2][7]

## 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

```PowerShell
Remove-DeployRule -DeployRule ESXiFTW! -delete
```

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

```PowerShell
Get-DeploRule
```

1. We add Software Depot - just VMware Offline Bundle. 
```PowerShell
Add-EsxSoftwareDepot E:\SoftwareDepot\VMware-ESXi-5.5.0-1331820-depot.zip
```
2. We add HA Software Depot from vCenter. 
```PowerShell
Add-EsxSoftwareDepot http://"vCenter IP"/vSphere-HA-depot
```
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.** 
```PowerShell
New-EsxImageProfile -CloneProfile "ESXi-5.5.0-1331820-standard" -name "ESXi_5.5"
```
4. We add HA features into an ESXi_5.5 profile. 
```PowerShell
Add-EsxSoftwarePackage -ImageProfile "ESXi_5.5" -SoftwarePackage vmware-fdm
```
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. 
```PowerShell
Export-EsxImageProfile -ImageProfile "ESXi_5.5" -ExportToBundle -FilePath E:\SoftwareDepot\ESXi_5.5_HA.zip
```
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. 
```PowerShell
New-DeployRule -name "ESXi5.5-Normal" -item "ESXi_5.5", AutoDeploy, Cluster2 -Pattern "ipv4=10.0.0.150-10.0.0.160"
```
7. Now we need to activate rule by typing. 
```PowerShell
Add-DeployRule -DeployRule "ESXi5.5-Normal"
```
8. As you see on screenshot during boot Host Profile settings are applied.<br>
![VMware vSphere Auto Deploy - PowerCLI advanced 1][8]
9. All three ESXi hosts are booted using Auto Deploy.<br>
![VMware vSphere Auto Deploy - PowerCLI advanced 2][9]
10. In order to complete our setup, we need to update **Answer File**.<br>
![VMware vSphere Auto Deploy - PowerCLI advanced 3][10]
11. Click on the host and select **Update Answer File**.<br>
![VMware vSphere Auto Deploy - PowerCLI advanced 4][11]
12. Fill all missing information<br>
![VMware vSphere Auto Deploy - Host Profiles - 6][12]
  
    and apply Host Profile.
![VMware vSphere Auto Deploy - Host Profiles - 7][13]
13. As you see on screenshot Cluster2 is compliant with host profile.<br>
![VMware vSphere Auto Deploy - Host Profiles - 8][14]

## 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][15]

## 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][16]

Here we see what changes will be applied to ESXi.

![VMware vSphere Auto Deploy - Stateful 2][17]

And we have summary after Host Profile was applied.

![VMware vSphere Auto Deploy - Stateful 3][18]

We are compliant 🙂

![VMware vSphere Auto Deploy - Stateful 4][19]

## 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][20]

After applying host profile and reboot, our host is compliant.

![VMware vSphere Auto Deploy - Stateless 2][21]

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][22]

[1]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-configuration-guide-part2.webp
[2]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-software-depot-powercli-1.webp
[3]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-software-depot-powercli-2.webp
[4]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-software-depot-powercli-3.webp
[5]: /images/uploads/2014/03/vmware-vsphere-auto-deploy-booted.webp
[6]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-host-profiles-1.webp
[7]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-host-profiles-2.webp
[8]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-powercli-advanced-1.webp
[9]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-powercli-advanced-2.webp
[10]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-host-profiles-3.webp
[11]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-host-profiles-4.webp
[12]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-host-profiles-6.webp
[13]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-host-profiles-7.webp
[14]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-host-profiles-8.webp
[15]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateless-vs-statefull.webp
[16]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateful-1.webp
[17]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateful-2.webp
[18]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateful-3.webp
[19]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateful-4.webp
[20]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateless-1.webp
[21]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateless-2.webp
[22]: /images/uploads/2014/02/vmware-vsphere-auto-deploy-stateless-3.webp
