subcategory |
---|
Dedicated Server |
Use this resource to order and manage a dedicated server.
data "ovh_me" "account" {}
resource "ovh_dedicated_server" "server" {
ovh_subsidiary = data.ovh_me.account.ovh_subsidiary
display_name = "My server display name"
os = "debian12_64"
plan = [
{
plan_code = "24rise01"
duration = "P1M"
pricing_mode = "default"
configuration = [
{
label = "dedicated_datacenter"
value = "bhs"
},
{
label = "dedicated_os"
value = "none_64.en"
},
{
label = "region"
value = "canada"
}
]
}
]
plan_option = [
{
duration = "P1M"
plan_code = "ram-32g-rise13"
pricing_mode = "default"
quantity = 1
},
{
duration = "P1M"
plan_code = "bandwidth-500-included-rise"
pricing_mode = "default"
quantity = 1
},
{
duration = "P1M"
plan_code = "softraid-2x512nvme-rise"
pricing_mode = "default"
quantity = 1
},
{
duration = "P1M"
plan_code = "vrack-bandwidth-100-rise-included"
pricing_mode = "default"
quantity = 1
}
]
}
~> WARNING After ordering a dedicated server, the provider will wait a maximum of 2 hours for it to be delivered. If it is still not delivered after this time, the apply will end in error, but the delivery process will still continue on OVHcloud's side. In this case you just need to manually untaint the resource and re-run an apply: terraform untaint ovh_dedicated_server.server && terraform apply
. This can be repeated as many times as needed while waiting for the server to be delivered.
ovh_subsidiary
- (Required) OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at /1.0/me.json undermodels.nichandle.OvhSubsidiaryEnum
plan
- (Required) Product Plan to orderduration
- (Required) Durationplan_code
- (Required) Plan codepricing_mode
- (Required) Pricing mode identifiercatalog_name
- Catalog nameconfiguration
- Representation of a configuration item to personalize productlabel
- (Required) Identifier of the resourcevalue
- (Required) Path to the resource in API.OVH.COM
plan_option
- Product Plan to orderduration
- (Required) durationplan_code
- (Required) Plan codepricing_mode
- (Required) Pricing model identifiercatalog_name
- Catalog nameconfiguration
- Representation of a configuration item to personalize productlabel
- (Required) Identifier of the resourcevalue
- (Required) Path to the resource in API.OVH.COM
service_name
- (Optional) The service_name of your dedicated server. This field can be used to avoid ordering a dedicated server at creation and just create the resource using an already existing service
display_name
- Display name of your dedicated serverefi_bootloader_path
- Path of the EFI bootloadermonitoring
- Icmp monitoring stateno_intervention
- Prevent datacenter interventionrescue_mail
- Custom email used to receive rescue credentialsrescue_ssh_key
- Public SSH Key used in the rescue moderoot_device
- Root device of the serverstate
- All states a Dedicated can in (error, hacked, hackedBlocked, ok)
os
- Operating System to installcustomizations
- Customization of the OS configurationconfig_drive_user_data
- Config Drive UserDataefi_bootloader_path
- Path of the EFI bootloader from the OS installed on the serverhostname
- Custom hostnamehttp_headers
- Image HTTP Headersimage_check_sum
- Image checksumimage_check_sum_type
- Checksum typeimage_type
- Image Typeimage_url
- Image URLlanguage
- Display Languagepost_installation_script
- Post-Installation Scriptpost_installation_script_extension
- Post-Installation Script File Extensionssh_key
- SSH Public Key
storage
- Storage customizationdisk_group_id
- Disk group idhardware_raid
- Hardware Raid configurationsarrays
- Number of arraysdisks
- Total number of disks in the disk group involved in the hardware raid configurationraid_level
- Hardware raid typespares
- Number of disks in the disk group involved in the spare
partitioning
- Partitioning configurationdisks
- Total number of disks in the disk group involved in the partitioning configurationlayout
- Custom partitioning layoutextras
- Partition extras parameterslv
- LVM-specific parameterszp
- ZFS-specific parameters
file_system
- File system typemount_point
- Mount pointraid_level
- Software raid typesize
- Partition size in MiB
scheme_name
- Partitioning scheme (if applicable with selected operating system)
properties
- Arbitrary properties to pass to cloud-init's config drive datasource
keep_service_after_destroy
- Avoid termination of the service when deleting the resource (when using this parameter, make sure to apply your configuration before running the destroy so that the value is set in the state)prevent_install_on_create
- Prevent server installation after it has been deliveredprevent_install_on_import
- Defines whether a reinstallation of the server is allowed after importing it if there is a modification on the installation parameters
service_name
- The service_name of your dedicated serverdisplay_name
- Dedicated server display namename
- Dedicated server nameserver_id
- Server idcommercial_range
- Dedicated server commercial rangeos
- Operating systemip
- Dedicated server ip (IPv4)region
- Dedicated region localisationavailability_zone
- Dedicated AZ localisationdatacenter
- Dedicated datacenter localisation (bhs1,bhs2,...)rack
- Rack id of the serverstate
- All states a Dedicated can be in (error, hacked, hackedBlocked, ok)power_state
- Power state of the server (poweron, poweroff)support_level
- Dedicated server support level (critical, fastpath, gs, pro)iam
- IAM resource informationurn
- URN of the private database, used when writing IAM policiesdisplay_name
- Resource display nameid
- Unique identifier of the resource in the IAMtags
- Resource tags. Tags that were internally computed are prefixed withovh:
boot_id
- Boot id of the serverboot_script
- Boot script of the serverefi_bootloader_path
- Path of the EFI bootloaderlink_speed
- Link speed of the servermonitoring
- Icmp monitoring stateno_intervention
- Prevent datacenter interventionnew_upgrade_system
-partition_scheme_name
- Partition scheme nameprofessional_use
- Does this server have professional use optionrescue_mail
- Rescue mail of the serverrescue_ssh_key
- Public SSH Key used in the rescue modereverse
- Dedicated server reverseroot_device
- Root device of the server
Dedicated servers can be imported using the service_name
. Using the following configuration:
import {
to = ovh_dedicated_server.server
id = "<service name>"
}
You can then run:
terraform plan -generate-config-out=dedicated.tf
terraform apply
The file dedicated.tf
will then contain the imported resource's configuration, that can be copied next to the import
block above. See https://developer.hashicorp.com/terraform/language/import/generating-configuration for more details.