OVHcloud API and Storage
Find out what the OVHcloud API provides in order to customise the disks, hardware/software RAID and partitioning configuration during the server OS reinstallation
Objective
This article is intended for experienced users with basic Linux knowledge, and more importantly, deeper technical knowledge of storage—particularly hardware and software RAID, as well as Logical Volume Management (LVM).
With OVHcloud Dedicated Servers, you can configure Disks, hardware RAID, Partitions, software RAID, LVM, ZFS, etc. during OS reinstallation from the as well as the . In this article, we will focus on the . This will give us more details about the engine that is running in the background in order to create the storage customisation on the dedicated server from the input data passed on to the OVHcloud API.
Providing in-depth details about storage configuration can help customers understand why:
- their custom storage configuration could not be applied on their dedicated server.
- the actual storage configuration on the dedicated server is slightly different from what the customer requested.
Requirements
- A dedicated server ready to be installed/reinstalled in your OVHcloud account.
- Access to the .
Reinstalling a dedicated server deletes all data currently stored on it.
Instructions
During the default OS installation, the user is interactively prompted by the OS installer (provided by the software editor) to specify on which disks the Operating System will be installed, the partitioning layout, etc. Once the OS is installed, it is possible to change the partitioning layout but it can be very tricky and risky, especially for partitions that are currently used by the system. For that reason, storage is a very important subject that needs to be considered before installing an Operating System.
Apart from the simplicity offered by an API, the main advantage is the possibility to fully customise the disks and partitions on which the OS will be installed.
In this page we are focusing only on the storage sub-hash of the API call used to reinstall an OS on a dedicated server. For other customisations not related to storage, please read OVHcloud API & OS installation for more details.
Disk Groups
Some dedicated servers have multiple groups of disks. For example, one group with SATA disks and another group with SSD disks. Those servers are sometimes also called hybrid servers.
To list the disk groups and their disks, you can use the following API call in order to identify the disk group on which you want the OS to be reinstalled:
Example reply:
In this example, there are 2 disk groups:
- the first one (diskGroupId=1) contains 2 x 480 GB disks. This is the default diskGroupId.
- the second one (diskGroupId=2) contains 2 x 1.9 TB disks.
Example of Debian 13 (Trixie) OS installation on the diskGroup 2:
By default, if no diskGroupId is specified or set to 0, the OS will be installed on default diskGroupId 1.
For the moment, the API only supports OS installation and storage customisation on 1 single disk group. From 1 up to all disks of the selected disk group can be involved in the storage customisation. Nevertheless, the remaining disks of that disk group will be erased. Disks belonging to the other disk groups are erased too by default, but their data can be kept: see Data erasure. Either way, all these disks will still be visible in the freshly new installed OS and can be used/configured afterwards for data.
Hardware RAID
This section only applies to servers that have at least one hardware RAID controller in one of their disk groups.
Server & Hardware RAID Compatibility
You can get this information by using the following API call:
If your server doesn't have any hardware RAID controller, it will return a HTTP 403 (Forbidden) with the following message:
Example of reply for a server with a hardware RAID controller:
You can also get this information by looking at the raidController attribute value from the API call described in the disk group section.
API & Hardware RAID
For the moment, the API only supports hardware RAID customisation for 1 single hardware RAID controller. If your server has multiple hardware RAID controllers whose configuration you want to customise, you can configure the controllers other than the one in the disk group targeted for OS reinstallation before the OS reinstallation (you can also do it after OS reinstallation is finished, but we recommend doing it before to avoid any risk of accidental data loss).
Example of OS installation with a hardware RAID 1 between the 2 first disks of the disk group:
Omitting the disks value will configure the hardware RAID between all disks of the disk group.
Now let's suppose you have a dedicated server with 1 disk group attached to the RAID controller and 12 disks in that disk group. Example with a hardware RAID 10:
In this example: all the 12 disks will be involved in a hardware RAID of level 10. There will be 4 groups of 3 disks, meaning 4 RAID 1 across 3 disks and the 4 groups will be in RAID 0.
Hardware RAID is at a layer that is not visible by the OS. All OSes are "compatible" with hardware RAID.
All disks involved in a hardware RAID configuration will be seen as 1 single virtual disk by the OS.
This means that if you have included all disks of the target disk group in a hardware RAID configuration, configuring software RAID on top of it is not possible since the OS will only see a single virtual disk.
Partitioning
Partitioning layout is about how your data will be organised and seen by the OS, i.e everything that comes on top of your physical disks (or virtual disk if you have configured hardware RAID), up to the filesystem that is mounted, from the lowest to the highest layer:
- disk (physical/virtual disk, PD),
- partition (physical partition, PP),
- ZFS: vdev (zgroup, ZG), zpool (ZP), ZFS dataset (ZD), ZFS volume (ZV),
- software RAID (SR),
- LVM: physical volume (PV), volume group (VG), logical volume (LV),
- filesystem with a mountpoint (FS)
The following table provides an overview of the different partitioning components and how these layers interact with each other:
In the table above, /dev/zd1 represents a ZFS volume (also known as zvol). This is a virtual disk on top of ZFS dataset (ZD) and a zpool (ZP), that is seen as a normal physical disk (PD) by the Operating System. This feature is not available on the OVHcloud API and we do not plan on implementing it.
OS & Partitioning Compatibility
Since partitioning configuration will be visible by the OS, the chosen OS for reinstallation has an impact on the possibilities you have in your partitioning customisation.
In the /dedicated/installationTemplate section, you can display storage details such as LVM compatibility and filesystem availability for a specific OS:
Example:
The following API call can be used to list the different operating system's partitioning scheme names. Most operating systems support custom partitioning configuration and therefore have only a single scheme named default. Only a few that don't support custom partitioning (noPartitioning set to true) can have multiple schemes.
The following API calls can be used to know which partitioning will be applied by default, if not customised or not customisable by OS.
LVM, RAID Levels & Filesystems Compatibility
The following table provides an overview of filesystem compatibility with RAID levels as well as LVM within the context of OVHcloud:
¹ See the ZFS vdevs vs standard RAID table for more details.
² The RAID level for swap can only be set to 1 within the . In reality, the swap partitions will not use RAID. When a swap partition with size s is defined on a server with n disks, this will create n partitions of size s on every disk without any software RAID device underneath.
³ Windows native RAID (the one configured by the OVHcloud installer) supports RAID 1 but only between two disks while other implementations allow for more than two.
⁴ The ESXi installer does not support custom partitioning schemes. Partitioning is defined by the software publisher. Nevertheless, the can give you an idea of what the partitioning looks like: see OS & Partitioning Compatibility for more details.
This table is only provided for information purposes. Please note that LVM and especially filesystem compatibility also depend on the OS (OVHcloud template) being installed. See OS & Partitioning Compatibility for more details.
ZFS vdevs vs standard RAID
ZFS does not support standard RAID levels. It uses virtual devices (vdevs) to describe fault tolerance within a group of devices. See the official OpenZFS documentation for more details about vdevs.
In order to make the OVHcloud API as simple as possible, customers must define a standard RAID within the API for ZFS filesystems. The standard RAID level will then be translated to an equivalent vdev definition. The following table illustrates the translation of the various RAID levels offered by the OVHcloud API as well as a reminder of their respective characteristics.
API & Partitioning
A custom partitioning layout, while valid and accepted by the , can still prevent the server from booting properly (for example an unusual filesystem/bootloader combination, or a RAID/LVM/ZFS assembly issue specific to your layout). In that case, no support intervention will automatically be created on the server: an explicit customer message will appear after the last reboot. See Common customer errors for more details.
Example of OS installation with a custom partitioning layout:
size 0 means that the partition will fill all the remaining space on the involved disks.
Up to 1 partition can be configured to fill the remaining space (size 0).
If not specified, raidLevel will be set to 1.
In this example, only the 2 first disks of the disk group will be involved in the partitioning (ie. in the software RAID).
The disks parameter can be omitted if you want to involve all the disks of the disk group in the software RAID.
As you can see, a partitioning layout is a list of partitions. Here is an example of a partition structure:
The extras sub-hash is optional. It can be used to specify that the partition will be a logical volume (and its name). It can also be used for ZFS:
In this example, the / mount point will target a ZFS dataset in a zpool named "poule" in a raidz1. Please check ZFS vdevs vs standard RAID to get the matching between raidz and standard RAID levels.
If the zpool name is not specified, a custom zpool name will be automatically generated. By default, the algorithm attempts to group different datasets within the same zpool, except for datasets containing / or /boot which are placed in separate zpools. This allows advanced ZFS features that are incompatible with the bootloader to be enabled on the other zpools.
You can exploit the custom zpool name value to:
- group datasets with same raid levels: use the same zpool name,
- force datasets with same raid levels to be in distinct zpools: use different zpool names.
Data erasure
By default, the disks of every disk group of the server are erased during the OS installation, whether their disk group is declared in the storage request or not. Setting erase to false on a disk group is the only way to keep its data.
Disk groups other than the one on which the OS is installed can also be declared, but only to control whether their data is erased (erase: true) or kept (erase: false).
The OS is installed on the disk group carrying the installation attributes (partitioning, hardwareRaid); the other declared disk groups carry only erase. If none of them carries an installation attribute, the OS is installed on the default disk group, as described in the Disk Groups section.
Example with a server that has 2 disk groups: a simple OS installation on diskGroupId 1 (implicitly erased), and diskGroupId 2 declared only to keep its existing data:
The following restrictions apply to the storage array:
- You cannot set
erase: falsefor the disk group on which the OS is installed. - You cannot declare the same
diskGroupIdmore than once. - You cannot declare more than one disk group on which to install the OS. For any additional disk group, only the
eraseattribute can be set — without OS installation, partitioning, or hardware RAID configuration.
Setting erase to false keeps all data on that disk group, but OVHcloud cannot guarantee that the OS installation will succeed: leftover boot metadata, mdadm superblocks, LVM signatures or ZFS labels from a previous installation on that disk group (i.e. on any of its disks) may conflict with the new installation.
If the installation fails for one of these reasons, no support ticket is created automatically. Instead, an explicit message is displayed to the customer, either during partitioning or at first boot into the installed OS. See Common customer errors for more details.
Error handling
Basic customer input data errors are directly handled by the OVHcloud API. This is the most common and easiest situation as customers can see the error synchronously and retry immediately.
Customer input data related to partitioning might be too specific to be checked by the OVHcloud API and therefore require pre-processing time. The drawback is that customers are notified later during the OS reinstallation process.
Within the , this is visible on the progress bar From the , this status can be obtained with the following API call:
There are 2 types of errors:
- ovh errors: the customer is not responsible for the error, the customer can reinstall with another partitioning layout but OVHcloud will have to fix the bug.
- customer errors: the customer requested a partitioning layout that cannot be achieved or one that would prevent the server from booting properly.
In the next section we will only focus on the customer errors types related to the partitioning, because this is only helpful for the customer.
Common customer errors
The following table gives an overview of well-known customer errors and how to fix them.
Input customer auto-fixing
In order to improve customer experience, reduce OVHcloud support workload and to avoid introducing breaking changes for customers, some customer input is automatically fixed or changed by the backend. The following table gives an overview of what is currently auto-fixed/changed:
Go further
OVHcloud API & OS installation
Join our community of users.