Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Snapshot and Backup

Updated on 2025-01-27 GMT+08:00

CCE Autopilot clusters allow you to create snapshots for storage volumes of the EVS type. A snapshot is a complete copy or image of the disk data at a specific point in time, which can be used for data disaster recovery. If data is lost, you can roll back the disk data to the state when a snapshot was created.

You can create snapshots to rapidly save the disk data at a certain time. In addition, you can use snapshots to create disks so that the created disks will contain the snapshot data in the beginning.

Prerequisites

  • You have created a cluster.
  • If you want to create a cluster by running commands, kubectl has been used to connect to the cluster. For details, see Connecting to a Cluster Using kubectl.

Constraints

  • Not all regions support EVS volumes. View the regions where EVS volumes are supported on the console. You can also view Function Overview to learn about all regions where EVS volumes are supported.
  • The cluster version must be v1.27.8-r0, v1.28.6-r0, or later. If the cluster version does not meet the requirements, you need to upgrade the cluster.
  • The subtype (such as common I/O, high I/O, or ultra-high I/O), disk mode (SCSI or VBD), data encryption, sharing status, and capacity of an EVS disk created from a snapshot must be the same as those of the disk associated with the snapshot. These attributes cannot be modified after being checked or configured.
  • Snapshots can be created only for EVS disks that are available or in use, and a maximum of seven snapshots can be created for a single EVS disk.
  • The snapshots of encrypted disks are stored encrypted, and those of non-encrypted disks are stored non-encrypted.

Scenario

Snapshots can help meet your following needs:

  • Routine data backup

    You can create snapshots for EVS disks regularly and use snapshots to recover your data in case that data loss or data inconsistency occurred due to misoperations, viruses, or attacks.

  • Rapid data restoration

    You can create a snapshot or multiple snapshots before an OS change, application software upgrade, or a service data migration. If an exception occurs during the upgrade or migration, service data can be rapidly restored to the time point when the snapshot was created.

    For example, a fault occurred on system disk A of ECS A, and therefore ECS A cannot be started. Because system disk A is already faulty, the data on system disk A cannot be restored by rolling back snapshots. In this case, you can use an existing snapshot of system disk A to create EVS disk B and attach it to ECS B that is running properly. Then, ECS B can read data from system disk A using EVS disk B.
    NOTE:

    The snapshots provided by CCE Autopilot are the same as the CSI snapshots provided by the Kubernetes community. They can only be used to create EVS disks, but cannot be used to roll back to source EVS disks.

  • Rapid deployment of multiple services

    You can use a snapshot to create multiple EVS disks containing the same initial data, and these disks can be used as data resources for various services, for example, data mining, report query, and development and testing. This method protects the initial data and creates disks rapidly, meeting the diversified service data requirements.

Creating a Snapshot

Using the CCE Console

  1. Log in to the CCE console.
  2. Click the cluster name to go to the cluster console. In the navigation pane on the left, choose Storage. Then click the Snapshots and Backups tab.
  3. In the upper right corner, click Create Snapshot. In the displayed dialog box, configure the parameters.

    Figure 1 Creating a snapshot
    Table 1 Parameters for creating a snapshot

    Parameter

    Description

    Snapshot Name

    Enter the snapshot name, for example, disksnap-test1.

    Storage

    Select the PVC for which you want to create a snapshot. Only EVS PVCs can be selected. In this example, select pvc.

  4. Click Create. On the Snapshots and Backups tab, view details about the snapshot.

    Figure 2 Snapshot details

Creating from YAML

kind: VolumeSnapshot
apiVersion: snapshot.storage.k8s.io/v1beta1
metadata:
  name: disksnap-test1 # Snapshot name
  namespace: default
spec:
  source:
    persistentVolumeClaimName: pvc     # PVC name. Only an EVS PVC can be selected.
  volumeSnapshotClassName: csi-disk-snapclass

Using a Snapshot to Create a PVC

The disk type, encryption setting, and disk mode of the created EVS PVC are consistent with those of the snapshot's source EVS disk.

Using the CCE Console

  1. Log in to the CCE console.
  2. Click the cluster name to go to the cluster console. In the navigation pane on the left, choose Storage. Then click the Snapshots and Backups tab.
  3. Locate the snapshot that you want to use for creating a PVC, click Create PVC, and configure PVC parameters in the displayed dialog box.

    Figure 3 Using a snapshot to create a PVC
    Table 2 Parameters for creating a PVC using a snapshot

    Parameter

    Description

    PVC Name

    Enter a PVC name, for example, pvc-disksnap.

    (Optional) PV Name Prefix

    This parameter specifies the name of the underlying storage that is automatically created. The actual underlying storage name is in the format of "PV name prefix + PVC UID". If this parameter is left blank, the default prefix pvc will be used.

    For example, if the storage volume name prefix is set to test, the actual underlying storage name is test-{UID}.

    Resource Tag

    You can add resource tags to classify resources.

    You can create predefined tags on the TMS console. The predefined tags are available to all resources that support tags. You can use predefined tags to improve the tag creation and resource migration efficiency. For details, see Creating Predefined Tags.

    CCE automatically creates system tags CCE-Cluster-ID={Cluster ID}, CCE-Cluster-Name={Cluster name}, and CCE-Namespace={Namespace name}. These tags cannot be modified.

  4. Click Create. Click the PVCs tab to view the created PVC.

Creating from YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-disksnap # PVC name
  namespace: default
  annotations:
    everest.io/disk-volume-type: SSD     # EVS disk type, which must be the same as that of the snapshot's source EVS disk.
    everest.io/disk-iops: '3000'      # (Optional) IOPS of only a GPSSD2 EVS disk 
    everest.io/disk-throughput: '125' # (Optional) Throughput of only a GPSSD2 EVS disk 
  labels:
    failure-domain.beta.kubernetes.io/region: <your_region>   # Replace the region with the one where the EVS disk is located.
    failure-domain.beta.kubernetes.io/zone: <your_zone>       # Replace the AZ with the one where the EVS disk is located.
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: csi-disk
  dataSource:
    name: disksnap-test1             # Snapshot name
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback