From 4dab09d0efab209832da7ff3b89aff9f8d2501ba Mon Sep 17 00:00:00 2001 From: Benedikt Rollik Date: Tue, 1 Oct 2024 14:07:28 +0200 Subject: [PATCH 1/3] feat(em): add custom partitioning --- .../how-to/configure-disk-partitions.mdx | 223 ++++++++++++++++++ .../elastic-metal/how-to/create-server.mdx | 1 + menu/navigation.json | 14 +- 3 files changed, 233 insertions(+), 5 deletions(-) create mode 100644 bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx diff --git a/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx b/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx new file mode 100644 index 0000000000..e207750697 --- /dev/null +++ b/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx @@ -0,0 +1,223 @@ +--- +meta: + title: How to configure custom disk partitioning on Scaleway Elastic Metal servers + description: Learn how to configure custom disk partitions on Scaleway Elastic Metal servers +content: + h1: How to configure custom disk partitioning on Scaleway Elastic Metal servers + paragraph: This guide explains how to configure custom disk partitions on Scaleway Elastic Metal servers. +tags: attach, detach, flexible-ip, elastic-metal +dates: + validation: 2024-10-01 + posted: 2024-10-01 +categories: + - bare-metal +--- + +Scaleway Bare Metal server come with a default partition layout, suited for most users to speed up and simplify the installation process of the server. +However, if you have specific requirements, you can define a custom partitioning of your machine using a JSON configuration during installation of the server. + + + You can change the partitioning of your server during installation or re-installation only. + Be aware that all your data will be deleted if you reinstall your server. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- An [SSH key](/identity-and-access-management/organizations-and-projects/how-to/create-ssh-key/) +- An [Elastic Metal server](/bare-metal/elastic-metal/quickstart/#how-to-create-an-elastic-metal-server) + +## Example configuration + +During [server installation](/bare-metal/elastic-metal/) click **Advanced JSON** configuration in step 5 of the server creation wizard. +You can then edit the partiton configuration directly in the editor within your browser. The configuration is done using a JSON description of the partitioning. +Below is an example of how to define a partitioning schema with RAID and NVMe disks. + + + - Disk Type Naming: Device names differ based on the disk type. For example, HDD/SSD will use `/dev/sdXXX`, while NVMe devices use `/dev/nvmeXXX`. + - UEFI Partition: The EFI partition should only exist if the server uses UEFI. If UEFI is not in use, this partition should be omitted. + - ZFS and LVM: ZFS is optional and can be configured if needed, while LVM should not be used for now due to functionality issues. + + +```json +{ + "partitioning_schema": { + "disks": [ + { + "device": "/dev/nvme0n1", + "partitions": [ + { + "label": "uefi", + "number": 1, + "size": 536870912 + }, + { + "label": "swap", + "number": 2, + "size": 4294967296 + }, + { + "label": "boot", + "number": 3, + "size": 536870912 + }, + { + "label": "root", + "number": 4, + "size": 64424509440 + }, + { + "label": "data", + "number": 5, + "size": 1850588790784 + } + ] + }, + { + "device": "/dev/nvme1n1", + "partitions": [ + { + "label": "swap", + "number": 1, + "size": 4294967296 + }, + { + "label": "boot", + "number": 2, + "size": 536870912 + }, + { + "label": "root", + "number": 3, + "size": 64424509440 + }, + { + "label": "data", + "number": 4, + "size": 1850588790784 + } + ] + } + ], + "raids": [ + { + "name": "/dev/md0", + "level": "raid_level_1", + "devices": [ + "/dev/nvme0n1p3", + "/dev/nvme1n1p2" + ] + }, + { + "name": "/dev/md1", + "level": "raid_level_1", + "devices": [ + "/dev/nvme0n1p4", + "/dev/nvme1n1p3" + ] + } + ], + "filesystems": [ + { + "device": "/dev/nvme0n1p1", + "format": "fat32", + "mountpoint": "/boot/efi" + }, + { + "device": "/dev/md0", + "format": "ext4", + "mountpoint": "/boot" + }, + { + "device": "/dev/md1", + "format": "ext4", + "mountpoint": "/" + } + ], + "lvm": null, + "zfs": { + "pools": [ + { + "name": "zpve", + "type": "mirror", + "devices": [ + "/dev/nvme0n1p5", + "/dev/nvme1n1p4" + ], + "options": [ + "ashift=12" + ], + "filesystem_options": [] + } + ] + } + } +} +``` + +## Explanation of key sections: + +- Disks: + - Each disk is specified with its device path (e.g., `/dev/nvme0n1` or `/dev/nvme1n1`). + - Partitions are defined with labels like `swap`, `boot`, `root`, `data`, and an optional `uefi` partition for systems using UEFI. + - Each partition has a `number` and `size` in bytes. + +- RAID: + - If RAID is required, declare the disks and the desired RAID level. In this example, we are configuring two RAID-1 arrays, one for the boot partition and one for the root partition. + - Devices participating in each RAID array are specified by their partition paths (e.g., `/dev/nvme0n1p3` for partition 3 of the first NVMe disk). + +- Filesystems: + - Each partition is assigned a filesystem type and a mount point. + - For example, the `/boot/efi` partition is formatted with `fat32`, while `/boot` and `/` are formatted with `ext4`. + +- ZFS (Optional): + - ZFS can be configured if wished. In this example, a ZFS mirror is created using partitions from two NVMe devices. + - ZFS options such as `ashift=12` can be included for performance tuning, but they are optional. + +### Simple configuration (No RAID or ZFS) + +If you prefer a simpler configuration without RAID or ZFS, you can remove the `raids` and `zfs` sections. For example, if you only need a single disk setup with no RAID, declare just one disk with the partitions and filesystems as shown below: + +```json +{ + "partitioning_schema": { + "disks": [ + { + "device": "/dev/nvme0n1", + "partitions": [ + { + "label": "swap", + "number": 1, + "size": 4294967296 + }, + { + "label": "boot", + "number": 2, + "size": 536870912 + }, + { + "label": "root", + "number": 3, + "size": 64424509440 + } + ] + } + ], + "filesystems": [ + { + "device": "/dev/nvme0n1p2", + "format": "ext4", + "mountpoint": "/boot" + }, + { + "device": "/dev/nvme0n1p3", + "format": "ext4", + "mountpoint": "/" + } + ], + "raids": [], + "zfs": null, + "lvm": null + } +} +``` \ No newline at end of file diff --git a/bare-metal/elastic-metal/how-to/create-server.mdx b/bare-metal/elastic-metal/how-to/create-server.mdx index 47bf3e7ca7..3b5df53cef 100644 --- a/bare-metal/elastic-metal/how-to/create-server.mdx +++ b/bare-metal/elastic-metal/how-to/create-server.mdx @@ -35,6 +35,7 @@ Scaleway [Elastic Metal servers](https://www.scaleway.com/en/elastic-metal/) pro - Choose your preferred billing method: **hourly** or **monthly**. - Select a server configuration from the available options. - Choose an OS to run on your server or opt for no preinstalled image. + - Configure the partitions of your server. You can either choose a default configuration or [configure your own partitioning](/bare-metal/elastic-metal/how-to/configure-disk-partitions/) using a JSON configuration. - Enter a name and, optionally, add tags to identify your server. - Add your SSH key (required if installing an image on your server). Depending on the OS image, you may also be asked to configure the panel user for your server. - Optionally, configure the available public bandwidth for your server. This option may not be available for all offers. diff --git a/menu/navigation.json b/menu/navigation.json index 6e3080e101..348a4c9bcb 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -868,14 +868,18 @@ "label": "Connect to your server", "slug": "connect-to-server" }, - { - "label": "Order a flexible IP", - "slug": "order-flexible-ip" - }, { "label": "Adjust the available bandwidth", "slug": "adjust-available-bandwidth" }, + { + "label": "Configure custom disk partitioning", + "slug": "configure-disk-partitions" + }, + { + "label": "Order a flexible IP", + "slug": "order-flexible-ip" + }, { "label": "Attach/detach a flexible IP", "slug": "attach-detach-flexible-ip" @@ -5399,4 +5403,4 @@ ], "label": "Additional Services" } -] \ No newline at end of file +] From a00eb2a037aeed43fa978174ab64bb63ccdeaadc Mon Sep 17 00:00:00 2001 From: Benedikt Rollik Date: Fri, 4 Oct 2024 12:42:06 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Rowena Jones <36301604+RoRoJ@users.noreply.github.com> --- .../elastic-metal/how-to/configure-disk-partitions.mdx | 6 +++--- bare-metal/elastic-metal/how-to/create-server.mdx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx b/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx index e207750697..9dffdb55f4 100644 --- a/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx +++ b/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx @@ -13,8 +13,8 @@ categories: - bare-metal --- -Scaleway Bare Metal server come with a default partition layout, suited for most users to speed up and simplify the installation process of the server. -However, if you have specific requirements, you can define a custom partitioning of your machine using a JSON configuration during installation of the server. +Scaleway Elastic Metal servers come with a default partition layout, suitable for most users and intended to speed up and simplify the installation process of the server. +However, if you have specific requirements, you can define custom partitioning of your machine using a JSON configuration during server installation. You can change the partitioning of your server during installation or re-installation only. @@ -30,7 +30,7 @@ However, if you have specific requirements, you can define a custom partitioning ## Example configuration During [server installation](/bare-metal/elastic-metal/) click **Advanced JSON** configuration in step 5 of the server creation wizard. -You can then edit the partiton configuration directly in the editor within your browser. The configuration is done using a JSON description of the partitioning. +You can then edit the partition configuration directly in the editor within your browser. The configuration is done via a JSON description of the partitioning. Below is an example of how to define a partitioning schema with RAID and NVMe disks. diff --git a/bare-metal/elastic-metal/how-to/create-server.mdx b/bare-metal/elastic-metal/how-to/create-server.mdx index 3b5df53cef..6e899f75f5 100644 --- a/bare-metal/elastic-metal/how-to/create-server.mdx +++ b/bare-metal/elastic-metal/how-to/create-server.mdx @@ -35,7 +35,7 @@ Scaleway [Elastic Metal servers](https://www.scaleway.com/en/elastic-metal/) pro - Choose your preferred billing method: **hourly** or **monthly**. - Select a server configuration from the available options. - Choose an OS to run on your server or opt for no preinstalled image. - - Configure the partitions of your server. You can either choose a default configuration or [configure your own partitioning](/bare-metal/elastic-metal/how-to/configure-disk-partitions/) using a JSON configuration. + - Configure server partitioning. You can either choose a default configuration or [configure your own partitioning](/bare-metal/elastic-metal/how-to/configure-disk-partitions/) using a JSON configuration. - Enter a name and, optionally, add tags to identify your server. - Add your SSH key (required if installing an image on your server). Depending on the OS image, you may also be asked to configure the panel user for your server. - Optionally, configure the available public bandwidth for your server. This option may not be available for all offers. From 543e898a85f514ccef138f3aba410dfc0e7ae0c9 Mon Sep 17 00:00:00 2001 From: Benedikt Rollik Date: Thu, 10 Oct 2024 11:27:43 +0200 Subject: [PATCH 3/3] feat(em): add link to api --- .../elastic-metal/how-to/configure-disk-partitions.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx b/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx index 9dffdb55f4..3838afbdf5 100644 --- a/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx +++ b/bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx @@ -39,6 +39,10 @@ Below is an example of how to define a partitioning schema with RAID and NVMe di - ZFS and LVM: ZFS is optional and can be configured if needed, while LVM should not be used for now due to functionality issues. + + Refer to the Elastic Metal API documentation for a complete overview of the expected values for filesystem types, RAID configurations, and other related parameters required for partitioning. For more details, visit the [Scaleway Elastic Metal API Documentation – Default Partitioning Schema](https://www.scaleway.com/en/developers/api/elastic-metal/#path-partitioning-schemas-get-default-partitioning-schema). + + ```json { "partitioning_schema": { @@ -162,7 +166,7 @@ Below is an example of how to define a partitioning schema with RAID and NVMe di - Partitions are defined with labels like `swap`, `boot`, `root`, `data`, and an optional `uefi` partition for systems using UEFI. - Each partition has a `number` and `size` in bytes. -- RAID: +- RAID (Optional): - If RAID is required, declare the disks and the desired RAID level. In this example, we are configuring two RAID-1 arrays, one for the boot partition and one for the root partition. - Devices participating in each RAID array are specified by their partition paths (e.g., `/dev/nvme0n1p3` for partition 3 of the first NVMe disk).