Provisioning guide

I'm new to Foreman and trying to determine if it can do what I need. I
have a cluster of physical machines. I need to provision a basic OS
(CentOS 7) to them then have Salt take over and configure everything. I'm
using xCAT but I'm not happy with it and looking to replace it. However,
with Foreman I'm stuck on step 1: I can't figure out provisioning.

I've read the documentation and it's not clear at all what the steps are to
doing this. I create an OS, install media, and everything else I found by
randomly clicking around the interface. No surprise, it doesn't work.

Is there a provisioning guide that outline the steps needed? Can anyone
shed light on how to do this? Can Foreman even provision a stateless node
or am I stuck with kickstart and such to a disk?

Hey Jeff,

Yes I will agree with you, Foreman's documentation is not very clear and I
also spent a bit of time trying to figure stuff out. What version of
Foreman did you install? If you installed Foreman properly, all the
provisioning, partition templates should already be there. The installation
Media would already be pointing to the correct repos to get the OS install.

Can you send me a screen shot of what error you are getting? Also you have
to make sure that the partition, provisioning templates are "associated"
with CentOS (in your case) so that they are available when you are doing
the provisioning.

··· On Friday, February 5, 2016 at 11:47:59 AM UTC-8, Jeff White wrote: > > I'm new to Foreman and trying to determine if it can do what I need. I > have a cluster of physical machines. I need to provision a basic OS > (CentOS 7) to them then have Salt take over and configure everything. I'm > using xCAT but I'm not happy with it and looking to replace it. However, > with Foreman I'm stuck on step 1: I can't figure out provisioning. > > I've read the documentation and it's not clear at all what the steps are > to doing this. I create an OS, install media, and everything else I found > by randomly clicking around the interface. No surprise, it doesn't work. > > Is there a provisioning guide that outline the steps needed? Can anyone > shed light on how to do this? Can Foreman even provision a stateless node > or am I stuck with kickstart and such to a disk? >

Well, I've gotten further already. I am past the "no partition table"
issue. Now I have a host defined and when it boots it gets an address from
DHCP then fails to boot with:

Trying to load: pxelinux.cfg/01-00-50-56-A5-39-74
Could not find kernel image: boot/kamiak_compute_centos-7-x86_64-vmlinuz

Shouldn't Foreman create that automatically? Why wouldn't it? The file
exists but is empty:

ls -l /var/lib/tftpboot/boot

total 0
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04
CentOS-7.2-x86_64-initrd.img
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04
CentOS-7.2-x86_64-vmlinuz
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42
kamiak_compute_centos-7-x86_64-initrd.img
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42
kamiak_compute_centos-7-x86_64-vmlinuz

··· On Friday, February 5, 2016 at 11:47:59 AM UTC-8, Jeff White wrote: > > I'm new to Foreman and trying to determine if it can do what I need. I > have a cluster of physical machines. I need to provision a basic OS > (CentOS 7) to them then have Salt take over and configure everything. I'm > using xCAT but I'm not happy with it and looking to replace it. However, > with Foreman I'm stuck on step 1: I can't figure out provisioning. > > I've read the documentation and it's not clear at all what the steps are > to doing this. I create an OS, install media, and everything else I found > by randomly clicking around the interface. No surprise, it doesn't work. > > Is there a provisioning guide that outline the steps needed? Can anyone > shed light on how to do this? Can Foreman even provision a stateless node > or am I stuck with kickstart and such to a disk? >

Hi Jeff,

> I've read the documentation and it's not clear at all what the steps are to
> doing this. I create an OS, install media, and everything else I found by
> randomly clicking around the interface. No surprise, it doesn't work.

By 'it doesn't work' you mean you get an error, you don't get the OS
provisioning at all, it's provisioned but Salt doesn't run…?

> Is there a provisioning guide that outline the steps needed? Can anyone
> shed light on how to do this? Can Foreman even provision a stateless node
> or am I stuck with kickstart and such to a disk?

I'll try to outline what you need:

Are you provisioning on some cloud or your own virtualization solution
(vmware/libvirt, etc…)? Do you want to provision from PXE or from an
image?

Normally this are the steps you would follow to create a host in foreman:

  • Create an OS, associate it with an installation media and
    provisioning templates. If it's CentOS 7, just associate it with the
    default Kickstart PXE, Kickstart user-data, etc…

  • Click on Hosts/new host

  • Choose where to deploy it (Bare metal/virtualization solution…)

  • Choose an OS

  • Click on Submit

After that Foreman will:

  • Send a request to the smart-proxy to pull the PXE templates if needed.
  • Create a DNS/DHCP reservation for the host if needed
  • Turn on the host / create the virtual machine

