Storage Service
In the ZCF architecture, storage services are provided by storage components and exposed to upper-layer workloads through the cloud platform. The cloud platform organizes storage resources into types such as primary storage and backup storage to support VM instances, volumes, images, and container workloads.
The cloud platform supports integration with both centralized and distributed storage. Centralized storage is suitable for scenarios requiring stable storage resources delivered via shared storage devices; distributed storage is suitable for scenarios requiring highly available and scalable storage resource pools built through horizontal expansion across multiple nodes.
Centralized Storage
Centralized storage refers to storing data on a central node composed of one or more servers. All services are centrally deployed on this node, which uniformly manages data for subsidiary nodes. Data access is achieved through a single controller. Centralized storage falls into three categories: DAS, NAS, and SAN. You can select the appropriate type based on your data storage needs.
Functional advantages:
- High Performance and High Reliability: Centralized Storage stores data on a central node composed of one or more servers. It effectively mitigates the risks associated with data fragmentation and enhances both the performance and reliability of the storage system.
- Scalability: Centralized Storage can expand over the network to store more data, allowing the storage system to grow with your business needs.
- Security: Centralized Storage safeguards data security and integrity through security measures such as access control and data encryption.
On architecture: The storage controller is the core component of a centralized storage architecture. Typically, it contains two controllers operating in an active-standby mode to prevent the system-wide failures due to hardware issues. The storage controller features frontend and backend ports. Frontend ports provide storage services to servers, while backend ports expand the storage system capacity. Through backend ports, the storage controller connects to more additional storage devices, forming a large storage pool.
SharedBlock
In centralized storage scenarios, the cloud platform can connect to SAN storage through the Shared Block primary storage type. This method directly uses LUN devices allocated by users on the SAN storage as storage pools, which are then provided to business VM instances. Unlike Shared Mount Point (SMP), another file system-based primary storage type, Shared Block offers advantages such as simplified deployment, flexible scalability, and superior performance. Tests show that Shared Block can deliver the full performance of underlying physical disks. Currently, Shared Block supports shared access protocols including iSCSI, FC, and NVMe-oF.
Working principles:
- Block-Level Access: SharedBlock divides data into blocks, each with a unique identifier. Servers read from or write to specific data blocks using these identifiers.
- Parallel Access: Multiple nodes can simultaneously access different blocks within SharedBlock, enabling parallel read and write operations.
- Shared Access: Multiple nodes can share the same SharedBlock, allowing concurrent access to the same data blocks. This is crucial for scenarios requiring data sharing in distributed systems.
- Fault Tolerance: SharedBlock typically provides data redundancy and failure recovery mechanisms to ensure data safety and reliability.
- Scalability: SharedBlock can scale capacity and performance by adding more storage nodes.
- Performance Optimization: SharedBlock usually uses various techniques, such as caching and load balancing, to optimize performance.
On architecture: In centralized storage, a volume is mapped to a host. Depending on the storage controller’s connection method, the multipath service on the host automatically aggregates multiple SCSI devices sharing the same WWID into a multipath device. ZStack Cloud detects multipath devices with the same WWID across all hosts in the cluster and creates a shared volume group (VG) for the user-selected volume. Logical volumes (LV) are provisioned from this VG, corresponding to volumes, snapshots, and other resources in ZStack Cloud. To maintain storage cluster consistency, ZStack Cloud implements a shared storage lock mechanism (Sanlock) for maintaining storage heartbeats, node management, and metadata management.
Sanlock + Lvmlockd
Sanlock (Shared storage lock manager) is essentially a lease management mechanism built upon Lamport’s algorithms: Delta Paxos and Disk Paxos. This system handles cluster membership management, heartbeat maintenance, arbitration, and message passing. The next step involves translating this lease mechanism into locks usable by LVM: Lvmlockd.
With Sanlock and Lvmlockd, most LVM commands from sever are first sent to Lvmlockd, which translates LVM operations into lock operations recognizable by Sanlock.
Different resource operations require different lock permissions. Resource operations proceed only after obtaining the appropriate locks, ensuring the security of metadata and data. This entire process requires no intermediate node coordination or centralized operations, forming a fully distributed architecture.
Distributed Storage
In ZCF Storage Service, distributed storage capabilities are provided by composable storage components and exposed to upper-layer workloads through the cloud platform. The cloud platform supports integration with various distributed storage systems. This topic uses ZStack ZStone as an example to describe the capability composition and working mechanisms of distributed storage in the ZCF architecture.
As a composable storage component of ZCF, ZStack ZStone can build a distributed storage system on general-purpose servers and provide resource management capabilities for servers, hard disks, data disks, block storage volumes, storage pools, buckets, and more. These capabilities allow users to create storage pools with different data redundancy types and configure buckets with specified storage policies and access permissions, providing block, file, and object storage services for the cloud platform and workloads.
Distributed storage capabilities are reflected in the following aspects:
Elastic Scalability:
Users can horizontally expand storage resources with ease. As services grow, data growth is usually unavoidable. Traditional centralized storage systems often face major challenges when handling large-scale data growth, whereas distributed storage systems can increase the capacity and processing capability of the entire storage cluster by simply adding nodes. This elastic scalability enables distributed storage resource pools to adapt to service requirements of different scales.
High Availability:
Supports multiple data redundancy policies, including replication and erasure coding (EC). The replication policy supports online adjustment of the number of replicas in a storage pool and replicates data across multiple nodes. When one or more nodes fail, data can still be obtained from other nodes, ensuring storage cluster availability. Combined with flexible fault-domain policies, storage services can continue running even in scenarios such as hardware failures or network interruptions.
Performance Optimization:
Optimizes data processing performance through proprietary cache acceleration technologies. Enterprise-grade NVMe SSDs and SATA SSDs can accelerate read and write operations for backend low-speed HDD devices, effectively reducing latency and improving storage cluster I/O performance. In addition, distributed storage supports load balancing to evenly distribute storage I/O loads across nodes, ensuring sufficient utilization of system resources.
Easy Management:
Provides an easy-to-use management page and standard RESTful APIs, helping administrators manage and maintain the basic lifecycle of physical resources, and perform data O&M and recovery operations.
Cost-Effectiveness:
Supports deployment on general-purpose hardware, greatly reducing hardware costs. In addition, elastic scalability allows users to dynamically adjust storage resources based on service requirements, avoiding resource waste and further reducing product usage costs.
Using ZStack ZStone as an example, the distributed storage system follows a master-worker architecture and consists of multiple Master and Node components. The system can be divided into the control plane and the Nodes managed by the control plane.
Block Storage
ZCF supports distributed block storage capabilities, which are exposed through the cloud platform as virtual block devices for VM instances, volumes, and container workloads, supporting storage scenarios such as root volumes, data volumes, and persistent volumes. When ZStack ZStone is used as the distributed storage component, block storage capabilities are carried by ZStack ZStone.
Third-Party Volume Management
Block storage capabilities support integration with third-party block storage volumes. Block storage volumes created on third-party platforms can be automatically synchronized into unified management and displayed separately from local volumes.
Volume Migration
Block storage capabilities support cross-pool migration of block storage volumes within the same cluster. This migration process consists of the following three phases:
- Migration Initialization: When migrating a volume, the system creates a new target volume and links the source volume to the target volume. Similar to tiered volumes, if a read request targets an uninitialized data region in the target volume, the internal mechanism redirects the read operation to the source volume. When writing data to an uninitialized data region in the target volume, the system internally performs a deep copy, transferring the overlapping source volume data to the target volume.
- Migration Execution: Executing migration performs a deep copy of all initialized blocks from the source volume to the target volume in the background. This step can be performed concurrently while the client uses the new target volume.
- Migration Finalization: After the background migration completes, you can commit or terminate the migration. Committing the migration removes the cross-link between the source and target volumes and deletes the source volume. Terminating the migration removes the cross-link and deletes the target volume.
Volume Clone
Block storage capabilities support cloning multiple block storage volumes from a single volume snapshot, offering two clone types: linked clone and independent clone.
Linked cloning is implemented based on snapshot layering and the Copy-on-Write (COW) mechanism. First, the system creates a read-only snapshot of the original block storage volume. Then, the original data is copied to multiple clone volumes through COW technology. These clone volumes share the same physical storage space and only perform data copying when modifications occur, thereby significantly saving storage capacity.
A linked clone volume has a dependency relationship with its source snapshot. system supports breaking this dependency chain, converting a linked clone volume into an independent volume.
File Storage
ZCF supports distributed file storage capabilities, providing shared file access to workloads through a distributed file system and supporting scenarios such as multi-node data sharing, application configuration sharing, and file collaboration. When ZStack ZStone is used as the distributed storage component, file storage capabilities are carried by ZStack ZStone.
File System
File Storage System Architecture
The file storage system is built atop the Rados object store and managed by an MDS (Metadata Server) cluster. It uses a metadata pool (Meta Pool) to manage and store metadata, and a data pool (Data Pool) to manage file data. The metadata pool typically consists of a set of all-flash drives, while the data pool can be configured on-demand as an HDD pool or a hybrid pool.
After initializing the file system, file storage system enables file sharing based on created secondary subdirectories and the cluster’s public network, supporting access via SMB/CIFS or NFS protocols. These shared resources are provided externally through a file gateway group, allowing you to access the file storage system via the public IP of any gateway node. For file write/read operations, the system first queries the Metadata Pool via the MDS to obtain the corresponding metadata, and then directly accesses the Data Pool for data read/write.
File Storage Function Components
File System: The core resource of file storage, responsible for storing metadata information and file data. Before using the file storage service, you must initialize the file system, including:
- Metadata Service Cluster Initialization: Creates an MDS service on each cluster monitoring node.
- File System Creation: Creates a distributed file system.
File Directory: A file directory is a subset of the file system, an essential resource for providing file sharing, and a prerequisite for storing files and other resources.
File User: A file user is an entity that utilizes file storage. Currently, file storage system’s file users are local users for SMB shares. Local users are required resources when creating SMB file shares, and different users can only access their respective file shares. When creating a local user, file storage system priorities creating a Linux system user on all file gateway nodes and then configures the user as an SMB share user.
File Gateway: A file gateway serves as the entry point for clients to access file storage services. A client must specify one or more file gateways to access file storage. file storage system supports creating file gateway groups for unified management of multiple file gateways, and these groups can be used for both SMB and NFS shares.
File Share: File sharing is an application scenario of the file system, supporting cross-platform file storage services. file storage system provides SMB sharing and NFS sharing. SMB sharing are primarily used for mounting by Windows systems, while NFS sharing are mainly intended for Linux system mounts. file storage system file sharing provides unified permission access control: specified clients, client groups, or local users are granted both read and write privileges, while all other unspecified clients have no access permissions.
Application Scenarios
- File Sharing: Supports multiple sharing protocols to meet cross-platform sharing service needs.
- Data Archiving: Provides ample storage space and robust data protection mechanisms.
- Multimedia Services: Suitable for the storage and access of large-scale videos and images.
File Sharing
File storage capabilities support sharing file directories via the SMB and NFS protocols.
SMB Sharing
File storage achieves compatibility with Windows clients and other SMB protocol-enabled devices through integrated Samba support.
- Implementation Method: The Virtual File System (VFS) module in the Samba configuration file mounts the file storage service. Through this module, Samba can directly mount the file storage file system as a shared directory.
- Typical Application: Support Windows file sharing.
NFS Sharing
File storage supports sharing file systems via the NFS protocol using NFS-Ganesha, facilitating mounting by Unix/Linux clients.
Implementation Method: Utilizes NFS-Ganesha combined with file storage’s libcephfs interface to provide NFS v3 and v4 protocol support.
Typical Applications:
- Provides file sharing services via NFS for Linux-based clients.
- Supports cross-platform data sharing, for example, between UNIX and Windows systems in hybrid environments.
Object Storage
ZCF supports distributed object storage capabilities, providing object data access through an S3-compatible API and supporting scenarios such as unstructured data, backup archiving, and application object data. When ZStack ZStone is used as the distributed storage component, object storage capabilities are carried by ZStack ZStone.
S3 API
Object storage capabilities provide S3-compatible RESTful APIs to deliver object storage access capabilities to the cluster.
Since the primary management service for each API type can register multiple subordinate services, a single API can ultimately correspond to multiple management services. Each management service maintains the Resources it supports and can itself be viewed as a type of Resource. Each Resource can also contain multiple Handlers, with each Handler containing multiple OPs. The following figure uses the S3 protocol API type as an example to show the specific operation of op_delete.
Access Control Management
Object storage capabilities ensure data transmission and access security through three-tiered permissions: key pairs, user permissions, and bucket permissions.
Object User Permission Management
Object storage allows administrators to create multiple object users, with each user’s data isolated and non-interfering. Accessing the object storage service requires authentication with your credentials, and only after successful authentication can data in the object storage be accessed.
The fundamental information required for authentication consists of an AccessKey and a SecretKey. After you creates an object user in object storage, the system automatically generates a key pair. When you access object storage via an S3 client, the system authenticates the client request by verifying the consistency of the keys carried within the request.
Simultaneously, object storage supports managing object user permissions and quotas.
Permission Management:
The system supports configuring access permissions for object users at the bucket and object levels. By default, three permission types are available: Read, Write, and Delete.
- Read: Object users with this permission can read bucket ACLs and list/download objects within a bucket. This permission cannot be deselected.
- Write: Object users with this permission can create buckets, modify bucket ACLs, upload objects, and perform related write operations.
- Delete: Object users with this permission can delete buckets and objects and others.
Quota Management:
- Number of Buckets: Supports setting the maximum number of buckets a single object user can own.
- Capacity: Supports setting the maximum capacity of objects a single object user can store.
- Number of Objects: Supports setting the maximum number of objects a single object user can access or operate on.
In addition to user quotas, object storage also supports setting per-bucket quotas for object users, specifying the capacity and object limits for a single object user within a single storage bucket.
Bucket Permission Management
Bucket permissions include Access Control Lists (ACL), bucket policies, and quotas bound to the object user.
Access Control List (ACL):
ACLs control users’ permissions for bucket operations. object storage provides basic access control for buckets and objects.
PermissionValues Access Restrictions for Users READ Grants read access. Bucket: List objects within the bucket. Object: Read the object data. READ_ACP Grants permission to read ACL rules. Bucket: Read ACL rules of the bucket. Object: Read ACL rules of the object. WRITE Grants write access. Bucket: Create, delete, or overwrite objects within the bucket. Object: None. WRITE_ACP Grants permission to modify ACL rules. Bucket: Modify ACL rules of the bucket. Object: Modify ACL rules of the object. FULL_CONTROL Grants all of the above permissions. Bucket Policy:
Storage bucket policies use a JSON-based access policy language to supplement and extend ACLs. You can use these policies to grant access permissions to a bucket and its objects. Only the bucket owner can associate a policy with a bucket. Permissions attached to a bucket apply to all objects in buckets owned by the bucket owner.
The size limit for a storage bucket policy is 20 KB.
Object User-Bound Quotas:
Storage buckets inherit controls from object user permissions. If an object user imposes a quota on a certain type of resource, the same quota restriction applies to the permissions of buckets bound to that object user.
Multipart Upload
Object storage supports multipart upload, enabling large objects to be split into multiple parts for independent upload. Each part represents a contiguous segment of the object’s data and can be uploaded in any order. If a part fails to upload, only that part needs re-uploading—other parts remain unaffected. After all parts are successfully uploaded, the system assembles them sequentially into a complete object.
When uploading an object in parts, each part occupies one object count quota. After successful upload and merging, the final object only occupies one quota.
The multipart upload mechanism of system has the following advantages:
- Enhanced Upload Throughput: Supports concurrent uploading of multiple data parts, thereby improving overall upload throughput.
- Reduced Impact of Network Failures: Smaller size of data parts enables rapid retransmission recovery during network issues, significantly minimizing disruption.
- Pausing or Cancelling Uploads on Demand: If an upload is paused, the uploaded parts remain preserved and can resume from the paused point upon starting. If an upload is canceled, the uploaded parts are deleted, and the entire file must be re-uploaded.
Storage Policy
A storage policy defines rules governing resource allocation sources and data storage formats for buckets, managing the mapping between buckets and storage pools to route data of different storage classes to corresponding pools. Object storage capabilities support up to seven storage classes per storage policy (storageclass_0 through storageclass_6), where storageclass_0 is the system-provided default. Users can add storage classes either during policy creation or via the storage policy detail page. Each storage class maps to a dedicated data pool, and specifying a storage class directs object data to its corresponding pool.
Data Compression
Data compression technology uses compression algorithms to perform lossless or lossy compression on data, reducing storage space requirements, lowering storage costs, and improving storage efficiency. Data compression employs the Snappy algorithm and supports enabling online compression via the web interface.
Capacity and Performance
ZCF supports capacity and performance management for distributed storage to improve storage utilization, optimize data access performance, and control the impact of recovery tasks and business I/O on cluster resources. When ZStack ZStone is used as the distributed storage component, capacity and performance management capabilities are carried by ZStack ZStone.
Cache Acceleration
Cache acceleration capabilities use SSD-based caching devices to accelerate data access for HDD data disks. These capabilities use high-speed SSDs through the ZAS cache module to provide I/O caching for traditional HDD devices. The ZAS cache module caches frequently accessed hot data in the high-speed SSD devices and returns it to the application, significantly improving I/O performance, especially in scenarios characterized by hot data access patterns.
The ZAS cache module supports two caching policies: Writethrough and Writeback. In Writethrough mode, data is written simultaneously to the cache and the backend storage device, ensuring data consistency. In Writeback mode, most of the cache is used to buffer write data, ensuring that dirty data is written sequentially to the backend storage device. The system disables the Writeback policy by default but you can switch caching policies at runtime.
The ZAS cache module has the following characteristics:
Flexible Cache Data Migration
The ZAS cache module automatically migrates data from slow disks to the SSD cache based on data access frequency and heat to improve access speed for that data. Simultaneously, based on cache usage and available cache space, the module automatically migrates less frequently used data from the SSD cache to slow disks to free up cache space.
Data Protection
If a data I/O error occurs on the flash device, the ZAS cache module first attempts to read from the disk to recover the data or marks the cache entry as invalid. For unrecoverable errors, such as those involving metadata or dirty data, the cache module automatically disables caching.
Thin Provisioning
Thin provisioning provides upper-layer applications with more virtual storage space than is physically available in the storage cluster before data is written to the logical volume. It improves storage utilization and provides more flexible capacity scaling capabilities.
Storage Pool Recovery QoS
Storage pool recovery QoS controls the impact of recovery tasks on I/O resources and helps balance resource allocation between fault recovery and business workloads.
Within data nodes, an op_shardedwq queue handles various I/O requests from the upper level. This is a composite queue, typically containing several sub-queues. After I/O requests are dequeued, they interact with the disk via the ObjectStore interface. I/O types fall into two main categories: business read/write I/O requests from clients, and I/O generated by internal activities of the storage system, including I/O requests between data nodes, SnapTrim, Scrub, and Recovery.
The capability uses a weighted priority queue (wpq) to categorize and store the aforementioned I/O types into corresponding sub-queues. Each priority (prior) queue is created when its first request is enqueued. During dequeue, a weighted probability method determines the prior level. The priority (prior) of each queue serves as its weight. The probability of a prior queue being selected equals the ratio of its priority weight to the total weight of all queues. Even if selected, a prior queue is not guaranteed to dequeue a request; this also depends on the size of the request about to be dequeued.
You can set a recovery QoS for a storage pool with different recovery policies for various business scenarios.
- Low-Speed Recovery: Low-Speed Recovery gives a higher priority to the business bandwidth. The recovery time is relatively long. Any hardware failures during the recovery may reduce the data security level. We recommend that you choose Low-Speed Recovery in a production environment.
- Medium-Speed Recovery: Mid-Speed Recovery gives the same priority to the business bandwidth and recovery bandwidth. The recovery time is medium. A saturated performance may increase the I/O latency.
- High-Speed Recovery: High-Speed Recovery gives a higher priority to the recovery bandwidth. The recovery time is relatively short. A saturated performance may affect business performance.
Volume Service QoS
Volume service QoS controls business I/O for block storage volumes, including maximum IOPS and maximum read/write bandwidth. By setting a business QoS, you can control the performance of different block storage volumes to meet diverse business performance requirements.
The capability uses a token bucket algorithm for I/O traffic control:
- The system generates tokens at a fixed rate and places them into a bucket. Every I/O request must acquire a token from this bucket.
- Requests that fail to acquire a token must queue to obtain one, thereby limiting the average data flow rate into the system.
- When the token distribution rate is slower than the token generation rate, tokens can accumulate in the bucket. This allows direct consumption of tokens from the bucket during short-term traffic bursts.
O&M Management
ZCF supports distributed storage O&M capabilities, including multi-resource pool management, physical disk LED indication, hard disk S.M.A.R.T. monitoring, data disk maintenance mode, data rebalancing, automatic fault detection, and alerting to support daily maintenance and fault handling of storage resources. When ZStack ZStone is used as the distributed storage component, O&M capabilities are carried by ZStack ZStone.
Multiple Resource Pools
Multiple resource pool capabilities support independent use of storage media with different performance characteristics and enable fault isolation.
Each resource pool has distinct attributes and performance, such as the number of replicas, data redundancy level, and storage media. You can flexibly allocate and manage resources based on actual requirements to improve storage efficiency and performance.
Resource pools are isolated from each other. You can implement data isolation management across multiple pools. Besides, failures in a single resource pool does not affect other resource pools, effectively safeguarding data security and storage reliability.
Disk Locate
Disk locate capabilities provide a visual interface to turn on the disk LED for rapid locating. When you need to maintain or replace a disk, click Disk Light in the UI. The corresponding disk’s LED indicator lights up in the physical environment, guiding you to quickly and accurately identify the device, thereby improving O&M efficiency.
Disk S.M.A.R.T. Check
Hard disk S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) monitoring tracks the health status, temperature, firmware, and total bytes written of disks. Upper-layer services trigger relevant alerts based on I/O errors and disk status information returned by the S.M.A.R.T. data.
Data Disk Maintenance Mode
Data disk maintenance mode is designed for server or disk maintenance scenarios. To maintain servers or disks, you can put the corresponding disks into maintenance mode on the UI. A disk in this mode stops all services and data access, and the data on the disk does not undergo rebalancing.
Automatic Fault Detection and Alarming
Automatic fault detection and alerting monitors the storage system and individual storage servers. Upon detecting a failure, the system automatically sends alert messages to the platform. You can also add email endpoints to receive alarms, enabling timely response and recovery.
When a failure occurs, the system supports automatic service restart and data migration. This maximizes data reliability and availability, forming a highly reliable and highly available distributed storage system.
Data Rebalancing
Data rebalancing evenly distributes data across data disks under all storage servers in the cluster. This enhances storage system performance and reliability.
Automatic Data Rebalancing:
- Based on storage pool configurations and storage server load, the system automatically migrates data from overloaded nodes to those with lower load to achieve load balancing.
- When a server fails or a new server is added, the system automatically migrates data to maintain consistency and reliability.
Manual Data Rebalancing:
The system also supports manual data rebalancing. You can manually initiate rebalancing operations based on the actual data distribution.
