Quick snapshot of the section objective 1.1 from the blueprint –

1.Configure and Manage Auto Deploy configurations

1a.Determine use case for Stateless vs Stateful installs
1b.Create / Modify rules and rule sets
1c.Create and associate Host Profiles for an Auto Deploy reference host

2.Configure Kernel Boot Parameters for scripted install according to a deployment plan

2a.Modify scripted weasel install (ks.cfg)
2b.Create / Modify scripted installation

3.Configure Advanced System Settings according to a deployment plan

3a.Edit System Swap / Scratch Configuration
3b.Configure ESXi host to use a central Syslog Server

4.Manage/Edit the Core Dump configuration of an ESXi host

Let us double click on each section –

1.Configure and Manage Auto Deploy configurations

1a.Determine use case for Stateless vs Stateful installs

Requirements

TFTP Server (Download here) – can be installed in any existing machine

DHCP Server

vSphere Web Client

Initiate Autodeploy in vCenter

Login to vSphere Web Client–> Administration –> System Configuration at the left pane bottom –> Services –> Choose AutoDeploy –> Actions – Start the service and change startup type to Automatic.

Also change settings (ports, Cache size, log level) if required.

Login to vSphere Web Client –> Choose vCenter –> Manage –> Settings –> AutoDeploy –> Download TFTP Boot Zip file

TFTP configuration

Install TFTP server –> Open File – Configure –> Specify a local folder E.g. C:\TFTP-Root & Start service.

Copy the TFTP Boot Zip file downloaded in previous step –> Extract contents in this folder C:\TFTP-Root. Will contain about 10 Files. Most important file is undionly.kpxe.vmw-hardwired

DHCP Configuration

Logon to DHCP server –> Open DHCP console –> Right click IPV4 and Create new scope AutoDeployESX –> Start & End IP address of ESXi hosts to be used –> Configure scope options and specify Default GW, DNS IP etc.,

Then configure important options-

option 66 Boot Server Host name: Above TFTP server IP

option 67-Bootfile name: undionly.kpxe.vmw-hardwired

We are now ready to configure Autodeploy rules using PowerCLI.

1b.Create / Modify rules and rule sets

Requirements

PowerCLI (Download here and install in any windows machine that can reach vCenter)

Intended ESXi version’s offline bundle in .zip format (Available in VMware downloads under ESXi section). Place it in C:\Temp of the above PowerCLI machine.

VM or Hardware receiving IPs from DHCP server, intended to be used as ESXi hosts.

 Create ImageProfile

Open PowerCli console and run following commands

Set-ExecutionPolicy RemoteSigned
Connect-Viserver server.domain (replace server.domain with your vCenter FQDN)
Add-ESXSoftwareDepot C:\Temp\update-from-esxi6.0-6.0_update02.zip

(can also add online software depots, E.g. Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml)

Get-EsxImageProfile -name “ESXi-6.0.*” | Select Name

(Four different image profiles show up. File name with -s contain only security patches, -standard has all patches. no-tools means no vmware tool vibs. Standard profile is used below)

(create new) New-ESXImageProfile -CloneProfile ESXi-6.0.0-20160301001-standard -Name vcaptest

(to add extra drivers) Add-ESXSoftwarePackage -ImageProfile vcaptest -SoftwarePackage esx-tools-for-esxi

(to view) Get-ESXImageProfile vcaptest | select -ExpandProperty viblist

Export-ESXImageProfile -ImageProfile vcaptest -ExportToIso c:\vcaptest.iso
or -ExportToBundle c:\vcaptest.zip (to reuse later)

Create Deploy Rules

(192.168.101.50-192.168.101.100 = DHCP Scope range configured in previous section for ESXi hosts)

New-DeployRule -Name “firstboot” -Item “vcaptest” -Pattern “ipv4=192.168.101.50-192.168.101.100”
New-DeployRule -Name “assigncluster” -Item “autodeploy” -Pattern “ipv4=192.168.101.50-192.168.101.100”
New-Deployrule -Name “hostprofilerule” -Item “ADesxi6.0” -Pattern “ipv4=192.168.101.50-192.168.101.100”

Add-Deployrule firstboot
Add-Deployrule assigncluster
Add-Deployrule  hostprofilerule

Above rules automatically attach the specified image profile, adds to cluster and attaches a host profile respectively. VM/HW in above range are now ready to be automatically booted into ESXi hosts.

1c.Create and associate Host Profiles for an Auto Deploy reference host

Requirements

vSphere Web Client

Create Host Profile

Go to Home –> Host Profiles –> Hit + symbol to extract host profile from an existing host –> Give a name and Finish.

or

Right click an ESXi host –> Host Profiles –> Extract host profile

or

Can also Export and Import host profiles across environments (.vpf format)

Edit Host profile

Go to Home –> Host Profiles –>Select the host profile created in above step –> Edit number of configurations

Use the host profile created in this step in the Autodeploy deploy rule in previous section. PXE booted ESXi hosts now come up with desired configuration.

Remember that the root password is empty for auto deploy hosts – so add the configuration to set this (Profile –> Security & Services –> Security configuration –> Administrator password –> Configure a fixed administrator password).

