Script for unattended esxi installation using ftp server | KickStart script


You can use scripts for unattended ESXi installation or upgrade, scripted installations or upgrades provide an efficient way to deploy multiple hosts.


The installation or upgrade script contains the installation settings for ESXi. You can apply the script to all hosts that you want to have a similar configuration.


For a scripted installation or upgrade, you must use the supported commands to create a script. You can edit the script to change settings that are unique for each host.


The installation or upgrade script can reside in one of the following locations:


FTP server

HTTP/HTTPS server

NFS server

USB flash drive

CD-ROM drive

In my lab I am keeping the installation script in FTP and HTTP server.


You can download the script from below link and save the script win KS.CFG

http://www.mytechinfoit.com/2022/04/script-to-automate-esxi-deployment.html 


Steps to configure FTP server.


Login to server

Go to server manager

Add Roles and features -> Follow the screen

Check web server IIS

FTP server

Select FTP service



Click next and follow the screen and install

Once installation complete

Open IIS manager




Right click on site and click Add  FTP site


Give the FTP site name

In content directory give the physical location of script file

I have kept script file in c:\esxi folder



Click next 

Select IP address to bind the address, in my Lab setup I am using single IP, if there is multiple assigned on the server then it will show in list


Select No SSL



In Authentication type

Select Anonymous

And anonymous users


In permission 

Select Read


Then click finish

Now select newly created FTP site SK-CFG

Click FTP authentication and enable Anonymous authentication if it is not already enabled

Once you enable it then anyone can access this FTP content without login.



Also click on FTP authorization rule to recheck whether anonymous users are allowed or not



Now go to the client machine and check whether FTP is working or not.

Open browser and enter FTP path-> ftp://192.168.1.16/ 


Now FTP page is opening without entering any user ID or password


Steps to install unattended ESXI 


If you are using physical server for deployment, then mount ESXI ISO and boot the server using CD/DVD

And follow below steps, in my case I am deploying ESXi in VMware workstation.

Steps will be the same for both Physical and Virtual only, the booting process will be different.


For a physical server you need to launch iLO console and mount ISO and boot from there.

In the VMware workstation we need to edit the VM setting and assign the ISO path and boot the server.



Once you will boot the server using ISO at first boot press SHIFT=O to edit boot options 





Now enter FTP address one temp IP to communicate with the FTP server like below.



Press enter.

Now installation has started


Post installation server will auto reboot and do the entire configuration that has been updated in the script.

Finally installation completed with the same configuration that had updated in script file.



Thank you!!!!











Script to automate ESXI deployment

 ################################################

## vSphere ESXi 7.0 Scripted Install - Part 1 ##

################################################

# Accept the VMware End User License Agreement

vmaccepteula


# Set the root password for DCUI

rootpw Passw0rd!!


# Install on the first local disk available on machine

install --firstdisk --overwritevmfs


# Set the network to Static on the first network adapter

network --hostname=esxi7-Auto --device=vmnic0 --bootproto=static --ip=192.168.1.215 --netmask=255.255.255.0 --gateway=192.168.1.1 --nameserver=192.168.1.16


# Reboot

reboot


################################################

## vSphere ESXi 7.0 Scripted Install - Part 2 ##

################################################


# Use busybox interpreter

%firstboot --interpreter=busybox


# Set DNS Suffix

esxcli network ip dns search add --domain=ads.com


# Disable IPv6

esxcli network ip set --ipv6-enabled=false


# Enable SSH

vim-cmd hostsvc/enable_ssh

vim-cmd hostsvc/start_ssh


# Enable NTP

echo "server 0.au.pool.ntp.org" >> /etc/ntp.conf;

echo "server 1.au.pool.ntp.org" >> /etc/ntp.conf;

/sbin/chkconfig ntpd on;


# Create vSwitches

esxcli network vswitch standard add -v vSwitch1

esxcli network vswitch standard add -v vSwitch2


# Set vSwitch MTU's

esxcli network vswitch standard set -v vSwitch1 -m 9000

esxcli network vswitch standard set -v vSwitch2 -m 9000


# Add Additional NIC to vSwitches

esxcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch0

esxcli network vswitch standard uplink add --uplink-name=vmnic2 --vswitch-name=vSwitch1

