How to consume ESXI Images stored on http/nfs from Foreman server

Problem: I deployed foreman version 1.21.3 and followed this documentation to test deployment of ESXi (Foreman :: Deploying ESXi through Foreman). According to step 2.3 ESXi iso is mounted directly to /var/lib/tftpboot/boot/ESXi-6.7.0-8169922, for a more permanent solution is it possible to create a symlink to my /var/nfs/ESXi-6.7.0-8169922 locations??? I made these changes and for some reason seems like symlinks are not supported? Are the files really loading from the install media defined on step 1?

I want to keep my foreman server lightweight. I already have http/nfs location with all the images in already extracted and modified. How can I re-use them without copying everything to the server

Expected outcome:

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

Did some further reading and found out the Installation media is not needed for the ESXI deployment. This is more Foreman requirement.

I think I might have found the issue. TFTP root is by default set to /var/lib/tftpboot. Per instructions in the links we need to create 2 directories boot/ and syslinux386/ so it would look like:
/var/lib/tftpboot/boot --> contains all the boot.cfg
/var/lib/tftpboot/syslinux386 --> contains the pxelinux.0

And per the notes: * Since the host boots into syslinux386/pxelinux.0 , the TFTP root dir will be set to /var/lib/tftpboot/syslinux386 . So all paths need to be relative to this path. This is why all paths need to be prefixed with “…/”

So this is mnu that define the location of the mboot.c32 and the cfg file both location inside …/boot/ESXi##

DEFAULT ESXi
NOHALT 1
LABEL ESXi
KERNEL …/boot/ESXi-6.7.0-8169922/mboot.c32
APPEND -c …/boot-ESXi-6.7.0-8169922.cfg
IPAPPEND 2

Therefore when I create a symbolic link say:
/var/lib/tftpboot/boot/ESXi-6.7 pointing to /mnt/nfs/ESXi-6.7

So during pxeboot …/boot/ESXi-6.7/mboot.c32 which technically translate to /var/lib/tftpboot/boot/ESXi-6.7 is not seeing the content of /mnt/nfs/ESXi-6.7

The only way I can think if getting around this is moving the entire tftpboot inside /mnt/nfs and make it this the new tftproot…

I would think using the vmware tools available for doing deployments would be the best and easiest route. Autodeploy is a really cool thing to use for putting up many esxi servers at a time. Use the right tool for the job, and save yourself from burnout. Here’s a good article: https://www.driftar.ch/index.php/2016/11/19/vmware-configure-vsphere-auto-deploy/

TFTP indeed runs in a chroot environment, therefore absolute symlinks will never work.

Our blog article you refer to feel hacky, I haven’t tested this setup myself. If it can be improved in any way I would love to do it. The cleanest solution I can think of is probably deploying a separate TFTP server with TFTP proxy and changing its whole root to directory with VMWare boot files. However only one TFTP server can be used per subnet, this is quite limiting. Other option is simply to downgrade to PXELinux provided by VMWare, it’s some kind of old version with customization - I am not sure how well it can work with regular hosts.

Thanks for response…

When you said one TFTP Proxy can be used per subnet - you mean a independent TFTP server or another SmartPRoxy with only TFTP enabled?

That brings another questions. Currently I have an all in one foreman setup, started looking into the subnet section. Is single Foreman capable of deploying to several subnets as long they are routable??

Before this, I had my own TFPT/PXE solution to deploy VMs for development purposes. The only way I was able to handle deploying to other subnet was adding a network device to that subnet. I would have 1 network device connected to every subnet I wanted to deploy. This is limited to the vlans configured in the vCenter.

Is single Foreman capable of deploying to several subnets as long they are routable??

Yes. I have 472 subnets in our Foreman instance.

We also do ESX deployments through Foreman, so I would be happy to try and assist you.

1 Like

Jeff, That is awesome thanks for response… I am excited you can do that with Foreman. I developed my own PXE/TFTP solution which depends on vRO to build the VMs, Generate the KS, upload KS to PXE and boot the VMs… I am tired of rewriting the workflows every time there is an upgrade. I wish I’ve found Foreman earlier…

Back to multi subnet topic, I am interested to see how you have your current configuration setup. From Foreman/ Infrastructure/Subnet:

  • Does all the subnet have to be routable L3 meaning dns and internet access?
  • Can the subnet be L2 only with access to Foreman only?
  • So you have only 1 foreman / smart proxy combo handling all that?
  • Is your setup able to deploy all different flavours of Linux/Windows you already mentioned ESXI.

Any any reference documents, blogs you found useful or pointers that might help me get started would be great.

Thanks…

The other Feature i am interested is the Discovery. Following the https://www.theforeman.org/plugins/foreman_discovery/15.0/index.html
but not feel like something is missing. I did steps 1-4 and kinda stuck.

Please create a new thread for this.

Does all the subnet have to be routable L3 meaning dns and internet access?

DNS no, not unless you are having Foreman manage the DNS entries.
Internet access no, unless you have calls to WAN in your scripts afterwards.

Can the subnet be L2 only with access to Foreman only?

Yes, we have dark labs here with that access.

So you have only 1 foreman / smart proxy combo handling all that?

Yes. Around 450 racks, each rack has its own subnet/vlan.

Is your setup able to deploy all different flavours of Linux/Windows you already mentioned ESXI.

Yes. We deploy:

  • Windows 2012, 2016, 2019
  • RHEL, CentOS, Ubuntu, Fedora, SUSE
  • ESXi
  • FreeBSD
  • CoreOS
  • Internal Custom OS

Here is a sample of a few of the hundred. Some have 200 nodes, others none at all, but are all set up and ready to go should a team or user need them.

In regards to Discovery, as lzap states, please use another thread.

Thanks Jeff, This is good stuff. Do you use Foreman with Katello??

I will start a separate thread for discovery.

Thanks guys…

We do not use Ketello, no.