IBM Cloud Docs
Managing Block Storage for Classic

Managing Block Storage for Classic

You can manage your IBM Cloud® Block Storage for Classic volumes in the IBM Cloud® console. From the menu Menu icon, select Classic Infrastructure Classic icon to interact with classic services. You can also manage your volumes from the CLI, with the API or Terraform.

Viewing Block Storage for Classic LUN details in the UI

You can view a summary of the key information for the selected storage LUN including extra snapshot and replication capabilities that were added to the storage.

  1. Click Storage > Block Storage for Classic.
  2. Click the appropriate Volume name from the list.

Viewing Block Storage for Classic LUN details from the CLI

Before you begin, decide on the CLI client that you want to use.

Viewing Block Storage for Classic LUN details from the IBMCLOUD CLI

Use the ibmcloud sl block volume-detail command to view the details of a specific block volume from the CLI.

$ ibmcloud sl block volume-detail  562193766
Name                       Value
ID                         562193766
User name                  SL02SEL1414935-675
Type                       endurance_block_storage
Capacity (GB)              80
LUN Id                     0
Endurance Tier             LOW_INTENSITY_TIER
Endurance Tier Per IOPS    0.25
Datacenter                 dal09
Target IP                  10.2.125.62
Snapshot Size (GB)         20
Snapshot Used (Bytes)      -
# of Active Transactions   0
Replicant Count            0
Notes                      -

For more information about all of the parameters that are available for this command, see ibmcloud sl block volume-detail.

Viewing Block Storage for Classic LUN details from the SLCLI

To view information about a Storage LUN, you can use the following command from the CLI.

$ slcli block volume-detail --help
Usage: slcli block volume-detail [OPTIONS] VOLUME_ID

Options:
  -h, --help  Show this message and exit.

Authorizing hosts to access Block Storage for Classic in the UI

"Authorized" hosts are hosts that were given access to a particular LUN. Without host authorization, you can't access or use the storage from your system. Authorizing a host to access your LUN generates the username, password, and iSCSI qualified name (IQN), which are needed to mount the multipath I/O (MPIO) iSCSI connection.

You can authorize and connect hosts that are located in the same data center as your storage. You can have multiple accounts, but you can't authorize a host from one account to access your storage on another account.

  1. Click Storage > Block Storage for Classic.
  2. Locate the volume and click the ellipsis Actions icon.
  3. Click Authorize Host.
  4. To see the list of available devices or IP addresses, first, select whether you want to authorize access based on device type or subnets.
    • If you choose the Devices option, you can select from Bare Metal Server or virtual server instances.
    • If you choose the IP address option, select the subnet where your host resides.
  5. From the filtered list, select one or more hosts that can access the volume and click Save.

The default limit for the number of authorizations per block volume is eight. That means that up to eight hosts can be authorized to access the Block Storage for Classic LUN. Customers who use Block Storage for Classic in their VMware deployment can request the authorization limit to be increased to 64. To request a limit increase, raise a Support case.

Authorizing hosts to access Block Storage for Classic from the CLI

“Authorized” hosts are hosts that were given access to a particular volume. Without host authorization, you can't access or use the storage from your system. Authorizing a host to access your volume generates the username and password.

You can authorize and connect hosts that are located in the same data center as your storage. You can have multiple accounts, but you can't authorize a host from one account to access your storage on another account.

Authorizing hosts from the IBMCLOUD CLI

Use the ibmcloud sl block access-authorize command to authorize a host to access the volume. The following example authorizes the virtual server instance 87654321 to mount the volume 12345678.

ibmcloud sl block access-authorize 12345678 --virtual-id 87654321

For more information about all of the parameters that are available for this command, see ibmcloud sl block access-authorize.

You can also specify a subnet of the Compute instances that are allowed to access the storage by using the following command.

ibmcloud sl block subnets-assign --subnet-id 1234 87654321

Authorizing hosts from the SLCLI

To authorize a host to access the volume, you can use the following command.

