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