Storage Management

Storageclass

General

A storageclass (StorageClass) is a configuration template used in Kubernetes to dynamically create PVCs. It defines the properties of a PVC, the creation policy, and the required storage plug-in.

Creating Storageclasses

In the ZStack Zaku main menu, click Cluster Management > Storage Management > Storageclass. On the Storageclass page, click Create Storageclass and the Create Storageclass page is displayed.

The following two creation methods are supported:

  • Create from YAML: enter the YAML for the storage class and click OK to create it.
  • Create from Form: create a storage class based on a local storage pool by configuring the following parameters:
    • Name: set the name of the storage class. The name must be 1 to 50 characters long and contain only lowercase letters, digits, and hyphens (-). It must start with a lowercase letter and end with a lowercase letter or digit.
    • Storage Type: Local Storage.
      Note: A local pvc is bound to its node and cannot be shared or migrated across nodes. Local storage is not available for integrated clusters.
    • Storage Pool: click Select Storage Pool and select a local storage pool based on the storage mode and disk medium.
      Note:
      • Storage pools that are abnormal, have an unknown status, or are expanding cannot be used to create storage classes.
      • LVM mode supports pvc expansion; Device mode does not.
    • File System: select the file system for pvcs created using this storage class. The default is ext4; xfs is also available. ext4 is suitable for most scenarios, while xfs is suitable for large files and highly concurrent read/write operations.
    • Reclaim Policy: select how the persistent volume and its storage resources are handled after the persistent volume claim (PVC) is deleted. The default is Delete.
      • Delete: automatically reclaim the corresponding persistent volume and storage resources.
      • Retain: preserve the corresponding persistent volume and data for the administrator to handle manually.
    After completing the configuration, click OK to create the storage class.
    Note: Storage classes created using the form use delayed binding (WaitForFirstConsumer): binding is completed when a pod first uses the pvc. The access mode is ReadWriteOnce, which allows read/write access from a single node only.

Managing Storageclasses

In the ZStack Zaku main menu, click Cluster Management > Storage Management > Storageclass to enter the Storageclass page.

Storageclasses support the following operations:
Operation Description
Create Storageclass Create a new storageclass.
Update Yaml Update the storage class using YAML.
Note: For storage classes of the Local Storage type, you can only view the YAML. Updating is not supported.
View Yaml View the YAML configuration of a storage class of the Local Storage type.
storage class details Click a storage class name to view basic information such as its storage type, provisioner, reclaim policy, and volume binding mode. For local storage classes, you can also view the file system. On the pvc tab, view the associated pvcs. For pvc management operations, see Managing PVCs.
Delete Storageclass Delete the storageclass.
Note:
  • Before deleting a storageclass, make sure that no PVC or persistent volume (PersistentVolume) created based on this storageclass exists in the cluster.
  • After the storageclass is deleted, it can no longer be used to create PVCs. If there is no other storageclass in the cluster, you cannot create PVCs. Perform this operation with caution.

Local Storage

General

Local storage organizes local disks on cluster nodes into storage pools and provides persistent storage for workloads through storage classes.

Local storage supports the following two storage modes:

  • LVM: groups disks on a node into a volume group and allocates storage space based on the capacity requested by each pvc. This mode supports pvc expansion.
  • Device: allocates an entire disk exclusively to one pvc. This mode does not support pvc expansion.
Note:
  • The admin user and administrators can create and manage local storage. Local storage is not available for integrated clusters.
  • Each node has independent storage capacity. A local pvc is bound to its node and cannot be shared or migrated across nodes.
  • Local storage does not provide multiple data replicas or automatic fault recovery. A node or disk failure may prevent the associated services from accessing data.

Creating Local Storage Pools

In the ZStack Zaku main menu, click cluster management > storage management > Local Storage. On the Local Storage page, select a cluster and click Create Local Storage Pool. The Create Local Storage Pool page is displayed.

