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.
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 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 Bring Your Own Image.
- 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
- a dedicated server ready to be booted/rebooted in your OVHcloud account
- access to the OVHcloud API
Instructions
Generate an iPXE script for your dedicated server
Change server iPXE script
PUT /dedicated/server/{serviceName}
Specify your script within the bootScript
attribute directly.
Get the server iPXE script
GET /dedicated/server/{serviceName}
You can see your script within the bootScript
attribute.
For example:
{ "noIntervention": false, "name": "nsXXXXXXX.ip-XXX-XXX-XXX.us", "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.us", "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
PUT /dedicated/server/{serviceName}
Specify 1
in the bootId
attribute.
GET /dedicated/server/{serviceName}
You can now see that the attribute value bootScript
is null.
Go further
iPXE - open source boot firmware
For more information and tutorials, please see our other Dedicated Servers support guides or explore the guides for other OVHcloud products and services.