Kickstart in Azure
Using Kickstart in Azure gives you a way to utilize all of your existing on-prem processes in the Cloud. However, you can't directly boot an ISO. Instead you need to convert it to a VHD. Here are the steps to convert the bootdisk Satellite creates in to a VHD that you can then use in Azure.
Convert the boot disk to a VHD
These tasks need to be completed on a Windows machine
Download the Boot disk from Satellite
- Launch a web browse and log in to your Satellite server
- Browse to the subnets section (Infrastructure -> Subnets)
- On the far right of one of your subnets, click the arrow down next to
Deleteand clickSubnet generic image
This image will contain the PXE information required to deploy any VM. If you use any Capsule servers, make sure you select a subnet that has the sameHTTPBoot Capsule. Even though the image is labeled subnet specific, the only information contained is the satellite/capsule server url.
Download GParted so we can clone the ISO to the "disk"
- Download GParted
Create the virtual "disk" that we'll later upload to Azure. This cannot be done while creating the VM because that will create a VHDX and Azure needs a VHD
- Launch Disk Management
This can be done by clicking start and typing indiskmgmt.msc. As you are typing it, you may seeCreate and format hard disk partitions. That is just a different name for the same application. Click on that ordiskmgmt.msc. - Select
Actionon the menu bar and then clickCreate VHD - Use
Browseto select a location to save the VHD - Enter
3MBas the size - Make sure that
VHDis selected. VHDX is not supported in Azure - Make sure the disk type is
Fixed size - Click OK
- Right click on the new disk and click
Detach VHD
- Launch Disk Management
Create a VM and clone the ISO to the "disk"
- Launch Hyper-V. If you don't have it installed, please follow these instructions
- Right click on your machine and click
New->Virtual Machine... - Click
Nextto get past theBefore your Beginpage - Give your VM a name
- Click
Next - Leave the Virtual machine set to
Generation 1 - Click
Next - Click
Nextwithout changing the memory - Click
Nextwithout setting a connection - Select
Use an existing virtual hard diskand select the VHD we created earlier - Click
Nextand thenFinish. It may take a little while for the VM to create - Right click on the new VM you created and select
Settings - Select the
DVD Driveand then select GParted ISO you downloaded earlier - Click on
IDE Controller 1, selectDVD Drive, and then clickAddto add a second DVD Drive - On the new
DVD Drive, select the boot disk you downloaded earlier from the Satellite server - Click
OK - Right click on the VM and click
Connect - Click
Start - Press
Enterto boot GParted with the default settings - Press
Enterto selectDon't touch keymap - Press
Enterto selectUS English - Press
2and thenEnterto selectEnter command line prompt - Run
lsblkand verify that you seesdawith a size of10Mandsr1.sr1is the second DVD drive which is where we mounted boot disk.sdais the first hard drive, which is where the VHD is mounted. If the drives are labeled differently for you, make sure to adjust the command in the next step. - Run
dd if=/dev/sr1 of=/dev/sda status=progressto copy the boot disk to the VHD. The command should complete quickly. - You can now shut down the VM by clicking
Actionin the menu bar and thenTurn Off... - Once the VM is off you can then upload the VHD to Azure using Add-AzVHD or AzCopy or Azure Storage Explorer
Configure Satellite to handle unknown hosts
Now that we have a VHD that can boot to Satellite, lets configure Satellite to know what to do with an unknown machine
Change the default boot option from
localtodiscoverydangerThis is a global setting. Any machines that PXE boot from the Satellite server without being registered to Satellite will boot in to discovery. Make sure that PXE is either removed from the boot order or is below the local disk. Machines that Satellite is aware of will exit PXE by default unless build mode is enabled for that host.
- Launch a web browse and log in to your Satellite server
- Go to Settings by hovering over
Administerand selectingSettings - Select the
Provisioningtab - Edit the value for
Default PXE global template entryand set it todiscovery - On the Satellite server, install foreman-discovery-image using
satellite-maintain packages install foreman-discovery-image - On the Satellite server, run
discovery-iso-to-pxe /usr/share/foreman-discovery-image/foreman-discovery-image-3.8.2-1.isoto convert the discovery ISO to PXE. The version of the ISO may change as new version of Satellite are released. Even though it will create a tftpboot directory in the current directory, it will copy the files you need in to the right location.
You can now use the uploaded VHD as your source image when creating a new VM. When the VM boots, it will request a DHCP lease, override the options related to PXE, PXE boot from the Satellite server, boot the discover image, and then it will wait for you to provision the host. Provisioning can be done from Hosts -> Discovered Hosts within the Satellite Web UI. Once the host is provisioned, the VM will reboot and start the installation. During the installation, it will format the disk and replace it with the selected OS. You can also automate the provisioning process using Discovery Rules