Monday, 6 November 2017

Install ESXi using Auto deploy

ESXi install using Auto deploy

With vSphere 6.5, we can manage Auto deploy using web client along with PowerCLI. Let’s see step by step Auto Deploy configuration with vSphere 6.5.

Auto Deploy Prerequisite

Below is the prerequisite to use auto deploy for ESXi installation. With new version of Auto Deploy you can configure auto deploy with stateless or Stateful mode.
  • vCenter Server
  • Auto Deploy Service
  • Image Builder Service
  • DHCP server
  • DNS server
  • TFTP server
  • ESXi Image
  • Syslog server
  • ESXi coredump service
  • Host Profiles
  • Verify that your server hardware meets requirements for ESXi.
  • Make sure server reach to DHCP server to get IP from DHCP server.
  • Make sure you have enough storage for auto deploy images repository.
Make sure we have DNS, DHCP, vCenter server Appliance deployed and ready to use.
For TFTP server, you can use Solarwind Free TFTP service or use ubuntu tftp server.
Make sure you run vCenter, AD, DNS, DHCP and TFTP servers on ESXi servers with persistent storage, to avoid issues during outages.   

Start Auto Deploy Service

  1. Log in to your vCenter Server system by using the vSphere Web Client.

  2. On the vSphere Web Client Home page, click Administration.
  3. Under System Configuration click Services.
  4. Select Auto Deploy, click the Actions menu, and select Edit Startup Type.
    • On the vCenter Server Appliance, the vSphere Auto Deploy service by default is set to Manual. If you want the vSphere Auto Deploy service to start automatically upon OS startup, select Automatic.
    • On Windows, the vSphere Auto Deploy service is disabled. In the Edit Startup Type window, select Manual or Automatic to enable vSphere Auto Deploy.

Start Image Builder Service

  1. While still in web client, Services page.
  2. Select ImageBuilder Service, click the Actions menu, and select Edit Startup Type.
    • On Windows, the vSphere ESXi Image Builder service is disabled. In the Edit Startup Type window, select Manual or Automatic to enable the service.
    • On the vCenter Server Appliance, the vSphere Auto Deploy service by default is set to Manual. If you want the vSphere ESXi Image Builder service to start automatically upon OS startup, select Automatic.

Auto Deploy Icon in web client

  1. Once you start Auto Deploy and Image builder service, Log out of the vSphere Web Client and log in again.
  2. The Auto Deploy icon is visible on the Home page of the vSphere Web Client.


If you want to manage Auto Deploy using PowerCLI, install latest PowerCLI on your local machine or management windows server.

Configure the TFTP server on ubuntu

Configure TFTP server

  1. Install latest ubuntu in VM.
  2. Configure IP address, hostname and do other basic settings.
  3. Login to Ubuntu server.
  4. Install following packages
$ sudo apt-get update
$ sudo apt-get install xinetd tftpd tftp
  1. Create /etc/xinetd.d/tftp and below lines.
service tftp
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
  1. Create a folder /tftpboot this should match whatever you gave in server_args.
$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot
  1. Restart the xinetd service
$ sudo /etc/init.d/xinetd stop
$ sudo /etc/init.d/xinetd start

Download Auto Deploy TFTP Files

  1. In a vSphere Web Client connected to the vCenter Server system, go to the inventory list and select the vCenter Server system.
  2. Click the Manage tab, select Settings, and click Auto Deploy.
  3. Click Download TFTP Boot Zip to download the TFTP configuration file and unzip the files.
  4. Using Winscp copy these files to the directory in which your TFTP server stores files. In our case /tftpboot on ubuntu server.

DHCP Options for Auto Deploy

  • Login to DHCP server and select IP scope configured to use for ESXi Management IP network.
  • Create DHCP reservation for ESXi Host’s mac address to reserve IP for each ESXi Host. Use primary NIC’s mac address.
  • Specify the TFTP Server's IP address in DHCP option 66, frequently called next-server.
  • Specify the boot file name in option 67 as below
    • For servers with UEFI - snponly64.efi.vmw-hardwired
    • For servers with BIOS - undionly.kpxe.vmw-hardwired

DNS record for ESXi Host.

Create a DNS record for each ESXi Host and it’s reserved IP in DHCP.

Servers Boot Order

Configure Servers boot order to boot from Network Card, PXE boot. Use UCS service profile to configure boot order.

Configure Auto Deploy using Web Client

  • Login to vCenter web client.
  • From Home Navigation menu, Click Auto Deploy.

Import ESXi Image

  • Click on software depot tab, in Auto Deploy GUI.
  • Click on Import Green up icon to upload ESXi Image to software depot.
  • Enter name of ESXi Image, browse path of Image zip file and select it.
  • Click upload button to upload file to software depot.

  • Once upload completes, then you can see imported images in software depot.

