Use the Bare Metal Cloud (BMC) API to provision a server that boots from an iPXE script hosted at a publicly accessible URL. You can rerun the iPXE boot process, change the script URL ,and configure the native VLAN used during boot.
All API requests in this guide are relative to:
https://api.phoenixnap.com/bmc/v1Code language: HTTP (http)
Prerequisites
BMC API access token with the bmc scope (see API credentials). You will also need an iPXE boot script hosted at a publicly accessible URL (see Create iPXE boot script), and the required network configuration if you plan to use a public network or a specific native VLAN.
Deploy a Server Using iPXE
To deploy an iPXE instance, send a request to:
POST /serversCode language: HTTP (http)
See the following example:
{
"hostname": "iPXE-server",
"description": "Testing",
"location": "phx",
"os": "ipxe",
"osConfiguration": {
"iPXE": {
"url": "[SCRIPT_URL]"
}
},
"type": "s3.c3.medium"
}
Code language: JSON / JSON with Comments (json)
Set the os to ipxe and provide the script URL in osConfiguration.iPXE.url. Replace the example values with your server's hostname, description, location, script URL, and type.
Note
iPXE is not supported on all instance types and in all locations. Check the iPXE instance type limits and available locations.
Configure a Public Network
To provision a server with both public and private networking, set networkType to PUBLIC_AND_PRIVATE and provide the public network configuration in the request body:
{
"hostname": "[SERVER_NAME]",
"description": "[DESCRIPTION]",
"location": "[LOCATION]",
"os": "ipxe",
"osConfiguration": {
"iPXE": {
"url": "[SCRIPT_URL]"
}
},
"type": "[SERVER_TYPE]",
"networkType": "PUBLIC_AND_PRIVATE",
"networkConfiguration": {
"publicNetworkConfiguration": {
"publicNetworks": [
{
"id": "[NETWORK_ID]",
"ips": [
"[IP_ADDRESS]",
"[IP_ADDRESS]"
]
}
]
}
}
}
Code language: JSON / JSON with Comments (json)
Replace the placeholders with the appropriate values. Ensure the selected network and IP addresses are valid for the target server.
Find out more
Run iPXE Boot Process Again
To start the iPXE process again (e.g., if an iPXE deployment fails), re-trigger it with:
POST /servers/[SERVER_ID]/actions/rebootCode language: HTTP (http)
Replace [SERVER_ID] in the endpoint with the server's actual ID. Set the bootType to IPXE:
{
"bootType": "IPXE"
}Code language: JSON / JSON with Comments (json)
The server uses the iPXE URL supplied during provisioning by default.
Changing iPXE Script URL
To change the URL, include the ipxeURL field in the reboot request:
{
"bootType": "IPXE",
"ipxeUrl": "[SCRIPT_URL]"
}
Code language: JSON / JSON with Comments (json)
Replace the [SCRIPT_URL] with the address of the new script.
Find out more
Configure the iPXE Native VLANs
The native VLAN used to deliver iPXE is permanently available during the lifetime of an iPXE-deployed server, including after a different operating system is installed.
Server IP block allocations and public networks can both be used as native VLANs. Backend networks are not currently supported for this purpose.
To change the native VLAN configuration, send a request to:
PUT /servers/[SERVER_ID]/os-configuration/ipxeCode language: HTTP (http)
Replace [SERVER_ID] with the ID of the server. Provide the script URL and native VLAN settings in the request body:
{
"url": "[SCRIPT_URL]",
"nativeVlanConfiguration": {
"vlanId": [ID],
"staticDhcpAddressV4": "[IP_ADDRESS]"
}
}Code language: JSON / JSON with Comments (json)
Replace [SCRIPT_URL], [VLAN_ID], and [IP_ADDRESS] with the values for your server.
You can configure VLANs during server provisioning or after deployment, depending on the network requirements of the operating system or application.