Terraform provider reference / data sources / server_type_hosts
fiberax_server_type_hosts (Data Source)
Hosts of one server type under their labels, so a server can be placed on a named host instead of leaving the choice to the platform.
Describe the order you intend to place - the card model, how many cards, and optionally memory, disk and disk class - and every host also reports whether it fits. A host reported as fitting will accept the request, barring a race with a neighbour: the check is the same rule the platform places servers by. How much is free is not published.
Server types that do not name their hosts answer with an error, so use this data source only on a type that does.
Example Usage
# Hosts of a server type, under the labels the platform shows you.
#
# Describe the server you are about to create and every host also says whether it
# fits. A host reported as fitting will accept the request, barring a race with a
# neighbour. How much is free is not published - only whether your order fits.
data "fiberax_server_type_hosts" "gpu" {
server_type_id = 8
gpu_model = "l40s"
gpus = 1
memory_mb = 65536
disk_gb = 500
disk_type = "local"
}
# The first host that takes this server. Spread a cluster of servers over
# different hosts by picking a different element for each one.
locals {
free_hosts = [for h in data.fiberax_server_type_hosts.gpu.hosts : h.name if h.fits]
}
resource "fiberax_server" "gpu" {
server_type_id = 8
image = data.fiberax_image.ubuntu.id
name = "trainer-01"
cores = 16
memory_mb = 65536
disk_gb = 500
disk_type = "local"
gpus = [{ model = "l40s", count = 1 }]
# Leave this out and the platform picks the host.
host = local.free_hosts[0]
ssh_keys = [fiberax_ssh_key.deploy.id]
}
# Where the server actually runs. It follows the server: a move made by an
# operator changes this value, not the host you asked for.
output "placed_on" { value = fiberax_server.gpu.current_host }
Schema
Required
server_type_id(Number) Identifier of the server type whose hosts to list.
Optional
cores(Number) Cores of the order. Checked against the limit of the server type only - hosts are not judged by cores, because the platform oversubscribes them. Leave it out and cores are not checked.disk_gb(Number) System disk of the order, in gigabytes. Leave it out and disk space is not checked.disk_type(String) Storage class of the system disk of the order:localfor the disk of the host itself,cephfor shared storage. Only a local disk needs room on the host.gpu_model(String) Card model of the order, thekeyfield fromgpu_modelsof the type's pricing. Goes together withgpus: one without the other is refused.gpus(Number) How many cards of that model the order wants. Goes together withgpu_model.memory_mb(Number) Memory of the order, in megabytes and a whole number of gigabytes. Leave it out and memory is not checked.
Read-Only
host_selection(Boolean) True when this type accepts thehostfield offiberax_server. False means the platform picks the host and the field is refused.hosts(Attributes List) Every labelled host of the type, in label order - including hosts that take no new servers: labels are stable, and a server of yours may live on one of those. (see below for nested schema)
Nested Schema for hosts
Read-Only:
accepting(Boolean) Whether this host takes new servers at all.fits(Boolean) Whether the described order fits this host. Null when no order is described.name(String) Label of the host, for examplenode-1. This is the value thehostfield offiberax_servertakes, and the value a server reports incurrent_host.reason(String) What the order lacks on this host, in one word:cards,memory,local_disk,no_local_storageornot_accepting. Null when it fits, null when no order is described, and null as well when the order does not fit but the shortage could not be named - a made-up reason would be worse than none.
Generated from the provider schema for version 0.11.0. How to install the provider: Terraform provider.