When the host boots it will:

  • Fetch PXE stuff to start the installation process
  • The installation process will contact Foreman to fetch the intial kickstart
  • CentOS 7 will get installed automatically according to the kickstart
  • Run a 'finish' kickstart which will setup Salt, etc… and inform
    Foreman that the host is built.
  • Reboot

At this point you should have a provisioned CentOS7 host. If you didn't
have PXE enabled and you decided to provision from an image, Foreman will run
an SSH script after the host is built to configure it instead of
downloading the OS.

There are fancier ways of provisioning hosts in Foreman but this is the
most basic.

Let me know if that helped, or at least at which step through this
process you're stuck on. Thanks for trying it out and contacting us for
help!

··· On 02/05, Jeff White wrote:


Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato

>
> Hi Jeff,
>
> > I've read the documentation and it's not clear at all what the steps are
> to
> > doing this. I create an OS, install media, and everything else I found
> by
> > randomly clicking around the interface. No surprise, it doesn't work.
>
> By 'it doesn't work' you mean you get an error, you don't get the OS
> provisioning at all, it's provisioned but Salt doesn't run…?
>

At the moment I can't even define a host. In an earlier attempt I was able
to get further but the node still failed to boot saying it could not find
its kernel image and I couldn't find anything on how to generate that.

> Is there a provisioning guide that outline the steps needed? Can anyone
> > shed light on how to do this? Can Foreman even provision a stateless
> node
> > or am I stuck with kickstart and such to a disk?
>
> I'll try to outline what you need:
>
> * Foreman (seems like you have this one already)
> * Smart-proxy for TFTP/DNS/DHCP/Salt and foreman_salt plugin
> - if you don't have it, install it using
> Foreman :: Plugin documentation index
>

The salt plugin is installed already. I'm not concerned with Salt at the
moment, that's for later.

>
> Are you provisioning on some cloud or your own virtualization solution
> (vmware/libvirt, etc…)? Do you want to provision from PXE or from an
> image?
>

My test box is a VMware VM which I boot the same way the production
physical boxes will: PXE. I don't understand the second question. In any
of the cluster management tools I've used you need to create an "image"
then set nodes to PXE off of it. If you are talking about something like a
VMware template, no not that. I have a CentOS ISO, a box running Foreman,
and a few dozen physical machines waiting for an OS, nothing else.

>
> Normally this are the steps you would follow to create a host in foreman:
> * Create an OS, associate it with an installation media and
> provisioning templates. If it's CentOS 7, just associate it with the
> default Kickstart PXE, Kickstart user-data, etc…
>
> * Click on Hosts/new host
> * Choose where to deploy it (Bare metal/virtualization solution…)
> * Choose an OS
> * Click on Submit
>

Where I'm currently stuck is when defining a new host is makes me pick a
partition table and there is nothing to select in the drop down. In fact,
the box is unclickable. I see a bunch of partition tables are defined
under "Hosts –> Partition tables", why can't I select one of them?

>
> After that Foreman will:
> * Send a request to the smart-proxy to pull the PXE templates if needed.
> * Create a DNS/DHCP reservation for the host if needed
> * Turn on the host / create the virtual machine
>
> When the host boots it will:
> * Fetch PXE stuff to start the installation process
> * The installation process will contact Foreman to fetch the intial
> kickstart
> * CentOS 7 will get installed automatically according to the kickstart
> * Run a 'finish' kickstart which will setup Salt, etc… and inform
> Foreman that the host is built.
> * Reboot
>
> At this point you should have a provisioned CentOS7 host. If you didn't
> have PXE enabled and you decided to provision from an image, Foreman will
> run
> an SSH script after the host is built to configure it instead of
> downloading the OS.
>
> There are fancier ways of provisioning hosts in Foreman but this is the
> most basic.
>
> Let me know if that helped, or at least at which step through this
> process you're stuck on. Thanks for trying it out and contacting us for
> help!
>

I'll re-ask one of my questions in case someone has an answer: Can Foreman
provision stateless (sometimes incorrectly called "diskless") nodes or can
it only install to a disk with bare metal provisioning?

··· On Friday, February 5, 2016 at 12:50:08 PM UTC-8, Daniel Lobato wrote: > On 02/05, Jeff White wrote:


Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: elobato (Daniel Lobato Garcia) | Keybase

Hey Jeff,

Can you print out what the /var/lib/tftpboot/pxelinux.cfg/01-00-50-…
file has?

I suspect it is not pointing to the correct spot. Also Daniel Bato
suggested to me something that helped the procedure a tons and that is
Foreman Discovery Plugin. It is very simple to setup and basically what it
does is, register itself to Foreman, then from the GUI you can provision
newly discovered hosts. I believe this is the documentation I used but I
did write my own so if you'd like I can send that to your via e-mail.

http://theforeman.org/plugins/foreman_discovery/2.0/