esxcli network vswitch standard uplink add --uplink-name=vmnic3 --vswitch-name=vSwitch1

esxcli network vswitch standard uplink add --uplink-name=vmnic4 --vswitch-name=vSwitch2

esxcli network vswitch standard uplink add --uplink-name=vmnic5 --vswitch-name=vSwitch2


# Create VMKernel Ports

esxcli network vswitch standard portgroup add --portgroup-name=vMotion --vswitch-name=vSwitch1

esxcli network vswitch standard portgroup add --portgroup-name=NFS --vswitch-name=vSwitch2

esxcli network ip netstack add --netstack=vmotion

esxcli network ip interface add --interface-name=vmk1 --portgroup-name=vMotion --netstack=vmotion --mtu=9000

esxcli network ip interface add --interface-name=vmk2 --portgroup-name=NFS --mtu=9000

esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=192.168.10.215 --netmask=255.255.255.0 --type=static

esxcli network ip interface ipv4 set --interface-name=vmk2 --ipv4=192.168.5.215 --netmask=255.255.255.0 --type=static


# Put host in maintenance mode

esxcli system maintenanceMode set -e true


# Reboot to apply settings (disabling IPv6)

esxcli system shutdown reboot -d 15 -r "rebooting after disabling IPv6"

Steps to customize windows start layout and taskbar using group policy

 Steps to customize windows start layout and taskbar using group policy


To prepare a Start layout for export, you simply customize the Start layout on a test computer.

To prepare a test computer

Set up a test computer on which to customize the Start layout. Your test computer should have the operating system that is installed on the users’ computers. Install all apps and services that the Start layout should display.


Create a new user account that you will use to customize the Start layout.


To customize Start


Sign in to your test computer with the user account that you created.


Customize the Start layout as you want users to see it by using the following techniques:


Pin apps to Start. From Start, type the name of the app. When the app appears in the search results, right-click the app, and then click Pin to Start.


To view all apps, click All apps in the bottom-left corner of Start. Right-click any app, and pin or unpin it from Start.


Unpin apps that you don’t want to display. To unpin an app, right-click the app, and then click Unpin from Start.


Drag tiles on Start to reorder or group apps.


Resize tiles. To resize tiles, right-click the tile and then click Resize.


Create your own app groups. Drag the apps to an empty area. To name a group, click above the group of tiles and then type the name in the Name group field that appears above the group.


Initial start layout and task manager setting on my test machine “Database



Now you need to pin/unpin from start and taskbar as per your requirements.


Here I have pined application in start menu and taskbar as per my requirement in my test machine “Database



Now launch PowerShell

Run below command to generate start layout .xml file

You can export application path using


AppUserModelID or DesktopApplicationLinkPath 

It depends on the OS where you are running this script.


Export-StartLayout -Path C:\Temp\startlayout010422.xml 





Now go to machine open gpedit.msc


Local Computer Policy -> Computer Configuration ->Administrative Templates -> Start Menu and Taskbar -> 


Double click on Start Layout -> Enable and enter .xml file path




If you want to configure for User only then you need to select User configuration -> Administrative Templates -> Start Menu and Taskbar -> 


Double click on Start Layout  -> Enable and enter .xml file path


Run Gpupdate /force and restart the machine and try with any local user.

Once this policy is implemented, users can’t customize the Start layout.


To configure taskbar in windows you need to do some modification in existing .xml file


Add xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout" to the first line of the file, before the closing >


Like below


Use below layout setting between 

</DefaultLayoutOverride>


</LayoutModificationTemplate>

And add DesktopApplicationLinkPath with application name .ink in between like below


<CustomTaskbarLayoutCollection>

      <defaultlayout:TaskbarLayout>

        <taskbar:TaskbarPinList>

          <taskbar:UWA AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />

          <taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />

        </taskbar:TaskbarPinList>

      </defaultlayout:TaskbarLayout>

    </CustomTaskbarLayoutCollection>




Save the .xml file and again run gpupdate /force and check with any local user.

Now the same taskbar and start layout will apply to all users.


Thanks!!!!





Featured Post

HPE MSA 2040 configuration step by step

HPE MSA 2040 configuration Default IP range for HP SAN storage MSA 2040 is 10.0.0.1/2 You need to connect your laptop and storage with...