Configure the following settings:

  • Name: set the name of the local storage pool. The name must be 1 to 50 characters long and contain only lowercase letters, digits, and hyphens (-). It must start with a lowercase letter and end with a lowercase letter or digit. The name must be unique within the cluster and cannot be changed after creation.
  • Description: optional. Enter information about the local storage pool, up to 256 characters.
  • Storage Mode: select how local disks are allocated. LVM and Device are supported. LVM allocates space based on the capacity requested by each pvc; Device allocates an entire disk exclusively to one pvc.
    Note: If a volume group name conflict is reported, change the storage pool name. If you need to remove the existing volume group, first make sure that its data no longer needs to be retained.
  • Disk Medium: select HDD or SSD. All disks in a storage pool must use the same medium. HDDs are suitable for capacity-oriented storage, while SSDs are suitable for scenarios that require low latency and high read/write performance.
    Note: A cluster can have only one Device local storage pool for each disk medium.
  • Nodes and Disks: click Select Nodes and Disks, expand a node, select the disks to add to the storage pool, and click OK. You can select multiple nodes and multiple disks on each node.
    Note:
    • Each node must have the compute node role, be in the Running state, and have a Node Storage Management Status of Normal.
    • Select unused non-system disks that match the selected disk medium and are in the Normal state. If no disks are available, select another node or change the disk medium.
    • After changing the storage mode or disk medium, select the nodes and disks again.

After completing the configuration, click OK to create the local storage pool.

Managing Local Storage

In the ZStack Zaku main menu, click cluster management > storage management > Local Storage to enter the Local Storage page, and select a cluster.

Local storage supports the following operations:

Operation Description
Create Local Storage Pool Create a local storage pool. For details, see Creating Local Storage Pools.
Expand Add nodes and disks to the storage pool. Click Expand, select one of the following expansion methods, and select the resources to add under Nodes and Disks:
  • Add Nodes and Disks: select nodes that are not yet in the current storage pool and select their disks.
  • Add Disks to Existing Nodes: add disks to nodes that are already in the current storage pool.
You can change the description during expansion, but not the name, storage mode, or disk medium. For node and disk selection requirements, see Creating Local Storage Pools.
Note:
  • Only storage pools in the Running state can be expanded.
  • You can only add nodes and disks. Removing nodes or disks from a storage pool is not supported.
  • After changing the expansion method, select the nodes and disks to add again.
Local Storage Pool Details Click a storage pool name to open its details page and view the following information:
  • Overview: view basic information such as the storage pool status, storage mode, disk medium, number of nodes, and number of disks.
    Note: A storage pool in the Running state may still contain abnormal nodes or disks. Check the resource status under Nodes and Disks to determine whether the storage pool is available.
  • Nodes and Disks: view nodes in the storage pool, their Node Storage Management Status, and storage usage. Expand a node to view its disks. LVM mode displays the used and total capacity for each node; Device mode displays the used and total number of disks for each node.
    Note: Device mode allocates an entire disk to a pvc. Even if the requested capacity is smaller than the disk capacity, the disk cannot be allocated to another pvc.
  • storage class: view the associated storage classes. For storage class management operations, see Managing Storageclasses.
Delete Delete the local storage pool and remove its configuration and storage information from the associated disks.
Note:
  • Before deletion, make sure that there are no associated storage classes, pvcs, persistent volumes, or snapshots, and that all pvc and snapshot operations have completed. If resources are still reported as in use, contact the administrator to clean up the remaining storage resources.
  • A storage pool in the expanding state cannot be deleted. Wait for expansion to complete.
  • Deletion cannot be undone. Make sure that the data no longer needs to be retained.
  • If any nodes or disks are abnormal or have an unknown status, it is recommended to restore them before deletion. If you proceed with deletion, storage information may remain on inaccessible nodes or disks. An administrator must clean up this information before the nodes or disks can be reused.