// Module included in the following assemblies:
//
// * installing/installing_bare_metal/installing-bare-metal.adoc
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
// * installing/installing_platform_agnostic/installing-platform-agnostic.adoc

[id="installation-user-infra-machines-pxe_{context}"]
= Creating {op-system-first} machines by PXE or iPXE booting

Before you install a cluster that uses manually-provisioned {op-system} nodes, such as bare metal, you must create {op-system} machines for it to use. You can use PXE or iPXE booting to create the machines.

.Prerequisites

* Obtain the Ignition config files for your cluster.
* Configure suitable PXE or iPXE infrastructure.
* Have access to an HTTP server that you can access from your computer.

.Procedure

. Upload the master, worker, and bootstrap Ignition config files that the
installation program created to your HTTP server. Note the URLs of these files.
+
[IMPORTANT]
====
You can add or change configuration settings in your Ignition configs
before saving them to your HTTP server.
If you plan to add more compute machines to your cluster after you finish
installation, do not delete these files.
====

ifndef::openshift-origin[]
. Obtain the {op-system} `kernel`,
`initramfs` and `rootfs` files from the
link:https://access.redhat.com/downloads/content/290[Product Downloads] page on the Red
Hat customer portal or the
link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.7/[{op-system} image mirror]
page.
+
[IMPORTANT]
====
The {op-system} artifacts might not change with every release of {product-title}.
You must download artifacts with the highest version that is less than or equal
to the {product-title} version that you install. Only use
the appropriate `kernel`, `initramfs`, and `rootfs` artifacts described below
for this procedure.
{op-system} qcow2 images are not supported for this installation type.
====
+
The file names contain the {product-title} version number.
They resemble the following examples:

** `kernel`: `rhcos-<version>-live-kernel-<architecture>`
** `initramfs`: `rhcos-<version>-live-initramfs.<architecture>.img`
** `rootfs`: `rhcos-<version>-live-rootfs.<architecture>.img`
endif::openshift-origin[]
ifdef::openshift-origin[]
. Obtain the {op-system}  `kernel`, `initramfs` and `rootfs` files from the
link:https://getfedora.org/en/coreos/download?tab=metal_virtualized&stream=stable[{op-system} Downloads] page
endif::openshift-origin[]

. Upload the `rootfs`, `kernel`, and `initramfs` files
to your HTTP server.
+
[IMPORTANT]
====
If you plan to add more compute machines to your cluster after you finish
installation, do not delete these files.
====

. Configure the network boot infrastructure so that the machines boot from their
local disks after {op-system} is installed on them.

. Configure PXE or iPXE installation for the {op-system} images.
+
Modify one of the following example menu entries for your environment and verify
that the image and Ignition files are properly accessible:

** For PXE:
+
----
DEFAULT pxeboot
TIMEOUT 20
PROMPT 0
LABEL pxeboot
    KERNEL http://<HTTP_server>/rhcos-<version>-live-kernel-<architecture> <1>
    APPEND initrd=http://<HTTP_server>/rhcos-<version>-live-initramfs.<architecture>.img coreos.live.rootfs_url=http://<HTTP_server>/rhcos-<version>-live-rootfs.<architecture>.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://<HTTP_server>/bootstrap.ign <2> <3>
----
<1> Specify the location of the live `kernel` file that you uploaded to your HTTP
server.
The URL must be HTTP, TFTP, or FTP; HTTPS and NFS are not supported.
<2> If you use multiple NICs, specify a single interface in the `ip` option.
For example, to use DHCP on a NIC that is named `eno1`, set `ip=eno1:dhcp`.
<3> Specify locations of the {op-system} files that you uploaded to your
HTTP server. The `initrd` parameter value is the location of the `initramfs` file,
the `coreos.live.rootfs_url` parameter value is the location of the
`rootfs` file, and the `coreos.inst.ignition_url` parameter value is the
location of the bootstrap Ignition config file.
You can also add more kernel arguments to the `APPEND` line to configure networking
or other boot options.
+
[NOTE]
====
This configuration does not enable serial console access on machines with a graphical console.  To configure a different console, add one or more `console=` arguments to the `APPEND` line.  For example, add `console=tty0 console=ttyS0` to set the first PC serial port as the primary console and the graphical console as a secondary console.  For more information, see link:https://access.redhat.com/articles/7212[How does one set up a serial terminal and/or console in Red Hat Enterprise Linux?].
====

** For iPXE:
+
----
kernel http://<HTTP_server>/rhcos-<version>-live-kernel-<architecture> initrd=main coreos.live.rootfs_url=http://<HTTP_server>/rhcos-<version>-live-rootfs.<architecture>.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://<HTTP_server>/bootstrap.ign <1> <2>
initrd --name main http://<HTTP_server>/rhcos-<version>-live-initramfs.<architecture>.img <3>
boot
----
<1> Specify locations of the {op-system} files that you uploaded to your
HTTP server. The `kernel` parameter value is the location of the `kernel` file,
the `initrd=main` argument is needed for booting on UEFI systems,
the `coreos.live.rootfs_url` parameter value is the location of the `rootfs` file,
and the `coreos.inst.ignition_url` parameter value is the
location of the bootstrap Ignition config file.
<2> If you use multiple NICs, specify a single interface in the `ip` option.
For example, to use DHCP on a NIC that is named `eno1`, set `ip=eno1:dhcp`.
<3> Specify the location of the `initramfs` file that you uploaded to your HTTP server.
+
[NOTE]
====
This configuration does not enable serial console access on machines with a graphical console.  To configure a different console, add one or more `console=` arguments to the `kernel` line.  For example, add `console=tty0 console=ttyS0` to set the first PC serial port as the primary console and the graphical console as a secondary console.  For more information, see link:https://access.redhat.com/articles/7212[How does one set up a serial terminal and/or console in Red Hat Enterprise Linux?].
====
+
. Continue to create the machines for your cluster.
+
[IMPORTANT]
====
You must create the bootstrap and control plane machines at this time. If the
control plane machines are not made schedulable, which is the default, also
create at least two compute machines before you install the cluster.
====
