Skip to content

Working with Keys and Storage

Intermediate 15 minutes

Overview

Cloud keys provide credentials for launching machines, while storage resources — object storage, file storage, block storage, volumes, and snapshots — give your formations persistent data. In this tutorial you will manage keys and work with storage from the CLI.

Prerequisites

Steps

Step 1: List Cloud Keys

rh key ls

Each key shows the cloud provider, region, account, and allowed instance types.


Step 2: Create and Manage Cloud Keys

rh key create --label "US East Key"

Set a key as default:

rh key set-default <keyUid>

Share a key:

rh key share <keyUid>

Delete a key:

rh key delete <keyUid>

Step 3: Manage Key Pairs

SSH key pairs for secure access to your machines:

rh keypair ls
rh keypair create --label "My SSH Key"
rh keypair delete <keyPairUid>

Step 4: Object Storage (Buckets)

Create and manage S3 buckets, Azure Blob containers, and GCS buckets:

rh storage ls
rh storage create --label "ML Datasets"
rh storage delete <storageUid>

Browse storage contents:

rh storage browse <storageUid>

Upload and download files:

rh storage put <storageUid> --file /path/to/file
rh storage syncup <storageUid>
rh storage syncdown <storageUid>

Clone or copy storage:

rh storage clone <storageUid>
rh storage copy <storageUid>

Enable CDN or static website hosting:

rh storage cdn-enable <storageUid>
rh storage website-enable <storageUid>

Step 5: Volumes

Managed disk volumes that can be attached to formations:

rh volume ls
rh volume create --label "Data Volume"
rh volume delete <volumeUid>

Create a snapshot from a volume:

rh volume create-snapshot <volumeUid>

Share a volume:

rh volume share <volumeUid>

Step 6: File Storage

Network file systems (EFS, Azure Files, etc.):

rh file-storage ls
rh file-storage create --label "Team NFS"
rh file-storage delete <fileStorageUid>

Step 7: Block Snapshots

Create, manage, and restore from snapshots:

rh snapshot ls
rh snapshot create --label "Pre-upgrade Backup"
rh snapshot clone <snapshotUid>
rh snapshot delete <snapshotUid>

Create a volume from a snapshot:

rh snapshot create-volume <snapshotUid>

Retrieve snapshots from your cloud account:

rh snapshot retrieve

Step 8: Share Storage Resources

All storage types support sharing:

rh storage share <storageUid>
rh volume share <volumeUid>
rh snapshot share <snapshotUid>
rh file-storage share <fileStorageUid>

Next Steps

Troubleshooting

No keys listed

Keys are provisioned from cloud accounts. Ensure your cloud account is connected and has active regions.

Storage creation fails

Check your scope quotas with rh scope ls. You may have reached the maximum storage limit.

How do I attach storage to a formation?

Use the -w (working storage) or -e (reference storage) flags when launching a formation: rh formation launch <uid> -l "label" -w <storageUid>.