Creating block volumes
To store, organize, and manage data independently from compute resources, you can create a block storage volume by using the UI, CLI, API or Terraform.
By creating volumes, you can allocate storage capacity as needed, support data persistence, and enable flexible data management for your workloads.
Creating block volumes in the UI
Use the IBM Cloud console to create a volume for a deployment.
-
In the IBM Cloud console
, access your deployment and then go to Block storage > Volumes.
-
Click Create volume.
-
Select Deployment where the volume will be created.
-
Specify a unique, meaningful Name for your volume. The volume names can include a combination of lowercase alpha-numeric characters (a-z, 0-9) and the hyphen (-), up to 63 characters. Volume names must begin with a lowercase letter. It must not begin with a hypen or a number nor end with a hyphen. You can later edit the name if you want.
Volume names must be unique in the entire deployment. If you create two volumes that are in the same deployment, and have the same name, a "volume name duplicate" error is displayed.
-
Enter the Storage size for the volume in GBs. Volume sizes can be between 1 GB and 32 TBs.
-
Select one or more hosts to map. This is an optional step.
- If you choose to create a new host, then enter the new Host name, Host NQN and click Create host. The new Host is added to the beginning of the list. For guidance on how to find the
host nqn, see Configuring NVMe-oF initiators. - Select the newly created Host from the list.
- If you choose to create a new host, then enter the new Host name, Host NQN and click Create host. The new Host is added to the beginning of the list. For guidance on how to find the
-
Click Create. Once the volume creation is successful, you will be redirectred to the volumes main page where you can see the status of the newly created volume under the volume table.
During the new volume creation, the volume is in Pending state. The status changes to Available or Failed based on the actual state of the volume.
Creating block volumes from the CLI
To create volumes by using the command-line interface (CLI), run the following command.
ibmcloud software-defined-storage volume-create --capacity CAPACITY [--name NAME] --url string
Provide the CAPACITY of the volume, NAME of the volume and endpoint url.
The volume names can include a combination of lowercase alpha-numeric characters (a-z, 0-9) and the hyphen (-), up to 63 characters. Volume names must begin with a lowercase letter. It must not begin with a hypen or a number nor end with a hyphen.
If you create two volumes with the same name in the same deployment and region, a volume name duplicate error is displayed.
See the following example.
ibmcloud sds volume-create \
--capacity 10 \
--name my-volume
...
Volume_ID r134-279863d6-c37b-4601-b586-80f6dac215c2
Volume_Name my-volume
Status pending
Capacity_GB 10
Created 2025-02-27T10:21:05.000Z
Bandwidth 19
IOPS 150
Hosts -
Capacity, indicated in gigabytes, can range from minimum 1 GB to the maximum allocated capacity for block storage.
The $sds_endpoint is an environment variable that points to the endpoint provided to you when IBM Storage Ceph as a Service was configured. It is in the URL form. For example, https://sds-cephaas.<cephaas-instance-id>.software-defined-storage.appdomain.cloud:{port number}/v1.
You can set the URL once and then not have to add it for every command. For guidance on how to set the URL, see Config commands.
You can also use the alias sds as an alternative to software-defined-storage and volc as an alternative to volume-create for the CLI actions.
Creating block volumes with the API
You can create volumes by directly calling the Block storage REST API.
Define variables for the IAM token and API endpoint. For instructions, see Setting up your API and CLI environment.
Make a POST /volumes request to create a new block volume. Specify capacity and volume name. Volume name is optional.
curl -X POST $sds_endpoint/volumes\
-H "accept: application/json"\
-H "Authorization: Bearer $IAM_TOKEN"\
-H "IBM-API-Version: 2025-02-01"\
--data '{
"capacity": 10,
"name": "sandbox-stability-pasta-stroller"
}'
The $sds_endpoint is an environment variable that points to the endpoint provided to you whenIBM Storage Ceph as a Service was configured. It is in the URL form. For example, https://sds-cephaas.<cephaas-instance-id>.software-defined-storage.appdomain.cloud:{port number}/v1.
You can set the URL once and then not have to add it for every command. For guidance on how to set the URL, see Config commands.
The volume names can include a combination of lowercase alpha-numeric characters (a-z, 0-9) and the hyphen (-), up to 63 characters. Volume names must begin with a lowercase letter. It must not begin with a hypen or a number nor end with a hyphen.
If you create two volumes with the same name in the same deployment and region, a volume name duplicate error is displayed.
A successful response looks like this:
{
"id": "r134-8cdec173-1bcb-4b85-ada9-a6374a4f5906",
"name": "sandbox-stability-pasta-stroller",
"capacity": 10,
"iops": 150,
"status": "pending",
"created_at": "2025-02-27T10:18:01Z",
"status_reasons": [],
"bandwidth": 19,
"resource_type": "volume",
"href": "$sds_endpoint/volumes/r134-8cdec173-1bcb-4b85-ada9-a6374a4f5906"
}
Creating block volumes using Terraform
-
Create a volume instance by using the
ibm_sds_volumeresource argument in yourmain.tffile. The volume instance in the following example is namedsds_volume_instancerespectively.resource "ibm_sds_volume" "sds_volume_instance" { capacity = 10 name = "demo-volume" } -
After you finish building your configuration file, initialize the Terraform CLI. For more information, see Initializing Working Directories.
terraform init -
Provision the resources from the
main.tffile. For more information, see Provisioning Infrastructure with Terraform.-
Run
terraform planto generate a Terraform execution plan to preview the proposed actions.terraform plan -
Run
terraform applyto create the resources that are defined in the plan.terraform apply
-
-
Respond to "Do you want to perform these actions?" with "Yes" to proceed with creating the volume.
See the example output for details.
ibm_sds_volume.sds_volume_instance_1: Creating... ibm_sds_volume.sds_volume_instance_1: Creation complete after 1s [id=r134-5f36534a-71a1-4e53-ae72-5770d2f1ad6f] Apply complete! Resources: 1 added, 0 changed, 0 destroyed. Outputs: ibm_sds_volume = [ { "bandwidth" = 19 "capacity" = 10 "created_at" = "2025-03-10T14:44:34.000Z" "href" = "$sds_endpoint/volumes/r134-5f36534a-71a1-4e53-ae72-5770d2f1ad6f" "id" = "r134-5f36534a-71a1-4e53-ae72-5770d2f1ad6f" "iops" = 150 "name" = "demo-volume-1" "resource_type" = "volume" "status" = "pending" "status_reasons" = tolist([]) "volume_mappings" = tolist([]) }, ]
For more information about the arguments and attributes, see ibm_sds_volume.
The $sds_endpoint is an environment variable that points to the endpoint provided to you when IBM Storage Ceph as a Service was configured. It is in the URL form. For example, https://sds-cephaas.<cephaas-instance-id>.software-defined-storage.appdomain.cloud:{port number}/v1.
Next steps
Refresh the Volumes page. The new volume appears at the beginning of the list of volumes. If the volume was created successfully, it shows status as Available.
You can continue creating more volumes, map volume to hosts or manage existing volumes.