WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / How to prevent physical CD-ROM from ejecting after installing or upgrading ESXi?

How to prevent physical CD-ROM from ejecting after installing or upgrading ESXi?

07.15.2019 by William Lam // Leave a Comment

While catching up on some news over the weekend, I had noticed a VMware Reddit thread asking a pretty interesting question on how to prevent the physical CD-ROM tray from ejecting after installing or upgrading ESXi? This behavior occurs whether you are using a physical CD-ROM media or a "Virtual" ISO image via an out-of-band interface like an iDRAC or iLO. If you are automating the installation or upgrade using Auto Deploy or network installation such as Kickstart, this is not a problem.

However, I was a bit surprised to hear that this was still a pain point in 2019, as many of the new servers in market do not even include an option for CD-ROM. Some of the suggestions really brought me back to the early 2000's including physically taping up the CD-DROM tray, which I have definitely seen customers doing but this is not a scalable solution and it requires a visit to the datacenter. 

One easy solution that I had suggested was to take advantage of ESXi's scripted installation capability also known as Kickstart and use the supported ESXi --noeject option after reboot. Since the install/upgrade was being done manually, the added benefit of this solution is that you can now have it automated 🙂 The other nice thing about this option is that you can specify the kickstart using the default ESXi ISO or you can take it a step further and embed the Kickstart with a custom ESXi ISO.

Step 1 - Here is a sample Kickstart which includes the --noeject command as part of the reboot option. Simply host ks.cfg on an internal webserver which is accessible by the ESXi host that is being installed and/or upgraded. 

vmaccepteula
install --firstdisk=local --overwritevmfs
reboot --noeject

network --bootproto=static --ip=192.168.30.99 --netmask=255.255.255.0 --gateway=192.168.30.1 --hostname=noeject-esxi.primp-industries.com --nameserver=192.168.30.1 --addvmportgroup=1
rootpw VMware1!

%firstboot --interpreter=busybox

# enable & start SSH
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh

# enable & start ESXi Shell
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell

# Suppress ESXi Shell warning
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i

Step 2 - Boot the ESXi ISO like you normally would but edit the boot option (Shift+O) and replace it with the following: ks=https://[SERVER]/ks.cfg and then hit enter for installation and/or upgrade to automatically start.


Once the installation has finished, the ESXi host will automatically reboot and the CD-ROM tray will not be ejected.

Since I did not have a physical host with CD-ROM, I was able to validate this by simply using a Nested ESXi VM and as you can see, the CD-ROM device is still "Connected" after installation.


If we install or upgrade ESXi normally via the ISO image, you will see the CD-ROM device is automatically "Disconnected" afterwards which is the equivalent of ejecting the physical CD-ROM tray.

More from my site

  • Automated ESXi Installation to USB using Kickstart
  • Revisiting prompting for user input during an interactive or scripted install of ESXi
  • How to prompt for user input during an interactive or scripted install of ESXi?
  • How to create custom ESXi boot menu to support multiple Kickstart files?
  • How to automate VM deployment from large USB keys using ESXi Kickstart?

Categories // Automation, ESXi Tags // cdrom, esxi, kickstart, ks.cfg, noeject

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • vSphere with Tanzu using Intel Arc GPU 01/26/2023
  • Quick Tip - Automating allowed and not allowed Datastores for use with vSphere Cluster Services (vCLS) 01/25/2023
  • ESXi with Intel Arc 750 / 770 GPU 01/24/2023
  • How to bootstrap vSAN Express Storage Architecture (ESA) on unsupported hardware? 01/19/2023
  • Automating Virtual Machine screenshots in vSphere 01/18/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...