2014-12-10 22:20:52 +01:00
|
|
|
---
|
|
|
|
layout: "cloudstack"
|
|
|
|
page_title: "CloudStack: cloudstack_disk"
|
|
|
|
sidebar_current: "docs-cloudstack-resource-disk"
|
|
|
|
description: |-
|
|
|
|
Creates a disk volume from a disk offering. This disk volume will be attached to a virtual machine if the optional parameters are configured.
|
|
|
|
---
|
|
|
|
|
|
|
|
# cloudstack\_disk
|
|
|
|
|
|
|
|
Creates a disk volume from a disk offering. This disk volume will be attached to
|
|
|
|
a virtual machine if the optional parameters are configured.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "cloudstack_disk" "default" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "test-disk"
|
|
|
|
attach = "true"
|
|
|
|
disk_offering = "custom"
|
|
|
|
size = 50
|
2015-11-18 14:41:35 +01:00
|
|
|
virtual_machine = "server-1"
|
2017-02-18 23:48:50 +01:00
|
|
|
zone = "zone-1"
|
2014-12-10 22:20:52 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) The name of the disk volume. Changing this forces a new
|
|
|
|
resource to be created.
|
|
|
|
|
|
|
|
* `attach` - (Optional) Determines whether or not to attach the disk volume to a
|
|
|
|
virtual machine (defaults false).
|
|
|
|
|
2016-07-08 17:16:35 +02:00
|
|
|
* `device_id` - (Optional) The device ID to map the disk volume to within the guest OS.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2015-04-29 11:21:37 +02:00
|
|
|
* `disk_offering` - (Required) The name or ID of the disk offering to use for
|
|
|
|
this disk volume.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
|
|
|
* `size` - (Optional) The size of the disk volume in gigabytes.
|
|
|
|
|
|
|
|
* `shrink_ok` - (Optional) Verifies if the disk volume is allowed to shrink when
|
|
|
|
resizing (defaults false).
|
|
|
|
|
2016-06-27 10:19:00 +02:00
|
|
|
* `virtual_machine_id` - (Optional) The ID of the virtual machine to which you want
|
|
|
|
to attach the disk volume.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2015-08-21 16:59:35 +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.
|
|
|
|
|
2015-04-29 11:21:37 +02:00
|
|
|
* `zone` - (Required) The name or ID of the zone where this disk volume will be available.
|
2014-12-10 22:20:52 +01:00
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the disk volume.
|
2016-07-08 17:16:35 +02:00
|
|
|
* `device_id` - The device ID the disk volume is mapped to within the guest OS.
|