··· On Friday, February 5, 2016 at 1:47:59 PM UTC-8, Jeff White wrote: > > > Well, I've gotten further already. I am past the "no partition table" > issue. Now I have a host defined and when it boots it gets an address from > DHCP then fails to boot with: > > Trying to load: pxelinux.cfg/01-00-50-56-A5-39-74 > Could not find kernel image: boot/kamiak_compute_centos-7-x86_64-vmlinuz > > Shouldn't Foreman create that automatically? Why wouldn't it? The file > exists but is empty: > > # ls -l /var/lib/tftpboot/boot > total 0 > -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04 > CentOS-7.2-x86_64-initrd.img > -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04 > CentOS-7.2-x86_64-vmlinuz > -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42 > kamiak_compute_centos-7-x86_64-initrd.img > -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42 > kamiak_compute_centos-7-x86_64-vmlinuz > > > On Friday, February 5, 2016 at 11:47:59 AM UTC-8, Jeff White wrote: >> >> I'm new to Foreman and trying to determine if it can do what I need. I >> have a cluster of physical machines. I need to provision a basic OS >> (CentOS 7) to them then have Salt take over and configure everything. I'm >> using xCAT but I'm not happy with it and looking to replace it. However, >> with Foreman I'm stuck on step 1: I can't figure out provisioning. >> >> I've read the documentation and it's not clear at all what the steps are >> to doing this. I create an OS, install media, and everything else I found >> by randomly clicking around the interface. No surprise, it doesn't work. >> >> Is there a provisioning guide that outline the steps needed? Can anyone >> shed light on how to do this? Can Foreman even provision a stateless node >> or am I stuck with kickstart and such to a disk? >> >

That file has:

··· # # This file was deployed via 'Preseed default PXELinux' template # # Supported host/hostgroup parameters: # # blacklist = module1, module2 # Blacklisted kernel modules # # lang = en_US # System locale #

DEFAULT linux

LABEL linux
KERNEL boot/kamiak_compute_centos-7-x86_64-vmlinuz
APPEND initrd=boot/kamiak_compute_centos-7-x86_64-initrd.img
interface=auto
url=http://foreman-p1n01.mgmt.kamiak.example.edu:80/unattended/provision?token=174168af-1e52-4e0c-924d-9a2d52f7ac73
ramdisk_size=10800 root=/dev/rd/0 rw auto
hostname=cn0.mgmt.kamiak.example.edu console-setup/ask_detect=false
console-setup/layout=USA console-setup/variant=USA
keyboard-configuration/layoutcode=us
localechooser/translation/warn-light=true
localechooser/translation/warn-severe=true locale=en_US
IPAPPEND 2

On Friday, February 5, 2016 at 2:48:01 PM UTC-8, Joey Jojo wrote:

Hey Jeff,

Can you print out what the /var/lib/tftpboot/pxelinux.cfg/01-00-50-…
file has?

I suspect it is not pointing to the correct spot. Also Daniel Bato
suggested to me something that helped the procedure a tons and that is
Foreman Discovery Plugin. It is very simple to setup and basically what it
does is, register itself to Foreman, then from the GUI you can provision
newly discovered hosts. I believe this is the documentation I used but I
did write my own so if you’d like I can send that to your via e-mail.

http://theforeman.org/plugins/foreman_discovery/2.0/

On Friday, February 5, 2016 at 1:47:59 PM UTC-8, Jeff White wrote:

Well, I’ve gotten further already. I am past the “no partition table”
issue. Now I have a host defined and when it boots it gets an address from
DHCP then fails to boot with:

Trying to load: pxelinux.cfg/01-00-50-56-A5-39-74
Could not find kernel image: boot/kamiak_compute_centos-7-x86_64-vmlinuz

Shouldn’t Foreman create that automatically? Why wouldn’t it? The file
exists but is empty:

ls -l /var/lib/tftpboot/boot

total 0
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04
CentOS-7.2-x86_64-initrd.img
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04
CentOS-7.2-x86_64-vmlinuz
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42
kamiak_compute_centos-7-x86_64-initrd.img
-rw-r–r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42
kamiak_compute_centos-7-x86_64-vmlinuz

On Friday, February 5, 2016 at 11:47:59 AM UTC-8, Jeff White wrote:

I’m new to Foreman and trying to determine if it can do what I need. I
have a cluster of physical machines. I need to provision a basic OS
(CentOS 7) to them then have Salt take over and configure everything. I’m
using xCAT but I’m not happy with it and looking to replace it. However,
with Foreman I’m stuck on step 1: I can’t figure out provisioning.

I’ve read the documentation and it’s not clear at all what the steps are
to doing this. I create an OS, install media, and everything else I found
by randomly clicking around the interface. No surprise, it doesn’t work.

