Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save benosman/e9cde12231b4bda05cc60179719eaef7 to your computer and use it in GitHub Desktop.
Save benosman/e9cde12231b4bda05cc60179719eaef7 to your computer and use it in GitHub Desktop.
OVH custom iPXE boot (dedicated server)

iPXE customer script (BETA)

Booting your server with your own iPXE script allows cool things like:

  • running diskless bare-metal system like CoreOS, SmartOS, ...
  • recovering with your own Rescue system or bare-metal restore tools (like Acronis and Idera)
  • launching Standard installer like ESXi, Linux, Solaris, ...

How ? Using directly the RESTful API EU|CA or the API console EU|CA.

It's also working for Kimsufi EU|CA and SoYouStart EU|CA.

1. Upload your custom iPXE script

CoreOS example (https://coreos.com/docs/running-coreos/bare-metal/booting-with-ipxe/)

POST /1.0/me/ipxeScript HTTP/1.1

{
  "description": "CoreOS stable",
  "name": "coreos",
  "script": "#!ipxe\n\nset base-url http://stable.release.core-os.net/amd64-usr/current\nkernel ${base-url}/coreos_production_pxe.vmlinuz sshkey=\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQC2PxAKTLdczK9+RNsGGPsz0eC2pBlydBEcrbI7LSfiN7Bo5hQQVjki+Xpnp8EEYKpzu6eakL8MJj3E28wT/vNklT1KyMZrXnVhtsmOtBKKG/++odpaavdW2/AU0l7RZiE= coreos pxe demo\"\ninitrd ${base-url}/coreos_production_pxe_image.cpio.gz\nboot"
}
HTTP/1.1 200 OK

2. Request your custom bootId

GET /1.0/dedicated/server/ns320309.ip-46-105-117.eu/boot?bootType=ipxeCustomerScript HTTP/1.1
HTTP/1.1 200 OK

[
  38
]

3. Configure your server to boot on your iPXE script

PUT /1.0/dedicated/server/ns320309.ip-46-105-117.eu HTTP/1.1

{
  "bootId": 38
}
HTTP/1.1 200 OK

4. Reboot your server !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment