Volume
volume
Allows you to create, update or remove a volume from a Ionos datacenter.
Example Syntax
Returned object
For more examples please check out the tests here.
NOTE: If you are using a versions 7.0.0 and up: modules can replace resources if certain set parameters differ from the results found in the API!
Parameters that can trigger a resource replacement:
size
disk_type
availability_zone
licence_type
user_data (Might trigger replace just by being set as this parameter is retrieved from the API as the image ID, so when using an alias it will always cause a resource replacement!)
image (Might trigger replace just by being set as this parameter is retrieved from the API as the image ID, so when using an alias it will always cause a resource replacement!)
image_password (Will trigger replace just by being set as this parameter cannot be retrieved from the api to check for changes!)
ssh_keys (Will trigger replace just by being set as this parameter cannot be retrieved from the api to check for changes!)
backupunit (Will trigger replace just by being set as this parameter cannot be retrieved from the api to check for changes!)
state: present
Available parameters for state present:
Name | Required | Description |
---|---|---|
datacenter str | True | The datacenter in which to create the volumes. |
server str | False | The server to which to attach the volume. |
name str | True | The name of the resource. |
size int | False | The size of the volume in GB. |
bus str | False | The bus type for this volume; default is VIRTIO. Default: VIRTIO Options: ['VIRTIO', 'IDE', 'UNKNOWN'] |
image str | False | Image or snapshot ID to be used as template for this volume. |
image_password str | False | Initial password to be set for installed OS. Works with public images only. Not modifiable, forbidden in update requests. Password rules allows all characters from a-z, A-Z, 0-9. |
ssh_keys list | False | Public SSH keys are set on the image as authorized keys for appropriate SSH login to the instance using the corresponding private key. This field may only be set in creation requests. When reading, it always returns null. SSH keys are only supported if a public Linux image is used for the volume creation. |
disk_type str | False | The disk type of the volume. Options: ['HDD', 'SSD', 'SSD Premium', 'SSD Standard'] |
licence_type str | False | OS type for this volume. Options: ['UNKNOWN', 'WINDOWS', 'WINDOWS2016', 'WINDOWS2022', 'RHEL', 'LINUX', 'OTHER'] |
availability_zone str | False | The availability zone in which the volume should be provisioned. The storage volume will be provisioned on as few physical storage devices as possible, but this cannot be guaranteed upfront. This is uavailable for DAS (Direct Attached Storage), and subject to availability for SSD. Options: ['AUTO', 'ZONE_1', 'ZONE_2', 'ZONE_3'] |
count int | False | The number of volumes you wish to create. Default: 1 |
backupunit str | False | The ID of the backup unit that the user has access to. The property is immutable and is only allowed to be set on creation of a new a volume. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property. |
user_data str | False | The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on creation of a new a volume. It is mandatory to provide either 'public image' or 'imageAlias' that has cloud-init compatibility in conjunction with this property. |
cpu_hot_plug bool | False | Hot-plug capable CPU (no reboot required). |
ram_hot_plug bool | False | Hot-plug capable RAM (no reboot required). |
nic_hot_plug bool | False | Hot-plug capable NIC (no reboot required). |
nic_hot_unplug bool | False | Hot-unplug capable NIC (no reboot required). |
disc_virtio_hot_plug bool | False | Hot-plug capable Virt-IO drive (no reboot required). |
disc_virtio_hot_unplug bool | False | Hot-unplug capable Virt-IO drive (no reboot required). Not supported with Windows VMs. |
allow_replace bool | False | Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False |
api_url str | False | The Ionos API base URL. |
certificate_fingerprint str | False | The Ionos API certificate fingerprint. |
username str | False | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
password str | False | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
token str | False | The Ionos token. Overrides the IONOS_TOKEN environment variable. |
wait bool | False | Wait for the resource to be created before returning. Default: True Options: [True, False] |
wait_timeout int | False | How long before wait gives up, in seconds. Default: 600 |
state str | False | Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update'] |
state: absent
Available parameters for state absent:
Name | Required | Description |
---|---|---|
datacenter str | True | The datacenter in which to create the volumes. |
name str | False | The name of the resource. |
instance_ids list | False | list of instance ids or names. Should only contain one ID if renaming in update state Default: |
api_url str | False | The Ionos API base URL. |
certificate_fingerprint str | False | The Ionos API certificate fingerprint. |
username str | False | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
password str | False | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
token str | False | The Ionos token. Overrides the IONOS_TOKEN environment variable. |
wait bool | False | Wait for the resource to be created before returning. Default: True Options: [True, False] |
wait_timeout int | False | How long before wait gives up, in seconds. Default: 600 |
state str | False | Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update'] |
state: update
Available parameters for state update:
Name | Required | Description |
---|---|---|
datacenter str | True | The datacenter in which to create the volumes. |
name str | False | The name of the resource. |
size int | False | The size of the volume in GB. |
bus str | False | The bus type for this volume; default is VIRTIO. Default: VIRTIO Options: ['VIRTIO', 'IDE', 'UNKNOWN'] |
availability_zone str | False | The availability zone in which the volume should be provisioned. The storage volume will be provisioned on as few physical storage devices as possible, but this cannot be guaranteed upfront. This is uavailable for DAS (Direct Attached Storage), and subject to availability for SSD. Options: ['AUTO', 'ZONE_1', 'ZONE_2', 'ZONE_3'] |
instance_ids list | False | list of instance ids or names. Should only contain one ID if renaming in update state Default: |
cpu_hot_plug bool | False | Hot-plug capable CPU (no reboot required). |
ram_hot_plug bool | False | Hot-plug capable RAM (no reboot required). |
nic_hot_plug bool | False | Hot-plug capable NIC (no reboot required). |
nic_hot_unplug bool | False | Hot-unplug capable NIC (no reboot required). |
disc_virtio_hot_plug bool | False | Hot-plug capable Virt-IO drive (no reboot required). |
disc_virtio_hot_unplug bool | False | Hot-unplug capable Virt-IO drive (no reboot required). Not supported with Windows VMs. |
allow_replace bool | False | Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False |
api_url str | False | The Ionos API base URL. |
certificate_fingerprint str | False | The Ionos API certificate fingerprint. |
username str | False | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
password str | False | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
token str | False | The Ionos token. Overrides the IONOS_TOKEN environment variable. |
wait bool | False | Wait for the resource to be created before returning. Default: True Options: [True, False] |
wait_timeout int | False | How long before wait gives up, in seconds. Default: 600 |
state str | False | Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update'] |
Last updated