Create Auto Deploy Rules

  • In Auto deploy GUI, click on Deploy Rules Tab.
  • Click on Deploy Rule.
  • In New Deploy Rule window,
    • Enter Rule name
    • Select the pattern for ESXi Hosts, enter value and click Next.
      • To place ESXi Hosts in two different clusters based on IP range, I have entered IP range.

  • Based on requirements, you can select different pattern to match ESXi Hosts.

Auto Deploy pattern options

  • Asset
    • Domain
    • Gateway IPv4
    • Hostname
    • IPv4
    • IPv6
    • MAC Address
    • Model
    • OEM String
    • Serial number
    • UUID
    • Vendor

  • Select ESXi Image profile and click Next

  • Select Host profile, if this is new auto deploy setup, select checkbox do not include a host profile and click Next.
  • Select Location for auto deployed ESXi Hosts and click Next.
  • Review settings and click Finish to complete new rule creation process.

Activate Rules

  • Click on Activate/Deactivate Rule button from Deploy Rule tab in auto deploy.
  • From new window, select Auto Deploy rules, Click Next and then Click Finish.
Based on IP range, I have created two Auto Deploy rules, so that I can place those hosts in two different clusters. We cannot use other pattern as these all are Cisco UCS, B200 M3 servers which would be placed in two clusters.

Boot ESXi Hosts using Auto Deploy

  • Power on ESXi server and watch boot process.
  • ESXi host will connect DHCP server to IP Address, TFTP server IP and then it will download boot image from vCenter server.
  • Once ESXi completes boot process, then ESXi host will get automatically in vCenter server. Host will be placed in Location selected in Deploy rule.
If ESXi server do not boot ESXi image, then make sure Host is able to connect to DHCP server to get Host IP, TFTP IP details and host should be able to connect with vCenter Auto Deploy service.

Configure basic ESXi settings before we create host profile.
  • Configure ESXi Host to use NTP server.
  • Configure remote syslog server.
  • Configure ESXi network coredump
  • Enable SSH if needed.
  • Disable Shell Warning.
  • Add Host to dvswitch.
  • Configure required Vmkernel Adapters for vMotion, FT.
Once you are done with all required settings configuration, create host profile from this host.

Create ESXi Host profile

  • Login to web client
  • From Home navigation menu, select Policies and profile
  • Select Host Profile.
  • Click on + Sign to Extract Host profile from existing ESXi Host.
  • Select the ESXi host deployed using ESXi host and click Next.
  • Enter name for Host profile and click Next.
  • Click Finish.

Edit Host profile

  • From Host profile, objects tab, select the host profile.
  • From Action menu, click Edit
  • Click Next
  • Edit Host profile
    • For our configuration, I have removed all unwanted settings and kept only required settings in host profile.
    • Advanced Configuration settings
      • Deselect all the checkbox
      • Expand, Advanced options Advanced configuration Options
      • Deselect all options except and UserVars.SuppressShellWarning
    • General System Settings
      • Deselect all the checkbox for all config options except Date and Time Configuration.
    • Networking Configuration – keep all the options. Remove any config which is not required.
    • Security and Services
      • Firewall Configuration – deselect all the options and select only SSH server
      • Security Settings
        • Deselect all the options.
        • Select Security Config User configuration root
        • Enter password for root user.
      • Service Configuration
        • Deselect all config options and only select TSM-SSH and vmsyslogd
    • Storage Configuration – Deselect all the option unless we are configuring specific storage settings.

Apply Host Profile to ESXi Host

  • From web client, Host and Clusters view.
  • Select newly deployed Host.
  • From Action Menu, Click Host profiles Attach Profile.
  • Select Host profile next Finish.

Remediate Host Profile

Select Host, from Host Summary Page, Host profile compliance → Click Remediate Host
Provide required user input and click Finish.
e.g. In My host profile, I have select to assign static IP to vMotion vmkernel adapter. So far each Host remediation, we will have to enter static IP for vMotion vmkernel adapter.

Modify Auto Deploy Rule

As now we have host profile ready to use, go back to Auto Deploy GUI, deactivate Deploy Rule.
Edit deploy rule and add Host profile and then finish.
Activate Deploy rule.

Boot ESXi Host using Auto Deploy

Now you can boot ESXi host using auto deploy.
Once Host completes boot process, you would notice new host being added in vCenter server.
Remediate Host profile and then you are done, host is ready to use.

Auto Deploy Rules

Auto Deployed Hosts
Host Profile Compliance

No comments:

Post a Comment