2014-12-10 22:20:52 +01:00
|
|
|
---
|
|
|
|
layout: "cloudstack"
|
|
|
|
page_title: "CloudStack: cloudstack_instance"
|
|
|
|
sidebar_current: "docs-cloudstack-resource-instance"
|
|
|
|
description: |-
|
|
|
|
Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.
|
|
|
|
---
|
|
|
|
|
2017-04-10 18:15:08 +02:00
|
|
|
# cloudstack_instance
|
2014-12-10 22:20:52 +01:00
|
|
|
|
|
|
|
Creates and automatically starts a virtual machine based on a service offering,
|
|
|
|
disk offering, and template.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-10 18:15:08 +02:00
|
|
|
```hcl
|
2014-12-10 22:20:52 +01:00
|
|
|
resource "cloudstack_instance" "web" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "server-1"
|
|
|
|
service_offering = "small"
|
|
|
|
network_id = "6eb22f91-7454-4107-89f4-36afcdf33021"
|
|
|
|
template = "CentOS 6.5"
|
|
|
|
zone = "zone-1"
|
2014-12-10 22:20:52 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2016-03-25 18:24:16 +01:00
|
|
|
* `name` - (Required) The name of the instance.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
|
|
|
* `display_name` - (Optional) The display name of the instance.
|
|
|
|
|
2015-06-09 12:38:05 +02:00
|
|
|
* `service_offering` - (Required) The name or ID of the service offering used
|
|
|
|
for this instance.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2016-04-11 17:14:19 +02:00
|
|
|
* `network_id` - (Optional) The ID of the network to connect this instance
|
2015-06-09 12:38:05 +02:00
|
|
|
to. Changing this forces a new resource to be created.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2016-04-04 22:13:27 +02:00
|
|
|
* `ip_address` - (Optional) The IP address to assign to this instance. Changing
|
2014-12-10 22:20:52 +01:00
|
|
|
this forces a new resource to be created.
|
|
|
|
|
2016-06-25 19:42:01 +02:00
|
|
|
* `template` - (Required) The name or ID of the template used for this
|
|
|
|
instance. Changing this forces a new resource to be created.
|
|
|
|
|
|
|
|
* `root_disk_size` - (Optional) The size of the root disk in gigabytes. The
|
|
|
|
root disk is resized on deploy. Only applies to template-based deployments.
|
2016-04-04 22:13:27 +02:00
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
2016-06-25 19:42:01 +02:00
|
|
|
* `group` - (Optional) The group name of the instance.
|
|
|
|
|
|
|
|
* `affinity_group_ids` - (Optional) List of affinity group IDs to apply to this
|
|
|
|
instance.
|
|
|
|
|
|
|
|
* `affinity_group_names` - (Optional) List of affinity group names to apply to
|
|
|
|
this instance.
|
|
|
|
|
|
|
|
* `security_group_ids` - (Optional) List of security group IDs to apply to this
|
2015-06-09 12:38:05 +02:00
|
|
|
instance. Changing this forces a new resource to be created.
|
|
|
|
|
2016-06-25 19:42:01 +02:00
|
|
|
* `security_group_names` - (Optional) List of security group names to apply to
|
|
|
|
this instance. Changing this forces a new resource to be created.
|
|
|
|
|
2015-06-09 12:38:05 +02:00
|
|
|
* `project` - (Optional) The name or ID of the project to deploy this
|
|
|
|
instance to. Changing this forces a new resource to be created.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2015-07-16 17:40:04 +02:00
|
|
|
* `zone` - (Required) The name or ID of the zone where this instance will be
|
|
|
|
created. Changing this forces a new resource to be created.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2015-06-09 12:38:05 +02:00
|
|
|
* `user_data` - (Optional) The user data to provide when launching the
|
|
|
|
instance.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2015-06-09 12:38:05 +02:00
|
|
|
* `keypair` - (Optional) The name of the SSH key pair that will be used to
|
|
|
|
access this instance.
|
2015-06-03 12:40:53 +02:00
|
|
|
|
2014-12-10 22:20:52 +01:00
|
|
|
* `expunge` - (Optional) This determines if the instance is expunged when it is
|
|
|
|
destroyed (defaults false)
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The instance ID.
|
|
|
|
* `display_name` - The display name of the instance.
|