$ slcli block access-authorize --help
Usage: slcli block access-authorize [OPTIONS] VOLUME_ID

Options:
  -h, --hardware-id TEXT    The ID of a hardware server to authorize.
  -v, --virtual-id TEXT     The ID of a virtual server to authorize.
  -i, --ip-address-id TEXT  The ID of an IP address to authorize.
  -p, --ip-address TEXT     An IP address to authorize.
  --help                    Show this message and exit.
$ slcli block subnets-list -h
Usage: slcli block subnets-list [OPTIONS] ACCESS_ID
  List block storage assigned subnets for the given host id.
  access_id is the host_id obtained by: slcli block access-list <volume_id>

Options:
    -h, --help  Show this message and exit.
$ slcli block subnets-assign -h
Usage: slcli block subnets-assign [OPTIONS] ACCESS_ID
  Assign block storage subnets to the given host id.
  access_id is the host_id obtained by: slcli block access-list <volume_id>

Options:
  --subnet-id INTEGER  ID of the subnets to assign; e.g.: --subnet-id 1234
  -h, --help           Show this message and exit.
$ slcli block subnets-remove -h
Usage: slcli block subnets-remove [OPTIONS] ACCESS_ID
  Remove block storage subnets for the given host id.
  access_id is the host_id obtained by: slcli block access-list <volume_id>

Options:
  --subnet-id INTEGER  ID of the subnets to remove; e.g.: --subnet-id 1234
  -h, --help           Show this message and exit.

The default limit for the number of authorizations per block volume is eight. That means that up to eight hosts can be authorized to access the Block Storage for Classic LUN. Customers who use Block Storage for Classic in their VMware deployment can request the authorization limit to be increased to 64. To request a limit increase, raise a Support case.

Authorizing hosts to access Block Storage for Classic with Terraform

"Authorized" hosts are hosts that were given access to a particular LUN. Without host authorization, you can't access or use the storage from your system. Authorizing a host to access your LUN generates the username, password, and iSCSI qualified name (IQN), which are needed to mount the multipath I/O (MPIO) iSCSI connection.

You can authorize and connect hosts that are located in the same data center as your storage. You can have multiple accounts, but you can't authorize a host from one account to access your storage on another account.

To authorize a Compute host to access the volume, use the ibm_storage_block resource and specify the allowed_virtual_guest_ids for virtual servers, or allowed_hardware_ids for bare metal servers. Specify allowed_ip_addresses to define which IP addresses have access to the storage.

The following example defines that the virtual server with the ID 27699397 can access the volume from the 10.40.98.193, 10.40.98.200 addresses.

resource "ibm_storage_block" "test1" {
        type = "Endurance"
        datacenter = "dal09"
        capacity = 40
        iops = 4
        os_format_type = "Linux"

        # Optional fields
        allowed_virtual_guest_ids = [ 27699397 ]
        allowed_ip_addresses = ["10.40.98.193", "10.40.98.200"]
        snapshot_capacity = 10
        hourly_billing = true
}

For more information about the arguments and attributes, see ibm_storage_block.

The default limit for the number of authorizations per block volume is eight. That means that up to eight hosts can be authorized to access the Block Storage for Classic LUN. Customers who use Block Storage for Classic in their VMware deployment can request the authorization limit to be increased to 64. To request a limit increase, raise a Support case.

To remove authorization from a host, remove its details from the ibm_storage_block resource and apply your changes.

Viewing the list of hosts that are authorized to access a Block Storage for Classic LUN in the UI

  1. Click Storage > Block Storage for Classic, and click your Volume name.
  2. Click Authorized Hosts to display the list of Compute instances that have access to the volume.

There you can see the list of hosts, which are currently authorized to access the LUN. You can also see the authentication information that is needed to make a connection – username, password, and IQN Host. The Target address is listed on the Storage Detail page. For NFS, the Target address is described as a DNS name, and for iSCSI, it's the IP address of the Discover Target Portal.

Viewing the list of hosts that are authorized to access a Block Storage for Classic LUN from the CLI

