Deploy a Custom Image Using iPXE

iPXE is a free open-source network boot firmware that provides a flexible and extensible framework for booting operating systems over a network. It provides a full PXE implementation enhanced with additional features.

You have a valid public URL storing your iPXE script.

You can use iPXE scripts to deploy your custom image. An iPXE script is essentially a set of instructions that are used to specify the boot process and configure network parameters. iPXE scripts can include commands for tasks such as obtaining an IP address, configuring network settings, loading specific boot images, and more.

Here is an example of an iPXE script:

#!ipxe

# Download Ubuntu 20.04 ISO image
kernel http://path/to/ubuntu-20.04-netboot/vmlinuz
initrd http://path/to/ubuntu-20.04-netboot/initrd
boot

:install
set base-url http://path/to/ubuntu-20.04-netboot/

# Launch Ubuntu setup
kernel ${base-url}linux auto=true hostname=${hostname} domain=${domain} url=${preseed/url} locale=${locale} console-setup/layoutcode=us keyboard-configuration/layoutcode=us file=/cdrom/preseed/ubuntu-server.seed initrd=initrd.gz quiet ---
initrd ${base-url}initrd.gz
boot

You temporarily have no public URL.

You can refer to netboot.xyz to finish the OS installation. netboot.xyz provides a user friendly menu that lets you easily choose the operating system you want along with any specific types of versions or bootable flags.

Procedures

Deploying a Custom Image

See Create a Bare Metal Instance for detailed steps of how to create an instance, and in operating system selecting, choose Custom OS while creating an instance.

  • Install via iPXE URL: enter your public URL storing your iPXE script.

  • Install via netboot.xyz: you don't need to prepare your iPXE script.

Follow the other steps to finish instance creation.

Note

After deploying with a custom OS,

  • You cannot create partitions or label your hostname.

  • You can only have the customized password. Remember your password to log in to IPMI console afterwards.

  • Your instance will show from Creating to Installing, and to Powered On state. That doesn't mean your image has finished installing. You will need to remote access the instance to configure on the system.

What to Do Next

  1. Go to instance Details > OS&IPMI > Log in to IPMI Console.

  2. Log in to IPMI Console using the public username (operator) and your password.

  3. Select the configurations you need and finish the installation of your OS following the wizard.

  4. Back to Console and go to instance Details page, and click Reset IPs.

  5. After IP resetting, restart your instance.

Note

IP resetting may fail. Please try again. If IPs are successfully reset, you also need to check on your server to see whether your operations are effective.

Other Networking Operations

Because you have installed your OS using iPXE, all networking related operations, except for IP resetting, need to be manually configured on your instance system to take effect.

Here we take elastic IP adding as an example.

  1. Go to instance Details > Networking page and click Add Elastic IP.

  2. Select your desired elastic IP (23.90.160.73) to assign.

  3. Click Reset IPs.

  4. Remote access to your instance and execute the following commands.

sudo ip addr add 23.90.160.73/32 dev wan0

Note

You must first make IP Resetting on Console and then configure on your server to make your operations really take effect.

Last updated