Menu

CLI — Storage

metalhost disk and metalhost file-share (also under metalhost storage disk …) manage persistent data volumes.

Block disks

CommandWhat it does
disk listList disks in the project.
disk get NAMEGet a disk.
disk create --size-gib N --region DCCreate a disk (--from-image-url to hydrate).
disk resize NAME --size-gib NGrow a disk (no shrink).
disk attach NAME --vm VMHot-attach to a running VM.
disk detach NAMEDetach from VM.
disk delete NAMEDelete (must be detached).
metalhost disk create --size-gib 100 --region datacenters/us-dal-1
metalhost disk attach projects/my-app/disks/data-1 --vm web-1
metalhost disk resize projects/my-app/disks/data-1 --size-gib 200

Single-disk backups (v1.1.0)

metalhost disk backup create projects/my-app/disks/data-1 --display-name before-upgrade --idempotency-key capture-1
metalhost disk backup list --project projects/my-app --all
metalhost disk backup get disk-snapshots/ID
metalhost disk create --project projects/my-app --from-backup disk-snapshots/ID --id restored-data --size-gib 100 --region datacenters/us-dal-1 --network projects/my-app/networks/default

Wait for READY before restoring. Use the source backup's project, network, datacenter and storage tier, and at least its reported size. The restored disk is a new, separately billed resource; poll disk get until AVAILABLE. Reuse the same --id when retrying a restore. disk backup delete NAME prompts before permanent deletion.

Automatic schedules (v1.1.0)

metalhost storage backup-schedule create --project projects/my-app --target virtual-machines/ID --cadence daily --hour-utc 3 --keep 7 --idempotency-key schedule-1
metalhost storage backup-schedule list --project projects/my-app --all
metalhost storage backup-schedule update snapshot-schedules/ID --enabled=false
metalhost storage backup-schedule update snapshot-schedules/ID --keep 3
metalhost storage backup-schedule delete snapshot-schedules/ID

CLI schedules use fixed UTC times: --cadence hourly|daily|weekly, --minute-utc 0..59, --hour-utc 0..23, and --weekday-utc 0..6 (Sunday=0). Omit the target to cover every VM and each unattached disk in the selected project. Updates affect only supplied fields. Deleting a schedule keeps its backups; keep-N retention never prunes manual copies. Leave quota headroom for the next successful copy.

File shares

CommandWhat it does
file-share listList NFS shares.
file-share create --size-gib N --region DCCreate an NFSv4 share.
file-share delete NAMEDelete a share.

The create response includes a mount_command — paste into cloud-init or run on the VM.

What's next