Viewing the list of authorized hosts from the IBMCLOUD CLI

To confirm that the authorization worked, run the ibmcloud sl block access-list command.

ibmcloud sl block access-list 12345678 --sortby id 

Viewing the list of authorized hosts from the SLCLI

To see the list of hosts, which are currently authorized to access the LUN, you can use the following command.

$ slcli block access-list --help
Usage: slcli block access-list [OPTIONS] VOLUME_ID

Options:
  --sortby TEXT   Column to sort by
  --columns TEXT  Columns to display. Options: id, name, type,
                  private_ip_address, source_subnet, host_iqn, username,
                  password, allowed_host_id
  -h, --help      Show this message and exit.

Viewing the list of hosts that are authorized to access a Block Storage for Classic LUN with Terraform

After your storage resource is created, you can view the access the allowed_host_info attribute, which contains the username, password, and the IQN of the Compute host that are authorized to access the volume.

For more information about the arguments and attributes, see ibm_storage_block.

Viewing the Block Storage for Classic to which a host is authorized in the UI

You can view the LUNs, which a host has access to, including information that is needed to make a connection – LUN Name, Storage Type, Target Address, capacity and location:

  1. Click Devices > Device List in the IBM Cloud® console and click the appropriate device.
  2. Select the Storage tab.

You're presented with a list of storage volumes that this particular host has access to. The list is grouped by storage type (block, file, other). You can authorize more storage or remove access by clicking Actions.

A host cannot be authorized to access volumes of differing OS types at the same time. A host can be authorized to access LUNs of a single OS type. If you attempt to authorize a host to access multiple LUNs with different OS types, the operation results in an error.

Revoking a host's access to Block Storage for Classic in the UI

If you want to stop the access from a host to a particular storage LUN, you can revoke the access. Upon revoking access, the host connection is dropped from the LUN. The operating system and applications on that host can't communicate with the LUN anymore.

To avoid host side issues, unmount the storage LUN from your operating system before you revoke the access to avoid missing drives or data corruption.

You can revoke access from the Device List or the Storage view.

Revoking access from the Device List

  1. In the IBM Cloud® console, click the Classic Infrastructure icon. Then, click Devices > Device List and double-click the appropriate device.
  2. Select the Storage tab.
  3. You are presented with a list of storage LUNs that this particular host has access to. The list is grouped by storage type (block, file, other). Next to the Volume name, click Actions, and click Revoke Access.
  4. Confirm that you want to revoke the access for a LUN because the action can't be undone. Click Yes to revoke LUN access or No to cancel the action.

If you want to disconnect multiple LUNs from a specific host, you need to repeat the Revoke Access action for each LUN.

Revoking access from the Storage View

  1. Click Storage > Block Storage for Classic, and select the LUN from which you want to revoke access.
  2. Click Authorized Hosts.
  3. Click Actions Actions icon next to the host whose access is to be revoked, and select Revoke Access.
  4. Confirm that you want to revoke the access for a LUN because the action can't be undone. Click Yes to revoke LUN access or No to cancel the action.

If you want to disconnect multiple hosts from a specific LUN, you need to repeat the Revoke Access action for each host.

Revoking access from the CLI.

If you want to stop the access from a host to a particular storage LUN, you can revoke the access. Upon revoking access, the host connection is dropped from the LUN. The operating system and applications on that host can't communicate with the LUN anymore.

To avoid host side issues, unmount the storage LUN from your operating system before you revoke the access to avoid missing drives or data corruption.

Revoking access from the IBMCLOUD CLI

Use the following command to revoke access from a Compute host. In the following example, access to the volume 12345678 is revoked from the virtual server instance 87654321.

ibmcloud sl block access-revoke 12345678 --virtual-id 87654321

For more information about all of the parameters that are available for this command, see ibmcloud sl block access-revoke.

Revoking access from the SLCLI

Use the following command to revoke access from a Compute host.

$ slcli block access-revoke --help
Usage: slcli block access-revoke [OPTIONS] VOLUME_ID

