Configure a custom iPXE script to boot your server from the OVHcloud API

Knowledge Base

Configure a custom iPXE script to boot your server from the OVHcloud API


Icons/System/eye-open Created with Sketch. 562 Views 27.02.2024 Cloud / Dedicated Server (bare metal)

Objective

This article is intended for experienced users who have at least basic knowledge about Preboot Execution Environment (PXE) and its implementation being used at OVHcloud: iPXE.

In the OVHcloud Control Panel, it is possible to specify a boot mode among a predefined list: primary disk or rescue.
With the OVHcloud API, you can define custom scripts.

Using a custom script can be useful in the following use cases:

  • You are using a volatile OS that you don't want to install on disk and that remains only in memory.
  • You have a multi-cloud strategy and one of the other cloud providers you use doesn't offer the OS you want to install, nor does it offer an alternative solution such as BringYourOwnImage.
  • You want a standard installation process whatever the cloud provider is, so you have built your own rescue installation image to fully manage the complete OS installation of your dedicated server.

Requirements

Restarting a dedicated server can cause outage of all services that only depend on this dedicated server.

Instructions

Generate an iPXE script for your dedicated server

Change server iPXE script

Specify your script within the bootScript attribute directly.

Get the server iPXE script

You can see your script within the bootScript attribute.

For example:

{
    "noIntervention": false,
    "name": "nsXXXXXXX.ip-XXX-XXX-XXX.eu",
    "rack": "SXXXBXX",
    "commercialRange": "fs",
    "os": "debian11_64",
    "rootDevice": null,
    "rescueMail": null,
    "linkSpeed": 1000,
    "bootScript": "#!ipxe\necho Boot first local hdd in LEGACY mode\nsanboot --no-describe --drive 0x80\nexit 1\n",
    "reverse": "nsXXXXXXX.ip-XXX-XXX-XXX.eu",
    "state": "ok",
    "ip": "XXX.XXX.XXX.XXX",
    "bootId": null,
    "newUpgradeSystem": false,
    "datacenter": "sbg3",
    "professionalUse": false,
    "supportLevel": "pro",
    "serverId": 123456,
    "powerState": "poweron",
    "monitoring": false
}

You can now reboot your server and it will use your iPXE to boot.

Changing boot modes

You can now switch back to disk or rescue boot from the OVHcloud Control Panel (see our guide on Activating and using rescue mode), or the OVHcloud API.

Switch to disk

Specify 1 in the bootId attribute.

You can now see that the attribute value bootScript is null.

Go further

Restarting your dedicated server

Activating and using rescue mode

iPXE - open source boot firmware

Join our community of users.

Related articles