Manage Filesystems
This guide provides an overview of how to create, resize, attach, and delete filesystems.
Create a Filesystem
The region must support the filesystems:create
capability in order to create a filesystem.
- CLI
- API
Use the fluidctl filesystems create
command to create a new filesystem. Supported units are Gi
and Ti
. For example:
fluidctl filesystems create --name test --size "100Gi"
--name
: The name of the filesystem.--size
: The size of the filesystem.
To create a filesystem via the API, send a POST
request to the /filesystems
endpoint:
POST /filesystems HTTP/1.1
Host: <your-cluster-url>
Authorization: Bearer <your-auth-token>
Content-Type: application/json
{
"name": "test",
"size": "100Gi"
}
Attach a Filesystem
You can attach a filesystem to an instance during instance creation. This ensures the filesystem is mounted and available for use as soon as the instance is launched.
- CLI
- API
Use the fluidctl instances create
command with the --filesystem
flag to attach a filesystem during instance creation. For example:
fluidctl instances create \
--name test \
--type cpu.8x \
--filesystem id=<filesystem-id>
--filesystem
: The filesystem to attach to the instance.
To attach a filesystem during instance creation via the API, include the filesystems
field in the POST
request to the /instances
endpoint:
POST /instances HTTP/1.1
Host: <your-cluster-url>
Authorization: Bearer <your-auth-token>
Content-Type: application/json
{
"name": "test",
"type": "cpu.8x",
"filesystems": ["<filesystem-id>"]
}
Resize a Filesystem
It is not possible to shrink a filesystem once it has been grown. Ensure you allocate the correct size before resizing.
- CLI
- API
Use the fluidctl filesystems update
command to update a filesystem. For example:
fluidctl filesystems update --id <uuid> --size "200Gi"
--id
: The ID of the filesystem to update.--name
: The name of the filesystem to update.--size
: The new size of the filesystem in GB.
To resize a filesystem via the API, send a PUT
request to the /filesystems/{id}
endpoint:
PUT /filesystems/<uuid> HTTP/1.1
Host: <your-cluster-url>
Authorization: Bearer <your-auth-token>
Content-Type: application/json
{
"name": "test",
"size": "200Gi"
}
Delete a Filesystem
The region must support the filesystems:delete
capability in order to delete a filesystem.
Deleting a filesystem is irreversible. Any data stored on the filesystem will be permanently lost and cannot be recovered. Ensure you back up any important data before proceeding.
- CLI
- API
Use the fluidctl filesystems delete
command to delete a filesystem. For example:
fluidctl filesystems delete --id <uuid>
--id
: The ID of the filesystem to delete.
To delete a filesystem via the API, send a DELETE
request to the /filesystems/{id}
endpoint:
DELETE /filesystems/<uuid> HTTP/1.1
Host: <your-cluster-url>
Authorization: Bearer <your-auth-token>