Skip to content

Commit b5b79ab

Browse files
authored
feat(baremetal): add documentation and example custom partitioning (#2848)
1 parent 0db8391 commit b5b79ab

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/resources/baremetal_server.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,37 @@ resource "scaleway_baremetal_server" "base" {
184184
}
185185
```
186186

187+
### With custom partitioning
188+
189+
```terraform
190+
variable "configCustomPartitioning" {
191+
default = "{\"disks\":[{\"device\":\"/dev/nvme0n1\",\"partitions\":[{\"label\":\"uefi\",\"number\":1,\"size\":536870912},{\"label\":\"swap\",\"number\":2,\"size\":4294967296},{\"label\":\"boot\",\"number\":3,\"size\":1073741824},{\"label\":\"root\",\"number\":4,\"size\":1017827045376}]},{\"device\":\"/dev/nvme1n1\",\"partitions\":[{\"label\":\"swap\",\"number\":1,\"size\":4294967296},{\"label\":\"boot\",\"number\":2,\"size\":1073741824},{\"label\":\"root\",\"number\":3,\"size\":1017827045376}]}],\"filesystems\":[{\"device\":\"/dev/nvme0n1p1\",\"format\":\"fat32\",\"mountpoint\":\"/boot/efi\"},{\"device\":\"/dev/md0\",\"format\":\"ext4\",\"mountpoint\":\"/boot\"},{\"device\":\"/dev/md1\",\"format\":\"ext4\",\"mountpoint\":\"/\"}],\"raids\":[{\"devices\":[\"/dev/nvme0n1p3\",\"/dev/nvme1n1p2\"],\"level\":\"raid_level_1\",\"name\":\"/dev/md0\"},{\"devices\":[\"/dev/nvme0n1p4\",\"/dev/nvme1n1p3\"],\"level\":\"raid_level_1\",\"name\":\"/dev/md1\"}],\"zfs\":{\"pools\":[]}}"
192+
}
193+
194+
data "scaleway_baremetal_os" "my_os" {
195+
zone = "fr-par-1"
196+
name = "Ubuntu"
197+
version = "22.04 LTS (Jammy Jellyfish)"
198+
}
199+
200+
resource "scaleway_iam_ssh_key" "main" {
201+
name = "main"
202+
}
203+
204+
resource "scaleway_baremetal_server" "base" {
205+
name = "%s"
206+
zone = "fr-par-1"
207+
description = "test a description"
208+
offer = "EM-B220E-NVME"
209+
os = data.scaleway_baremetal_os.my_os.os_id
210+
partitioning = var.configCustomPartitioning
211+
212+
tags = [ "terraform-test", "scaleway_baremetal_server", "minimal" ]
213+
ssh_key_ids = [ scaleway_iam_ssh_key.main.id ]
214+
}
215+
216+
```
217+
187218
## Argument Reference
188219

189220
The following arguments are supported:
@@ -216,6 +247,7 @@ The following arguments are supported:
216247
- `id` - (Required) The id of the private network to attach.
217248
- `ipam_ip_ids` - (Optional) List of IPAM IP IDs to assign to the server in the requested private network.
218249
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the server should be created.
250+
- `partitioning` (Optional) The partitioning schema in JSON format
219251
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the server is associated with.
220252

221253

0 commit comments

Comments
 (0)