2016-01-28 01:48:44 +01:00
|
|
|
---
|
|
|
|
layout: "clc"
|
|
|
|
page_title: "clc: clc_server"
|
|
|
|
sidebar_current: "docs-clc-resource-server"
|
|
|
|
description: |-
|
|
|
|
Manages the lifecycle of a CLC server.
|
|
|
|
---
|
|
|
|
|
|
|
|
# clc\_server
|
|
|
|
|
|
|
|
Manages a CLC server.
|
|
|
|
|
2016-05-06 19:52:37 +02:00
|
|
|
Resources and Documentation:
|
|
|
|
|
|
|
|
- [Datacenter / Capability Map](https://www.ctl.io/data-centers/)
|
|
|
|
- [Hyperscale](https://www.ctl.io/hyperscale/) and [Bare Metal](https://www.ctl.io/bare-metal/) Servers
|
|
|
|
- [REST API](https://www.ctl.io/api-docs/v2/#servers-create-server)
|
|
|
|
|
2016-01-28 01:48:44 +01:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
# Provision a server
|
|
|
|
resource "clc_server" "node" {
|
|
|
|
name_template = "trusty"
|
|
|
|
source_server_id = "UBUNTU-14-64-TEMPLATE"
|
|
|
|
group_id = "${clc_group.frontends.id}"
|
|
|
|
cpu = 2
|
|
|
|
memory_mb = 2048
|
|
|
|
password = "Green123$"
|
|
|
|
additional_disks
|
|
|
|
{
|
|
|
|
path = "/var"
|
|
|
|
size_gb = 100
|
|
|
|
type = "partitioned"
|
|
|
|
}
|
|
|
|
additional_disks
|
|
|
|
{
|
|
|
|
size_gb = 10
|
|
|
|
type = "raw"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
output "server_id" {
|
|
|
|
value = "clc_server.node.id"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name_template` - (Required, string) The basename of the server. A unique name will be generated by the platform.
|
|
|
|
* `source_server_id` - (Required, string) The name or ID of the base OS image.
|
|
|
|
Examples: "ubuntu-14-64-template", "rhel-7-64-template", "win2012r2dtc-64"
|
|
|
|
* `group_id` - (Required, string) The name or ID of the server group to spawn server into.
|
|
|
|
* `cpu` - (Required, int) The number of virtual cores
|
|
|
|
* `memory_mb` - (Required, int) Provisioned RAM
|
|
|
|
* `type` - (Required, string) The virtualization type
|
|
|
|
One of "standard", "hyperscale", "bareMetal"
|
|
|
|
* `password` - (Optional, string) The root/adminstrator password. Will be generated by platform if not provided.
|
|
|
|
* `description` - (Optional, string) Description for server (visible in control portal only)
|
|
|
|
* `power_state` - (Optional, string) See [PowerStates](#power_states) below for details.
|
|
|
|
If absent, defaults to `started`.
|
|
|
|
* `private_ip_address` - (Optional, string) Set internal IP address. If absent, allocated and assigned from pool.
|
|
|
|
* `network_id` - (Optional, string) GUID of network to use. (Must be set up in advance from control portal.)
|
|
|
|
When absent, the default network will be used.
|
|
|
|
* `storage_type` - (Optional, string) Backup and replication strategy for disks.
|
|
|
|
One of "standard", "premium"
|
2016-05-06 19:52:37 +02:00
|
|
|
* `aa_policy_id` - (Optional, string | hyperscale) Anti-Affinity policy ID
|
|
|
|
* `configuration_id` - (Optional, string | bareMetal) Hardware configuration ID
|
|
|
|
* `os_type` - (Optional, string | bareMetal) Operating system to install.
|
2016-01-28 01:48:44 +01:00
|
|
|
* `additional_disks` - (Optional) See [Disks](#disks) below for details.
|
|
|
|
* `custom_fields` - (Optional) See [CustomFields](#custom_fields) below for details.
|
2016-03-22 16:38:56 +01:00
|
|
|
* `metadata` - (Optional) Misc state storage for non-CLC metadata.
|
2016-01-28 01:48:44 +01:00
|
|
|
|
|
|
|
|
2016-05-06 19:52:37 +02:00
|
|
|
<a id="server-types"></a>
|
|
|
|
## Server Types
|
|
|
|
|
|
|
|
#### standard
|
|
|
|
|
|
|
|
Cloud servers `standard` offer basic, commodity level
|
|
|
|
performance with mixed spindle/SSD storage profiles. Additional
|
|
|
|
features storage backups, snapshot/clone/archive, and widespread
|
|
|
|
availability.
|
|
|
|
|
|
|
|
|
|
|
|
#### hyperscale
|
|
|
|
|
|
|
|
Hyperscale `hyperscale` servers offer significantly higher IOPS than standard
|
|
|
|
servers for CPU and IO intensive servers. See the
|
|
|
|
[FAQ](https://www.ctl.io/knowledge-base/servers/hyperscale-server-faq/)
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
Physical host redundancy can be managed via
|
|
|
|
[Anti-Affinity policies](https://www.ctl.io/knowledge-base/servers/centurylink-cloud-anti-affinity-policies/).
|
|
|
|
|
|
|
|
#### bareMetal
|
|
|
|
|
|
|
|
Bare metal `bareMetal` offers optimal compute performance and is
|
|
|
|
available in select datacenters in CLC for approved customers. For
|
|
|
|
more info see the
|
|
|
|
[FAQ](https://www.ctl.io/knowledge-base/servers/bare-metal-faq/).
|
|
|
|
|
|
|
|
For `bareMetal`, the required fields `source_server_id`, `cpu`, and
|
|
|
|
`memory_mb` are ignored and instead the following fields are required:
|
|
|
|
|
|
|
|
- configuration_id
|
|
|
|
- os_type
|
|
|
|
|
|
|
|
Values for `configuration_id` and `os_type` are specific to each
|
|
|
|
datacenter and are available via the API endpoints
|
|
|
|
[here](https://www.ctl.io/api-docs/v2/#data-centers-get-data-center-bare-metal-capabilities).
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-28 01:48:44 +01:00
|
|
|
|
|
|
|
<a id="power_states"></a>
|
|
|
|
## PowerStates
|
|
|
|
|
|
|
|
`power_state` may be used to set initial power state or modify existing instances.
|
|
|
|
|
|
|
|
* `on` | `started` - machine powered on
|
|
|
|
* `off` | `stopped` - machine powered off forcefully
|
|
|
|
* `paused` - freeze machine: memory, processes, billing, monitoring.
|
|
|
|
* `shutdown` - shutdown gracefully
|
|
|
|
* `reboot` - restart gracefully
|
|
|
|
* `reset` - restart forcefully
|
|
|
|
|
|
|
|
<a id="disks"></a>
|
|
|
|
## Disks
|
|
|
|
|
|
|
|
`additional_disks` is a block within the configuration that may be
|
|
|
|
repeated to specify the attached disks on a server. Each
|
|
|
|
`additional_disks` block supports the following:
|
|
|
|
|
|
|
|
* `type` - (Required, string) Either "raw" or "partitioned".
|
|
|
|
* `size_gb` - (Required, int) Size of allocated disk.
|
|
|
|
* `path` - (Required, string, type:`partitioned`) The mountpoint for the disk.
|
|
|
|
|
|
|
|
|
|
|
|
<a id="custom_fields"></a>
|
|
|
|
## CustomFields
|
|
|
|
|
|
|
|
`custom_fields` is a block within the configuration that may be
|
|
|
|
repeated to bind custom fields for a server. CustomFields need be set
|
|
|
|
up in advance. Each `custom_fields` block supports the following:
|
|
|
|
|
|
|
|
* `id` - (Required, string) The ID of the custom field to set.
|
|
|
|
* `value` - (Required, string) The value for the specified field.
|
|
|
|
|
2016-05-04 19:06:17 +02:00
|
|
|
<a id="packages"></a>
|
|
|
|
## Packages
|
|
|
|
|
|
|
|
`packages` is a block within the configuration that may be repeated to
|
|
|
|
specify packages and their associated parameters to be run at
|
|
|
|
instantiation. Packages facilitate various tasks like ssh key
|
|
|
|
installation, kernel upgrades, etc. Package ID as well as parameters
|
|
|
|
are configured via this block.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```
|
|
|
|
# Configure the CLC Provider
|
|
|
|
provider "clc_server" "ubuntu" {
|
|
|
|
...
|
|
|
|
packages
|
|
|
|
{
|
|
|
|
id = "77abb844-579d-478d-3955-c69ab4a7ba1a"
|
|
|
|
SshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAA..."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2016-05-06 19:52:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|