Table: hcloud_volume - Query Hetzner Cloud Volumes using SQL
A Volume in Hetzner Cloud is a block storage device that can be attached to a server in the same location. Volumes are independent resources that persist beyond the life of any server. They can be dynamically resized and moved between servers.
Table Usage Guide
The hcloud_volume
table provides insights into Volumes within Hetzner Cloud. As a Cloud engineer, explore volume-specific details through this table, including size, location, and attached server. Utilize it to uncover information about volumes, such as those with larger sizes, the servers they are attached to, and their geographical locations.
Examples
List all volumes
Explore all the storage volumes in your infrastructure, ordered by their names, to gain insights into their creation timeline and manage resources effectively. This can be useful in assessing the utilization of storage resources and planning for future capacity needs.
select id, name, createdfrom hcloud_volumeorder by name;
select id, name, createdfrom hcloud_volumeorder by name;
List volumes with location data
Explore which volumes are associated with specific locations in your Hetzner Cloud environment. This can be useful in managing resources and understanding data distribution across different geographical areas.
select v.name as volume_name, l.name as location_namefrom hcloud_volume as v, hcloud_location as lwhere v.location_id = l.id;
select v.name as volume_name, l.name as location_namefrom hcloud_volume as v, hcloud_location as lwhere v.location_id = l.id;
Largest volumes
Discover the top five largest storage volumes in your cloud environment to better manage resource allocation and utilization. This can help in identifying potential areas for cost savings or performance improvements.
select id, name, sizefrom hcloud_volumeorder by size desclimit 5;
select id, name, sizefrom hcloud_volumeorder by size desclimit 5;
Schema for hcloud_volume
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
created | timestamp with time zone | Point in time when the Volume was created. | |
format | text | Filesystem of the Volume if formatted on creation, null if not formatted on creation. | |
id | bigint | = | ID of the Volume. |
labels | jsonb | User-defined labels (key-value pairs). | |
linux_device | text | Device path on the file system for the Volume. | |
location_id | bigint | Location of the Volume. Volume can only be attached to Servers in the same Location. | |
name | text | = | Name of the Volume. Must be unique per Project. |
protection | jsonb | Protection configuration for the Volume. | |
server_id | bigint | ID of the Server the Volume is attached to, null if it is not attached at all. | |
size | bigint | Size in GB of the Volume. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | = | Status of the volume: creating, available. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- hcloud
You can pass the configuration to the command with the --config
argument:
steampipe_export_hcloud --config '<your_config>' hcloud_volume