You can deploy the ESXi operating system on a server using a server YAML file or a hardware profile.
The following sample YAML files show the attributes and values for ESXi deployment on Dell PowerEdge R650 and R750 servers.
- These files are only for reference. You must use the sample files provided with Bare Metal Orchestrator deployment.
- The comments in the YAML file start with a hash character (#) and is followed by a text or the name of the attribute. You can remove # to un-comment and edit the attribute value.
- Replace what appears between italicized, bold chevrons (
< >
) with user-supplied content. For example:password: <REPLACE_THIS>
Sample server YAML file for ESXi deployment
apiVersion: mw.dell.com/v4
kind: Server
metadata:
name: server1
labels:
site: malibu
spec:
bmcEndPoint: "https://<BMC-IP>"
userName: root
password: <REPLACE_THIS>
bios:
attributes:
procVirtualization: Enabled
bootMode: Uefi
serialPortAddress: Com2
bmc:
- attributes:
rfsIgnoreCertWarning: "Yes"
serialRedirectEnable: Enabled
operatingsystemname: "esxi-media"
# set overwriteInstallation to true while editing existing servers to overwrite existing OS and to trigger a fresh installation
overwriteInstallation: false
operatingsystemconfig:
autoConfigureBoss: true
osDriver:
- icen-media
- ibbd-media
#installVolumeID: "Disk.Virtual.0:RAID.Slot.2-1"
networkingDetails:
hostName: esxi-hostname
ntpServer:
- "127.0.0.1"
dnsSearch:
- "dell.com"
dnsServer:
- "127.0.0.1"
installVolumeTypeOrder:
- type: BOSS
- type: SDCARD
- type: NVME
- type: HBA
- type: RAID
name: "Virtual Disk 1"
configtype: "preseed"
configdata: |
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for the DCUI and Tech Support Mode
rootpw <REPLACE_THIS>
# Specifies another installation script to parse
%include /tmp/sks.cfg
# Reboot the machine after scripted installation is complete
reboot
# Specifies the NW address - obtain the NW settings from DHCP or static, IP address, Gateway, Subnet Mask,
# Nameserver, Hostname, VLAN ID and Device MAC address or device name
network --bootproto=static --ip=192.168.20.10 --gateway=192.168.20.254 --netmask=255.255.255.0 --nameserver="192.168.20.250" --device="MAC" --hostname=esxi1.dev.dell.com --vlanid=10
###################################################################################################
# Section below this should not be edited for a successful ESXi installation
###################################################################################################
# Creates an init script that runs only during the first boot. It has no effect on subsequent boots.
%firstboot --interpreter=busybox
# Set the hostname - using the input given in the spec.operatingsystemconfig.networkingDetails.hostname
OSHOSTNAME={{.OSNetworkingDetails.HostName}}
if [[ $OSHOSTNAME != "" ]]; then
esxcli system hostname set --host=$OSHOSTNAME
fi
# Set NTP setting
NTPList={{.NTPServer}}
if [[ ${#NTPList[@]} != 0 ]]; then
NTPServer=""
for ntp in $NTPList
do
NTPServer="${NTPServer} -s ${ntp}"
done
esxcli system ntp set -e=0
esxcli system ntp set $NTPServer
esxcli system ntp set -e=1
fi
# Set DNS Search Setting
DNSList={{.DNSSearch}}
if [[ ${#DNSList[@]} != 0 ]]; then
for dns in $DNSList
do
esxcli network ip dns search add -d $dns
done
fi
# Set DNS Server Setting
DNSServerList={{.DNSServer}}
if [[ ${#DNSServerList[@]} != 0 ]]; then
for server in $DNSServerList
do
esxcli network ip dns server add -s $server
done
fi
# Set boot script to echo onto serial device
sed -i '$ d' /etc/rc.local.d/local.sh
echo 'echo sol_verify_complete > /dev/klog' >> /etc/rc.local.d/local.sh
echo 'sleep 5m' >> /etc/rc.local.d/local.sh
echo "esxcli network ip interface ipv4 get | awk 'BEGIN {print \"bmo_ip_details_delimiter\"} {if (NR>2) printf(\"%s:%s\n\", \$1, \$2)} END { print \"bmo_ip_details_delimiter\" }' >> /dev/klog" >> /etc/rc.local.d/local.shKris S. looking into why the above line breaks parsing when uploading XML to InfoHub
echo "echo \"<ConfigRoot><service><id>webServer</id><rule id='0000'><direction>outbound</direction><protocol>tcp</protocol><porttype>dst</porttype><port>81</port></rule><enabled>true</enabled><required>true</required></service></ConfigRoot>\" > /etc/vmware/firewall/webServer.xml" >> /etc/rc.local.d/local.sh
echo 'localcli network firewall refresh' >> /etc/rc.local.d/local.sh
# install network driver
DEVICEDRIVERS={{.DeviceDriver}}
if [[ ${#DEVICEDRIVERS[@]} != 0 ]]; then
echo "esxcli system maintenanceMode set -e true" >> /etc/rc.local.d/local.sh
for DEVICEDRIVER in $DEVICEDRIVERS
do
echo "wget $DEVICEDRIVER -O /tmp/driver.zip" >> /etc/rc.local.d/local.sh
echo "unzip /tmp/driver.zip -d /tmp/ -o" >> /etc/rc.local.d/local.sh
echo "rm -f /tmp/driver.zip" >> /etc/rc.local.d/local.sh
echo "localcli software vib install -d /tmp/*.zip" >> /etc/rc.local.d/local.sh
echo "rm -f /tmp/*.zip" >> /etc/rc.local.d/local.sh
done
echo "esxcli system maintenanceMode set -e false" >> /etc/rc.local.d/local.sh
fi
echo "esxcli software vib list | awk 'BEGIN {print \"bmo_driver_details\"} {if (NR>2) printf(\"%s:%s\n\", \$1, \$2)} END {}' >> /dev/klog" >> /etc/rc.local.d/local.sh
echo "esxcli software vib list --rebooting-image | awk 'BEGIN {} {if (NR>2) printf(\"%s:%s\n\", \$1, \$2)} END { print \"bmo_driver_details\" }' >> /dev/klog" >> /etc/rc.local.d/local.sh
echo "esxcli network ip interface ipv4 get | awk 'BEGIN {print \"bmo_ip_details_delimiter\"} {if (NR>2) printf(\"%s:%s\n\", \$1, \$2)} END { print \"bmo_ip_details_delimiter\" }' >> /dev/klog" >>
/etc/rc.local.d/local.sh
echo 'exit 0' >> /etc/rc.local.d/local.sh
# Send vmkernel log messages to the serial port
localcli system settings advanced set -o /Misc/LogToSerial -i 1
# Send vmkernel debug log messages to the serial port
localcli system settings advanced set -o /Misc/DebugLogToSerial -i 1
# Set rate for COM2 port to 115200
localcli system settings kernel set -s com2_baud -v 115200
# Set name of serial port to use for logging to COM2
localcli system settings advanced set -o /Misc/LogPort -s COM2
# Create a script to run before kickstart configuration is evaluated, this is used to generate files for the kickstart file to include
%pre --interpreter=busybox
# Retrieving the Device UID for all types of Volumes supported and using it for partitioning and installing ESXi
PICKFIRSTVOLUME={{.PickFirstVolume}}
SASADDRESS={{.SASAddress}}
TARGET={{.Target}}
TARGET=`expr $TARGET % 128`
SERIALNUMBER={{.SerialNumber}}
BOSSDISKTYPE={{.BossDiskType}}
DEVICETYPE={{.DeviceType}}
DEVICENAME=""
if [[ $DEVICETYPE == "nvme" ]]; then
nvmeDevices=$(localcli nvme device list | awk '{print $1}')
for nvmeDevice in $nvmeDevices
do
if [[ $(localcli nvme device get -A $nvmeDevice | grep -c -i $SERIALNUMBER) == 1 ]]; then
DEVICENAME=$(localcli storage core adapter device list | awk '{ if($1 == "'$nvmeDevice'") print $2}')
fi
done
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
elif [[ $DEVICETYPE == "raid" ]]; then
if [[ $PICKFIRSTVOLUME == "Yes" ]]; then
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($11 == "'$SASADDRESS'") print $3}' | head -1 | tail -1 | awk '{print $1}')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
else
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($11 == "'$SASADDRESS'" && $6 == "'$TARGET'") print $3}')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
fi
elif [[ $DEVICETYPE == "hba" ]]; then
TARGETLIST=$(esxcfg-mpath -L | grep $SASADDRESS | awk '{ print $6 }' | sort -n)
for TGT in $TARGETLIST
do
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($11 == "'$SASADDRESS'" && $6 == "'$TGT'") print $3}')
DISPLAYNAME=$(esxcfg-mpath -l | grep -E ".*Display Name.*Disk.*$DEVICENAME" | cut -d":" -f2)
if [[ -z "$DISPLAYNAME" ]]; then
continue
else
break
fi
done
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
elif [[ $DEVICETYPE == "usb" ]]; then
echo "install --ignoressd --firstdisk=usb --overwritevmfs --novmfsondisk" >> /tmp/sks.cfg
elif [[ $DEVICETYPE == "boss" ]]; then
if [[$BOSSDISKTYPE == "Virtual"]]; then
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($3 ~ "'ATA'" && $3 ~ "'VD'") print $3}' | awk 'NR==1')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
fi
if [[ -z $DEVICENAME ]]; then
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($3 ~ "'ATA'") print $3}' | awk 'NR==1')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
fi
elif [[ $DEVICETYPE == "firstdisk" ]]; then
echo "install --firstdisk --overwritevmfs --novmfsondisk" >> /tmp/sks.cfg
fi
Sample hardware profile YAML file for ESXi deployment
apiVersion: mw.dell.com/v4
kind: Server
metadata:
name: dell-server-driver
labels:
model: dell
site: gc
spec:
bmcEndPoint: "https://1.2.3.4"
userName: root
password: "REPLACE_THIS"
bios:
attributes:
procVirtualization: Enabled
bootMode: Uefi
serialPortAddress: Com1
bmc:
- attributes:
serialRedirectEnable: Enabled
rfsIgnoreCertWarning: "Yes"
powerstate: "On"
operatingsystemname: "os-media"
# set overwriteInstallation to true while editing existing servers to overwrite existing OS and to trigger a fresh installation
overwriteInstallation: false
operatingsystemconfig:
autoConfigureBoss: false
osDriver:
- ibbd
- icen
#installVolumeID: "Disk.Virtual.0:RAID.Slot.2-1"
networkingDetails:
hostName: esxi-hostname
ntpServer:
- "127.0.0.1"
dnsSearch:
- "dell.com"
dnsServer:
- "127.0.0.1"
installVolumeTypeOrder:
- type: RAID
name: "Virtual Disk 1"
- type: BOSS
- type: SDCARD
- type: NVME
- type: HBA
configtype: "preseed"
configdata: |
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for the DCUI and Tech Support Mode
rootpw REPLACE_THIS
# Specifies another installation script to parse
%include /tmp/sks.cfg
# Reboot the machine after scripted installation is complete
reboot
# Specifies the NW address - obtain the NW settings from DHCP or static, IP address, Gateway, Subnet Mask,
# Nameserver, Hostname, VLAN ID and Device MAC address or device name
network --bootproto=static --ip=6.7.8.9 --gateway=8.8.8.8 --netmask=255.255.255.0 --nameserver="11.22.33.44"
###################################################################################################
# Section below this should not be edited for a successful ESXi installation
###################################################################################################
# Creates an init script that runs only during the first boot. It has no effect on subsequent boots.
%firstboot --interpreter=busybox
# Set the hostname - using the input given in the spec.operatingsystemconfig.networkingDetails.hostname
OSHOSTNAME={{.OSNetworkingDetails.HostName}}
if [[ $OSHOSTNAME != "" ]]; then
esxcli system hostname set --host=$OSHOSTNAME
fi
# Set NTP setting
NTPList={{.NTPServer}}
if [[ ${#NTPList[@]} != 0 ]]; then
NTPServer=""
for ntp in $NTPList
do
NTPServer="${NTPServer} -s ${ntp}"
done
esxcli system ntp set -e=0
esxcli system ntp set $NTPServer
esxcli system ntp set -e=1
fi
# Set DNS Search Setting
DNSList={{.DNSSearch}}
if [[ ${#DNSList[@]} != 0 ]]; then
for dns in $DNSList
do
esxcli network ip dns search add -d $dns
done
fi
# Set DNS Server Setting
DNSServerList={{.DNSServer}}
if [[ ${#DNSServerList[@]} != 0 ]]; then
for server in $DNSServerList
do
esxcli network ip dns server add -s $server
done
fi
# Set boot script to echo onto serial device
sed -i '$ d' /etc/rc.local.d/local.sh
echo 'sleep 5m' >> /etc/rc.local.d/local.sh
echo 'echo sol_verify_complete > /dev/klog' >> /etc/rc.local.d/local.sh
echo "echo \"<ConfigRoot><service><id>webServer</id><rule id='0000'><direction>outbound</direction><protocol>tcp</protocol><porttype>dst</porttype><port>81</port></rule><rule id='0002'><direction>outbound</direction><protocol>tcp</protocol><porttype>dst</porttype><port>442</port></rule>
<enabled>true</enabled><required>true</required></service></ConfigRoot>\" > /etc/vmware/firewall/webServer.xml" >> /etc/rc.local.d/local.sh
echo 'localcli network firewall refresh' >> /etc/rc.local.d/local.sh
# install network driver
DEVICEDRIVERS={{.DeviceDriver}}
if [[ ${#DEVICEDRIVERS[@]} != 0 ]]; then
echo "esxcli system maintenanceMode set -e true" >> /etc/rc.local.d/local.sh
for DEVICEDRIVER in $DEVICEDRIVERS
do
echo "wget --no-check-certificate $DEVICEDRIVER -O /tmp/driver.zip" >> /etc/rc.local.d/local.sh
echo "unzip /tmp/driver.zip -d /tmp/ -o" >> /etc/rc.local.d/local.sh
echo "rm -f /tmp/driver.zip" >> /etc/rc.local.d/local.sh
echo "localcli software vib install -d /tmp/*.zip" >> /etc/rc.local.d/local.sh
echo "rm -f /tmp/*.zip" >> /etc/rc.local.d/local.sh
done
echo "esxcli system maintenanceMode set -e false" >> /etc/rc.local.d/local.sh
fi
echo "esxcli software vib list | awk 'BEGIN {print \"bmo_driver_details\"} {if (NR>2) printf(\"%s:%s\n\", \$1, \$2)} END {}' >> /dev/klog" >> /etc/rc.local.d/local.sh
echo "esxcli software vib list --rebooting-image | awk 'BEGIN {} {if (NR>2) printf(\"%s:%s\n\", \$1, \$2)} END { print \"bmo_driver_details\" }' >> /dev/klog" >> /etc/rc.local.d/local.sh
echo "esxcli network ip interface ipv4 get | awk 'BEGIN {print \"bmo_ip_details_delimiter\"} {if (NR>2) printf(\"%s:%s\n\", \$1, \$2)} END { print \"bmo_ip_details_delimiter\" }' >> /dev/klog" >> /etc/rc.local.d/local.sh
echo 'exit 0' >> /etc/rc.local.d/local.sh
# Send vmkernel log messages to the serial port
localcli system settings advanced set -o /Misc/LogToSerial -i 1
# Send vmkernel debug log messages to the serial port
localcli system settings advanced set -o /Misc/DebugLogToSerial -i 1
# Set rate for COM2 port to 115200
localcli system settings kernel set -s com2_baud -v 115200
# Set name of serial port to use for logging to COM2
localcli system settings advanced set -o /Misc/LogPort -s COM2
# Create a script to run before kickstart configuration is evaluated, this is used to generate files for the kickstart file to include
%pre --interpreter=busybox
# Retrieving the Device UID for all types of Volumes supported and using it for partitioning and installing ESXi
PICKFIRSTVOLUME={{.PickFirstVolume}}
SASADDRESS={{.SASAddress}}
TARGET={{.Target}}
TARGET=`expr $TARGET % 128`
SERIALNUMBER={{.SerialNumber}}
BOSSDISKTYPE={{.BossDiskType}}
DEVICETYPE={{.DeviceType}}
DEVICENAME=""
if [[ $DEVICETYPE == "nvme" ]]; then
nvmeDevices=$(localcli nvme device list | awk '{print $1}')
for nvmeDevice in $nvmeDevices
do
if [[ $(localcli nvme device get -A $nvmeDevice | grep -c -i $SERIALNUMBER) == 1 ]]; then
DEVICENAME=$(localcli storage core adapter device list | awk '{ if($1 == "'$nvmeDevice'") print $2}')
fi
done
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
elif [[ $DEVICETYPE == "raid" ]]; then
if [[ $PICKFIRSTVOLUME == "Yes" ]]; then
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($11 == "'$SASADDRESS'") print $3}' | head -1 | tail -1 | awk '{print $1}')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
else
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($11 == "'$SASADDRESS'" && $6 == "'$TARGET'") print $3}')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
fi
elif [[ $DEVICETYPE == "hba" ]]; then
TARGETLIST=$(esxcfg-mpath -L | grep $SASADDRESS | awk '{ print $6 }' | sort -nr)
TARGET=1000 # setting a unrealistic value so that the first iteration gets set to a valid number
for TGT in $TARGETLIST
do
if [[ $TGT -le $TARGET ]]; then
TARGET=$TGT
fi
done
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($11 == "'$SASADDRESS'" && $6 == "'$TARGET'") print $3}')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
elif [[ $DEVICETYPE == "usb" ]]; then
echo "install --ignoressd --firstdisk=usb --overwritevmfs --novmfsondisk" >> /tmp/sks.cfg
elif [[ $DEVICETYPE == "boss" ]]; then
if [[$BOSSDISKTYPE == "Virtual"]]; then
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($3 ~ "'ATA'" && $3 ~ "'VD'") print $3}' | awk 'NR==1')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
fi
if [[ -z $DEVICENAME ]]; then
DEVICENAME=$(esxcfg-mpath -L | awk '{ if($3 ~ "'ATA'") print $3}' | awk 'NR==1')
echo "install --disk=$DEVICENAME --overwritevmfs" >> /tmp/sks.cfg
fi
elif [[ $DEVICETYPE == "firstdisk" ]]; then
echo "install --firstdisk --overwritevmfs --novmfsondisk" >> /tmp/sks.cfg
fi