Is there a provisioning guide that outline the steps needed? Can anyone
shed light on how to do this? Can Foreman even provision a stateless node
or am I stuck with kickstart and such to a disk?

ok, now, can you confirm that the the centos-**** files that it is asking
for, both *.img and vmlinuz are in /var/lib/tftpboot/boot/ ??
even when you get this configured and it won't take long, you really should
install the discovery plugin Jeff, it will save you time :slight_smile:

··· On Friday, February 5, 2016 at 3:20:11 PM UTC-8, Jeff White wrote: > > That file has: > > # > # This file was deployed via 'Preseed default PXELinux' template > # > # Supported host/hostgroup parameters: > # > # blacklist = module1, module2 > # Blacklisted kernel modules > # > # lang = en_US > # System locale > # > > DEFAULT linux > > LABEL linux > KERNEL boot/kamiak_compute_centos-7-x86_64-vmlinuz > APPEND initrd=boot/kamiak_compute_centos-7-x86_64-initrd.img > interface=auto url= > http://foreman-p1n01.mgmt.kamiak.example.edu:80/unattended/provision?token=174168af-1e52-4e0c-924d-9a2d52f7ac73 > ramdisk_size=10800 root=/dev/rd/0 rw auto hostname= > cn0.mgmt.kamiak.example.edu console-setup/ask_detect=false > console-setup/layout=USA console-setup/variant=USA > keyboard-configuration/layoutcode=us > localechooser/translation/warn-light=true > localechooser/translation/warn-severe=true locale=en_US > IPAPPEND 2 > > > On Friday, February 5, 2016 at 2:48:01 PM UTC-8, Joey Jojo wrote: >> >> Hey Jeff, >> >> Can you print out what the /var/lib/tftpboot/pxelinux.cfg/01-00-50-..... >> file has? >> >> I suspect it is not pointing to the correct spot. Also Daniel Bato >> suggested to me something that helped the procedure a tons and that is >> Foreman Discovery Plugin. It is very simple to setup and basically what it >> does is, register itself to Foreman, then from the GUI you can provision >> newly discovered hosts. I believe this is the documentation I used but I >> did write my own so if you'd like I can send that to your via e-mail. >> >> http://theforeman.org/plugins/foreman_discovery/2.0/ >> >> On Friday, February 5, 2016 at 1:47:59 PM UTC-8, Jeff White wrote: >>> >>> >>> Well, I've gotten further already. I am past the "no partition table" >>> issue. Now I have a host defined and when it boots it gets an address from >>> DHCP then fails to boot with: >>> >>> Trying to load: pxelinux.cfg/01-00-50-56-A5-39-74 >>> Could not find kernel image: boot/kamiak_compute_centos-7-x86_64-vmlinuz >>> >>> Shouldn't Foreman create that automatically? Why wouldn't it? The file >>> exists but is empty: >>> >>> # ls -l /var/lib/tftpboot/boot >>> total 0 >>> -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04 >>> CentOS-7.2-x86_64-initrd.img >>> -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 1 15:04 >>> CentOS-7.2-x86_64-vmlinuz >>> -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42 >>> kamiak_compute_centos-7-x86_64-initrd.img >>> -rw-r--r-- 1 foreman-proxy foreman-proxy 0 Feb 5 13:42 >>> kamiak_compute_centos-7-x86_64-vmlinuz >>> >>> >>> On Friday, February 5, 2016 at 11:47:59 AM UTC-8, Jeff White wrote: >>>> >>>> I'm new to Foreman and trying to determine if it can do what I need. I >>>> have a cluster of physical machines. I need to provision a basic OS >>>> (CentOS 7) to them then have Salt take over and configure everything. I'm >>>> using xCAT but I'm not happy with it and looking to replace it. However, >>>> with Foreman I'm stuck on step 1: I can't figure out provisioning. >>>> >>>> I've read the documentation and it's not clear at all what the steps >>>> are to doing this. I create an OS, install media, and everything else I >>>> found by randomly clicking around the interface. No surprise, it doesn't >>>> work. >>>> >>>> Is there a provisioning guide that outline the steps needed? Can >>>> anyone shed light on how to do this? Can Foreman even provision a >>>> stateless node or am I stuck with kickstart and such to a disk? >>>> >>>

If the kernel and initrd files on the TFTP server are zero length, it's
because the proxy couldn't download them from the specified mirror. Double
check the mirror is correct, and accessible from the proxy, then delete the
broken files and try again.

Hey Jeff,
As described in the lzap’s thread, Satellite documentation team is now working on the effort to bring Satellite guides upstream.
You can find the Provisioning guide here:
http://docs.theforeman.org/guides/build/doc-Provisioning_Guide/index-foreman.html

1 Like

Hi Jeff, have you ever figured out how to boot Stateless Nodes?