Add documentation to boot discovery image through iPXE
This procedure describes the required steps to get a discovery image generated by AI booting on an AWS EC2 instance.
+We can boot the image using two different processes:
+* Network boot using an iPXE ami
+* installing a CentOS instance and configuring GRUB
+
+## Network boot with iPXE
+We will download the discovery iso, copy the required files to a webserver and then launch a new instance using an iPXE AMI image
+
+### Steps
+1. Generate the iso (full) on the AI UI
+2. Run the following commands to download the ISO and extract the files
+ ```
+ sudo mkdir -p /var/tmp/discovery-files
+
+ # Download ISO
+ wget -O /var/tmp/discovery-image.iso 'https://<long s3 url provided by AI SaaS>'
+
+ # Mount ISO image to extract files
+ sudo mount -o loop /var/tmp/discovery-image.iso /mnt
+
+ # Copy needed files
+ sudo cp -v /mnt/images/pxeboot/* /var/tmp/discovery-files
+ gzip -dc /mnt/images/ignition.img | sudo cpio -ivD /var/tmp/discovery-files
+
+ # Umount ISO
+ sudo umount /mnt
+ ```
+
+3. Copy the files to a webserver. In this example we will install a webserver in the same host
+ ```
+ # Install nginx
+ sudo dnf install -y nginx
+ sudo sed -i 's%/usr/share/nginx/html%/var/www%g' /etc/nginx/nginx.conf
+ sudo systemctl start nginx
+
+ # Copy files to webserver
+ sudo cp -vr /var/tmp/discovery-files /var/www
+
+ # Update selinux security context if needed
+ sudo chcon -Rt httpd_sys_content_t /var/www/discovery-files
+ ```
+
+4. Create a new AWS EC2 instance
+ Note that we need to set the webserver IP address or domain name in the second line of the user data
+ - find and select the AMI `iPXE 1.21.1 (gfa012) (x86_64)`
+ - In the section `Configure Instance Details`, in `Advanced Details` we will set the following `User data`:
+ ```
+ #!ipxe
+ set web http://<IP-OF-WEBSERVER>/discovery-files
+ kernel ${web}/vmlinuz coreos.live.rootfs_url=${web}/rootfs.img ignition.config.url=${web}/config.ign ignition.firstboot ignition.platform.id=metal ip=dhcp
+ initrd ${web}/initrd.img
+ boot
+ ```
+
+5. The new instance will boot the discovery image
+
+## Installing CentOS and configuring GRUB
We will get the discovery image downloaded in a CentOS 8 instance and GRUB will be configured to load the discovery image on next boot.
-## Steps
+### Steps
1. Generate the iso (small - for virtual media) on the AI UI.
2. Run an EC2 instance using a CentOS 8 AMI.
@@ -49,6 +105,4 @@ We will get the discovery image downloaded in a CentOS 8 instance and GRUB will
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo reboot
~~~
-5. Instance will be rebooted and will boot the discovery image.
-
-
\ No newline at end of file
+6. Instance will be rebooted and will boot the discovery image.
