VMware vSphere

 View Only

 Deploy VM using Kickstart file

Mik3's profile image
Mik3 posted Mar 04, 2025 09:19 AM

Hi all,

My question for you:

How do I deploy VMs at install?

The hypothetical environment:

I have a standalone server that will be on a space station orbiting Earth. As part of the Disaster Recovery plan, I need to give the user a quick and simple (from their point of view) way to completely re-install ESXi (8.0.3) along with two VMs onto a fresh server. (I already have a working KS file that will allow me to automate the install of ESXi and apply all required settings - Attachment KS-BC.txt)

The Constraints:

  1. The server is standalone, there is no internet connectivity onboard the space station.
  2. There is no external management position available. The user has the server, a keyboard, a mouse, a monitor, and some USB sticks.
  3. Everything is done through the console/terminal/ESXCLI

While on Earth, I have access to a management position:

I can do the following step by step:

  1. Take .OVF exports of the VMs that I want to use
  2. Use OVFTOOLS to convert the .OVF into .VMX & .VMDK etc.
  3. Split the files that are over 4GB (due to constraints of ESXi 8 reading NTFS/FAT32) onto a USB
  4. Stop usbarbitrator and identify the mpx path of the USB
  5. Copy the files onto the datastore
  6. Cat the files back together on the server
  7. Register and power on the VM

Steps 1, 2, & 3 are run on my management position.
What I would like, is to have steps 4, 5, 6, & 7 to run as part of the KS process. (See Attachment - Steps_to_implement.txt for code to achieve adding first VM).

I was experimenting with %post yesterday but nothing (not even simple things like echo "Hello, World!" > tty3) would run, and anything more complicated (like renaming the datastore) would error out. Weird. Is %post the way to go about this, do you think? 

Please help!

Mik3