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.
|
|
|
|
---
|
|
|
|
|
|
|
|
# cloudstack\_instance
|
|
|
|
|
|
|
|
Creates and automatically starts a virtual machine based on a service offering,
|
|
|
|
disk offering, and template.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "cloudstack_instance" "web" {
|
2015-01-13 11:28:05 +01:00
|
|
|
name = "server-1"
|
|
|
|
service_offering= "small"
|
|
|
|
network = "network-1"
|
|
|
|
template = "CentOS 6.5"
|
|
|
|
zone = "zone-1"
|
2014-12-10 22:20:52 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) The name of the instance. Changing this forces a new
|
|
|
|
resource to be created.
|
|
|
|
|
|
|
|
* `display_name` - (Optional) The display name of the instance.
|
|
|
|
|
2015-04-29 11:21:37 +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
|
|
|
|
2015-04-29 11:21:37 +02:00
|
|
|
* `network` - (Optional) The name or ID of the network to connect this instance to.
|
2014-12-10 22:20:52 +01:00
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
|
|
|
* `ipaddress` - (Optional) The IP address to assign to this instance. Changing
|
|
|
|
this forces a new resource to be created.
|
|
|
|
|
2015-04-29 11:21:37 +02:00
|
|
|
* `template` - (Required) The name or ID of the template used for this instance.
|
2014-12-10 22:20:52 +01:00
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
|
|
|
* `zone` - (Required) The name of the zone where this instance will be created.
|
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
|
|
|
* `user_data` - (Optional) The user data to provide when launching the instance.
|
|
|
|
|
2015-06-03 12:40:53 +02:00
|
|
|
* `keypair` - (Optional) The name of the SSH keypair that will be used to access this instance.
|
|
|
|
|
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.
|