github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/clc/r/server.html.markdown (about) 1 --- 2 layout: "clc" 3 page_title: "clc: clc_server" 4 sidebar_current: "docs-clc-resource-server" 5 description: |- 6 Manages the lifecycle of a CLC server. 7 --- 8 9 # clc_server 10 11 Manages a CLC server. 12 13 Resources and Documentation: 14 15 - [Datacenter / Capability Map](https://www.ctl.io/data-centers/) 16 - [Hyperscale](https://www.ctl.io/hyperscale/) and [Bare Metal](https://www.ctl.io/bare-metal/) Servers 17 - [REST API](https://www.ctl.io/api-docs/v2/#servers-create-server) 18 19 20 ## Example Usage 21 22 ```hcl 23 # Provision a server 24 resource "clc_server" "node" { 25 name_template = "trusty" 26 source_server_id = "UBUNTU-14-64-TEMPLATE" 27 group_id = "${clc_group.frontends.id}" 28 cpu = 2 29 memory_mb = 2048 30 password = "Green123$" 31 32 additional_disks { 33 path = "/var" 34 size_gb = 100 35 type = "partitioned" 36 } 37 38 additional_disks { 39 size_gb = 10 40 type = "raw" 41 } 42 } 43 44 output "server_id" { 45 value = "clc_server.node.id" 46 } 47 ``` 48 49 ## Argument Reference 50 51 52 The following arguments are supported: 53 54 * `name_template` - (Required, string) The basename of the server. A unique name will be generated by the platform. 55 * `source_server_id` - (Required, string) The name or ID of the base OS image. 56 Examples: "ubuntu-14-64-template", "rhel-7-64-template", "win2012r2dtc-64" 57 * `group_id` - (Required, string) The name or ID of the server group to spawn server into. 58 * `cpu` - (Required, int) The number of virtual cores 59 * `memory_mb` - (Required, int) Provisioned RAM 60 * `type` - (Required, string) The virtualization type 61 One of "standard", "hyperscale", "bareMetal" 62 * `password` - (Optional, string) The root/administrator password. Will be generated by platform if not provided. 63 * `description` - (Optional, string) Description for server (visible in control portal only) 64 * `power_state` - (Optional, string) See [PowerStates](#power_states) below for details. 65 If absent, defaults to `started`. 66 * `private_ip_address` - (Optional, string) Set internal IP address. If absent, allocated and assigned from pool. 67 * `network_id` - (Optional, string) GUID of network to use. (Must be set up in advance from control portal.) 68 When absent, the default network will be used. 69 * `storage_type` - (Optional, string) Backup and replication strategy for disks. 70 One of "standard", "premium" 71 * `aa_policy_id` - (Optional, string | hyperscale) Anti-Affinity policy ID 72 * `configuration_id` - (Optional, string | bareMetal) Hardware configuration ID 73 * `os_type` - (Optional, string | bareMetal) Operating system to install. 74 * `additional_disks` - (Optional) See [Disks](#disks) below for details. 75 * `custom_fields` - (Optional) See [CustomFields](#custom_fields) below for details. 76 * `metadata` - (Optional) Misc state storage for non-CLC metadata. 77 78 79 <a id="server-types"></a> 80 ## Server Types 81 82 #### standard 83 84 Cloud servers `standard` offer basic, commodity level 85 performance with mixed spindle/SSD storage profiles. Additional 86 features storage backups, snapshot/clone/archive, and widespread 87 availability. 88 89 90 #### hyperscale 91 92 Hyperscale `hyperscale` servers offer significantly higher IOPS than standard 93 servers for CPU and IO intensive servers. See the 94 [FAQ](https://www.ctl.io/knowledge-base/servers/hyperscale-server-faq/) 95 for more details. 96 97 Physical host redundancy can be managed via 98 [Anti-Affinity policies](https://www.ctl.io/knowledge-base/servers/centurylink-cloud-anti-affinity-policies/). 99 100 #### bareMetal 101 102 Bare metal `bareMetal` offers optimal compute performance and is 103 available in select datacenters in CLC for approved customers. For 104 more info see the 105 [FAQ](https://www.ctl.io/knowledge-base/servers/bare-metal-faq/). 106 107 For `bareMetal`, the required fields `source_server_id`, `cpu`, and 108 `memory_mb` are ignored and instead the following fields are required: 109 110 - configuration_id 111 - os_type 112 113 Values for `configuration_id` and `os_type` are specific to each 114 datacenter and are available via the API endpoints 115 [here](https://www.ctl.io/api-docs/v2/#data-centers-get-data-center-bare-metal-capabilities). 116 117 118 119 120 <a id="power_states"></a> 121 ## PowerStates 122 123 `power_state` may be used to set initial power state or modify existing instances. 124 125 * `on` | `started` - machine powered on 126 * `off` | `stopped` - machine powered off forcefully 127 * `paused` - freeze machine: memory, processes, billing, monitoring. 128 * `shutdown` - shutdown gracefully 129 * `reboot` - restart gracefully 130 * `reset` - restart forcefully 131 132 <a id="disks"></a> 133 ## Disks 134 135 `additional_disks` is a block within the configuration that may be 136 repeated to specify the attached disks on a server. Each 137 `additional_disks` block supports the following: 138 139 * `type` - (Required, string) Either "raw" or "partitioned". 140 * `size_gb` - (Required, int) Size of allocated disk. 141 * `path` - (Required, string, type:`partitioned`) The mountpoint for the disk. 142 143 144 <a id="custom_fields"></a> 145 ## CustomFields 146 147 `custom_fields` is a block within the configuration that may be 148 repeated to bind custom fields for a server. CustomFields need be set 149 up in advance. Each `custom_fields` block supports the following: 150 151 * `id` - (Required, string) The ID of the custom field to set. 152 * `value` - (Required, string) The value for the specified field. 153 154 <a id="packages"></a> 155 ## Packages 156 157 `packages` is a block within the configuration that may be repeated to 158 specify packages and their associated parameters to be run at 159 instantiation. Packages facilitate various tasks like ssh key 160 installation, kernel upgrades, etc. Package ID as well as parameters 161 are configured via this block. 162 163 Example: 164 165 ```hcl 166 # Configure the CLC Provider 167 provider "clc_server" "ubuntu" { 168 # ... 169 packages { 170 id = "77abb844-579d-478d-3955-c69ab4a7ba1a" 171 SshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAA..." 172 } 173 } 174 ```