2.Configure Kernel Boot Parameters for scripted install

2a.Modify scripted weasel install (ks.cfg)

Requirements

ESXi ISO and a VM/HW

ks.cfg file (the installation script) hosted in one of the following:

FTP
HTTP/HTTPS
NFS Share
USB flash drive
CD/DVD device

Configure Kernel Boot Parameters
  1. Get ks.cfg file located at /etc/vmware/weasel/ks.cfg from an existing ESXi host or copy paste default contents from here (various options also can be found here). Edit the file as needed using text editors vi, wordpad etc.,
  2. Find simple steps to host a website and make ks.cfg file available
  3. Load ESXi ISO to the VM/HW and start the machine
  4. Press Shift O (NOT zero) at the time of boot loading process (have about 5 secs. This is right after the boot options screen with about 10 secs)
  5. Based on where the file is hosted enter the file path to get ks.cfg, and also provide IP address so that the host can reach to it. This IP is temporary, and is not used after the install.
  6. An example entry typed: >runweasel ks=http://ks.techmaayam.local/kickstart/ks-custom.cfg nameserver=192.168.101.10 ip=192.168.101.222
    netmask=255.255.255.0 gateway=192.168.101.1
  7. System goes through prelim checks and warnings are displayed as needed. They get bypassed automatically. But all critical errors will have to be fixed before continuing (E.g. site hosting ks.cfg file not reachable).
  8. Once installation is complete, system should be restarted and comes up with static or dynamic IP based on the answer file.

Boot.cfg (found in root of ESXi install image) can also be edited to contain kernelopt=ks=http… so that admins do not have to input boot parameters every time.

2b.Create / Modify scripted installation

3.Configure Advanced System Settings according to a deployment plan

3a.Edit System Swap / Scratch Configuration

Scratch

Web Client – Decide the intended datastore to be used as Scratch – Manage – Files – create folder named .locker.esx1scratch. Go to summary and collect the datastore URL

GUI – Web Client — select intended ESXi host — Manage — Settings — System — Advanced System Settings — ScratchConfig.ConfiguredScratchLocation: /vmfs/volumes/datastore1/.locker.esx1scratch/ (auto grabs uuid of datastore name. Can also directly use URL copied from above step).

cmdline – /etc/vmware/locker.conf
ScratchConfig.ConfiguredScratchLocation
Eg value. /vmfs/volumes/datastore1/.locker.esx1scratch/ . After reboot change takes effect.

Swap

ESXi–Manage tab– Settings — System Swap.
Options: Enable, Choose a Datastore to be used for storing swap file, Host Cache – Allow the use of part of the host cache and Preferred swap file location.
(Immediate effect)

3b.Configure ESXi host to use a central Syslog Server

GUI – Web Client — select intended ESXi host — Manage — Settings — System — Advanced System Settings —

Syslog.global.logDir /vmfs/volumes/DatastoreName/DirectoryName/
Syslog.global.logHost tcp://hostname:514 or udp://hostname:514 or ssl://hostname:514
Syslog.global.logDirUnique boolean
Syslog.global.defaultRotate
Syslog.global.defaultSize

cmdline -esxcli system syslog config get
esxcli system syslog config set –logdir=/path/to/vmfs/directory/ –loghost=RemoteHostname –logdir-unique=true|false –default-rotate=NNN –default-size=NNN
esxcli system syslog reload
nc -z 10.11.12.13 514 (to test)

Can now directly configure syslog in VCSA 6, it has partial syslog support. So will forward alll connected ESXi logs and partial vCenter server logs for important services.

GUI – Web Client –Administration — System configuration — Services — VMware Syslog service — Syslog host, port etc.,

Good read on this topic.

4.Manage/Edit the Core Dump configuration of an ESXi host

To set a specific disk partition as diagnostic partition:

Set disk partition type as diagnostic (a pre-requisite)
To get device info: ls /vmfs/devices/disks/
To get start-End sectors: partedUtil getUsableSectors “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0”
To get partition details: partedUtil getptbl “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0”

partedUtil setptbl “/vmfs/devices/disks/DeviceName” DiskLabel [“partNum startSector endSector type/guid attribute”]

E.g. partedUtil set “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0” “1 128 500000 131 128” “2 500001 999999 131 0”

If using gpt, the type should be set using GUIDs. Start sector can be 2048 usually. To get GUIDs, type
partedUtil showGuids

Configuring a diagnostic coredump partition:
esxcli system coredump partition list, get (to get current configured)
esxcli system coredump partition set –partition=”mpx.vmhba2:C0:T0:L0:7″ (from above section)
esxcli system coredump partition set –enable true
esxcli system coredump partition set –enable true –smart

Reference1, Reference2

To configure network dump collector

Configure vCenter to act as dump collector (no need to install separately from 6.0):

GUI – Web Client –Administration — System configuration — Services — ESXi Dump Collector — Actions — Start and Edit startup type to Automatic. Also can edit port and max size from 1 to 10GB.

Configure ESXi to send logs:

esxcli system coredump network set –interface-name vmk0 –server-ipv4 192.168.101.30 –server-port 6500
esxcli system coredump network set –enable true
esxcli system coredump network get

Thanks for Reading!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s