Options:
  -h, --hardware-id TEXT    The ID of a hardware server to revoke authorization.
  -v, --virtual-id TEXT     The ID of a virtual server to revoke authorization.
  -i, --ip-address-id TEXT  The ID of an IP address to revoke authorization.
  -p, --ip-address TEXT     An IP address to revoke authorization.
  --help                    Show this message and exit.

Deleting a storage LUN in the UI

If you no longer need a specific LUN, you can delete it at any time.

To cancel a storage LUN, it's necessary to revoke access from any hosts first.

  1. Click Storage > Block Storage for Classic.

  2. Select the volume to be canceled, click Actions, and select Delete Block Storage for Classic.

  3. Confirm if you want to delete the volume immediately or on the anniversary date of when the LUN was provisioned.

    If you select the option to delete the LUN on its anniversary date, you can void the cancellation request before its anniversary date.

  4. Click the Acknowledgment checkbox and click Delete.

When the volume is canceled, the request is followed by a 24-hour reclaim wait period. You can still see the volume in the console during those 24 hours (immediate cancellation) or until the anniversary date. The waiting period gives you a chance to void the cancel request if needed. If you want to cancel the deletion of the volume, raise a Support case. Billing for the volume stops immediately. When the reclaim-period expires, the data is destroyed and the volume is removed from the console, too. For more information, see the FAQ.

Active replicas and dependent duplicates can block reclamation of the Storage volume. Make sure that the volume is no longer mounted, host authorizations are revoked, replication is canceled, and no dependent duplicates exist before you attempt to cancel the original volume.

Deleting a storage LUN from the CLI

If you no longer need a specific LUN, you can cancel it at any time.

To cancel a storage LUN, it's necessary to revoke access from any hosts first.

When the volume is canceled, the request is followed by a 24-hour reclaim wait period. You can still see the volume in the console during those 24 hours (immediate cancellation) or until the anniversary date. The waiting period gives you a chance to void the cancel request if needed. If you want to cancel the deletion of the volume, raise a Support case. Billing for the volume stops immediately. When the reclaim-period expires, the data is destroyed and the volume is removed from the console, too. For more information, see the FAQ.

Active replicas and dependent duplicates can block reclamation of the Storage volume. Make sure that the volume is no longer mounted, host authorizations are revoked, replication is canceled, and no dependent duplicates exist before you attempt to cancel the original volume.

Deleting a storage LUN from the IBMCLOUD CLI

Use the following command to cancel the storage. The following example command cancels the volume 12345678 immediately, instead of on the anniversary date.

ibmcloud sl volume-cancel --immediate 12345678

For more information about all of the parameters that are available for this command, see ibmcloud sl block volume-cancel.

Deleting a storage LUN from the SLCLI

Use the following command in SLCLI to cancel the storage.

$ slcli block volume-cancel --help
Usage: slcli block volume-cancel [OPTIONS] VOLUME_ID

Options:
  --reason TEXT  An optional reason for cancellation
  --immediate    Cancels the block storage volume immediately instead of on
                 the billing anniversary
  -h, --help     Show this message and exit.

Deleting a storage LUN from Terraform

Use the terraform destroy command to conveniently destroy a remote object such as a single volume. The following example shows the syntax of the command.

terraform destroy --target ibm_storage_block.volumeID

For more information, see terraform destroy.

When the volume is canceled, the request is followed by a 24-hour reclaim wait period. You can still see the volume in the console during those 24 hours (immediate cancellation) or until the anniversary date. The waiting period gives you a chance to void the cancel request if needed. If you want to cancel the deletion of the volume, raise a Support case. Billing for the volume stops immediately. When the reclaim-period expires, the data is destroyed and the volume is removed from the console, too. For more information, see the FAQ.

Active replicas and dependent duplicates can block reclamation of the Storage volume. Make sure that the volume is no longer mounted, host authorizations are revoked, replication is canceled, and no dependent duplicates exist before you attempt to cancel the original volume.