PXE-less boot with predefined host

Hello,

We have several network segments, all with DHCP but only some with PXE. So
I'm trying to use VMware Orchestrator to standardize and automate our Linux
deploy process. Here is a workflow I'm trying to create:

  1. Create a new Host in foreman (satellite 6.1 in my case) with all the
    information (IP, puppet classes, lifecycle env, etc…) via API or hammer

  2. Create the VM at the appropriate location and mount the
    foreman-discovery-image
    <https://github.com/theforeman/foreman-discovery-image> (Custom ISO already
    has it set to DHCP)
    – This part works fine , I am able to see the host under
    discovered_hosts

  3. Power on the VM and let ISO boot and let it start building the host
    based on predefined Host, (Since MAC address would match)

From all my testing right now this doesn't seem to be possible. I know
about the discovery rules and they work fine, however I can't assign all
the parameters that I am able to when I create the host like (IP, puppet
classes).

It seems like , with discovery rule it would build a static host create all
the time, then I would have to go add additional puppet classes after
creation via API or Hammer?

Any help would be appreciated.

Thank you

Hello,

> (Custom ISO already has it set to DHCP)

can you elaborate this? Is this custom image with DHCP? Why do you use
custom image in the first place? What are the parameters you've used for
discovery-remaster script?

> 3. Power on the VM and let ISO boot and let it start building the host
> based on predefined Host, (Since MAC address would match)
>
> From all my testing right now this doesn't seem to be possible. I know
> about the discovery rules and they work fine, however I can't assign all
> the parameters that I am able to when I create the host like (IP, puppet
> classes).
>
> It seems like , with discovery rule it would build a static host create all
> the time, then I would have to go add additional puppet classes after
> creation via API or Hammer?

I don't understand what are you trying to achieve. You want to use fdi
to boot into Anaconda without PXE directly?

Discovery plugin works the opposite way - you don't create records in
Foreman prior booting the hosts (or VMs). Discovery plugin is able (with
or without discovery rules) to create the Foreman host for you from your
discovered hosts.

If you want to create hosts first and boot into Anaconda without PXE,
then I'd recommend Foreman Bootdisk plugin (ships with Satellite as
well). You need to use Full host image and not Host image because
VmWare network drivers are broken and does not play well with iPXE used
in Host images (Full Host image leverages SYSLINUX instead and there is
no PXE involved as they contain Anaconda init RAM disk).

Workflow:

  1. Create a host
  2. Download the Full Host image (CLI/API available for this)
  3. Attach the ISO to the VM
  4. Start (boots into Anaconda)

Alternatively, you can also chainboot VMs via HTTP directly without PXE
or attached ISO file. For this, you need to modify PXE firmware of your
VmWare VMs. This perhaps breaks your VmWare "warranty", but it should
work just fine:

Another alternative is to automate bootdisk attaching via Foreman Hooks
plugin. This is a WIP of one of my colleagues:

https://github.com/hjensas/bootdisk_hook

With this, you can one-click hosts from Foreman directly via Compute
Resource.

··· -- Later, Lukas #lzap Zapletal

we were kinda following insturctuions from here: https://access.redhat.com/blogs/1169563/posts/2090011
related to Unattended usage

used this to reimage:

discovery-remaster foreman-discovery-image-3.0.5-3.iso
"proxy.url=https://<satellite>:9090 proxy.type=proxy fdi.pxauto=1"

Anyways,

Your suggestion of using Bootdisk, was exactly what I was looking for.

Thank you very very much for your help.

Kevin

··· On Monday, February 29, 2016 at 6:28:04 AM UTC-5, Lukas Zapletal wrote: > > Hello, > > > (Custom ISO already has it set to DHCP) > > can you elaborate this? Is this custom image with DHCP? Why do you use > custom image in the first place? What are the parameters you've used for > discovery-remaster script? > > > 3. Power on the VM and let ISO boot and let it start building the host > > based on predefined Host, (Since MAC address would match) > > > > From all my testing right now this doesn't seem to be possible. I know > > about the discovery rules and they work fine, however I can't assign all > > the parameters that I am able to when I create the host like (IP, puppet > > classes). > > > > It seems like , with discovery rule it would build a static host create > all > > the time, then I would have to go add additional puppet classes after > > creation via API or Hammer? > > I don't understand what are you trying to achieve. You want to use fdi > to boot into Anaconda without PXE directly? > > Discovery plugin works the opposite way - you don't create records in > Foreman prior booting the hosts (or VMs). Discovery plugin is able (with > or without discovery rules) to create the Foreman host for you from your > discovered hosts. > > If you want to create hosts first and boot into Anaconda without PXE, > then I'd recommend Foreman Bootdisk plugin (ships with Satellite as > well). You need to use *Full host image* and not Host image because > VmWare network drivers are broken and does not play well with iPXE used > in Host images (Full Host image leverages SYSLINUX instead and there is > no PXE involved as they contain Anaconda init RAM disk). > > Workflow: > > 1) Create a host > 2) Download the Full Host image (CLI/API available for this) > 3) Attach the ISO to the VM > 4) Start (boots into Anaconda) > > Alternatively, you can also chainboot VMs via HTTP directly without PXE > or attached ISO file. For this, you need to modify PXE firmware of your > VmWare VMs. This perhaps breaks your VmWare "warranty", but it should > work just fine: > > > http://projects.theforeman.org/projects/foreman/wiki/Fetch_boot_files_via_http_instead_of_TFTP#C-Chainbooting-virtual-machines > > http://ipxe.org/howto/vmware > > Another alternative is to automate bootdisk attaching via Foreman Hooks > plugin. This is a WIP of one of my colleagues: > > https://github.com/hjensas/bootdisk_hook > > With this, you can one-click hosts from Foreman directly via Compute > Resource. > > -- > Later, > Lukas #lzap Zapletal >