2017-01-18 15:43:09 +01:00
---
layout: "profitbricks"
page_title: "ProfitBricks: profitbricks_server"
2017-01-26 18:28:01 +01:00
sidebar_current: "docs-profitbricks-resource-volume"
2017-01-18 15:43:09 +01:00
description: |-
Creates and manages ProfitBricks Volume objects.
---
# profitbricks\_volume
Manages a Volumes on ProfitBricks
## Example Usage
A primary volume will be created with the server. If there is a need for additional volume, this resource handles it.
2017-04-17 12:17:54 +02:00
```hcl
2017-01-18 15:43:09 +01:00
resource "profitbricks_volume" "example" {
datacenter_id = "${profitbricks_datacenter.example.id}"
2017-02-18 23:48:50 +01:00
server_id = "${profitbricks_server.example.id}"
image_name = "${var.ubuntu}"
size = 5
disk_type = "HDD"
ssh_key_path = "${var.private_key_path}"
bus = "VIRTIO"
2017-01-18 15:43:09 +01:00
}
```
##Argument reference
* `datacenter_id` - (Required) [string] < sup > [1](#myfootnote1)</ sup >
* `server_id` - (Required)[string] < sup > [1](#myfootnote1)</ sup >
* `disk_type` - (Required) [string] The volume type, HDD or SSD.
* `bus` - (Required) [boolean] The bus type of the volume.
* `size` - (Required)[integer] The size of the volume in GB.
2017-02-02 14:26:14 +01:00
* `ssh_key_path` - (Required)[list] List of paths to files containing a public SSH key that will be injected into ProfitBricks provided Linux images. Required if `image_password` is not provided.
2017-01-18 15:43:09 +01:00
* `image_password` - [string] Required if `sshkey_path` is not provided.
* `image_name` - [string] The image or snapshot ID. It is required if `licence_type` is not provided.
* `licence_type` - [string] Required if `image_name` is not provided.
2017-02-02 14:26:14 +01:00
* `name` - (Optional) [string] The name of the volume.
* `availability_zone` - (Optional) [string] The storage availability zone assigned to the volume. AUTO, ZONE_1, ZONE_2, or ZONE_3