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
Situation Awareness
Managed Threat Detection
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

Deleting a PersistentVolume

Updated on 2024-07-26 GMT+08:00

Function

This API is used to delete a PersistentVolume from a specified namespace. Using this API, you can determine whether to retain the cloud storage associated with the PersistentVolume. This API has been deprecated. Use the corresponding Kubernetes PV API instead.

NOTE:

The format of the storage management URL is https://{clusterid}.Endpoint/uri. In the URL, {clusterid} indicates a cluster ID, and uri indicates the resource path, that is, the path for API access. If https://Endpoint/uri is used, the X-Cluster-ID parameter must be specified in the request header.

URI

DELETE /api/v1/cloudpersistentvolumes/{name}

Table 1 URI parameter description

Parameter

Mandatory

Type

Description

name

Yes

String

Name of the PersistentVolume to be deleted.

Name format: Volume name[?deleteVolume=BOOLEAN&storageType=Cloud storage volume type]. The content in square brackets can be omitted. Examples:

  • volume-49f1?deleteVolume=true&storageType=bs
  • volume-49f1

In the first example:

deleteVolume: Whether to delete associated backend cloud storage after the PersistentVolume is deleted. The value can be true or false and defaults to false. If it is set to true, it indicates that the associated backend cloud storage is deleted after the PersistentVolume is deleted. If it is set to false, it indicates that the associated backend cloud storage is not deleted after the PersistentVolume is deleted.

NOTE:

If the storage volume type is efs, this parameter must be set to false.

storageType: Cloud storage volume type. This parameter is used together with deleteVolume. That is, deleteVolume and storageType must be configured at the same time.

NOTE:
  • bs: EVS
  • nfs: SFS
  • obs: OBS
  • efs: SFS Turbo

Request

Table 2 Request header parameter description

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

Possible values:

  • application/json;charset=utf-8
  • application/json

X-Auth-Token

Yes

String

Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details on how to obtain a user token, see Authentication.

Maximum length: 16,384 characters

X-Cluster-ID

No

String

Cluster ID. This parameter is mandatory when the URL format https://Endpoint/uri is used. For details about how to obtain the value, see How to Obtain Parameters in the API URI.

Response

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

apiVersion

String

API version. The value is fixed to v1.

Default value: v1

kind

String

API type. The value is fixed to PersistentVolume.

Default value: PersistentVolume

metadata

PersistentVolumeMetadata object

PersistentVolume metadata information.

spec

PersistentVolumeSpec object

PersistentVolume specifications.

status

PersistentVolumeStatus object

PersistentVolume status information.

Table 4 PersistentVolumeMetadata

Parameter

Type

Description

name

String

PV name. Enter 1 to 253 characters starting and ending with a letter or digit. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. PV names must be unique in a namespace.

labels

Map<String,String>

PV labels, in the format of key-value pairs.

  • Key: Enter 1 to 63 characters starting with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. A DNS subdomain can be prefixed to a key and contain a maximum of 253 characters. Example DNS subdomain: example.com/my-key
  • Value: The value can be left blank or a string of 1 to 63 characters starting with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed in the character string.

Example label: "foo": "bar"

Table 5 PersistentVolumeSpec

Parameter

Type

Description

flexVolume

FlexVolume object

FlexVolume storage plug-in of Kubernetes.

persistentVolumeReclaimPolicy

String

PV reclaim policy. Possible values:

  • Retain: The Retain reclaim policy allows for manual reclamation of the resource. When the PVC is deleted, the PV still exists and the volume is considered "released".
  • Recycle: The Recycle reclaim policy performs a basic scrub (rm -rf / thevolume / *) on the volume and makes it available again for a new claim.
  • Delete: For volume plug-ins that support the Delete reclaim policy, deletion removes both the PV object from Kubernetes, as well as the associated storage asset in the external infrastructure. Volumes that were dynamically provisioned inherit the reclaim policy of their StorageClass, which defaults to Delete.

accessModes

Array of strings

Access mode of the PersistentVolume.

  • ReadWriteOnce: The volume can be mounted as read-write by a single node.
    NOTE:

    This function is supported only when the cluster version is v1.13.10 and the storage-driver version is 1.0.19.

  • ReadOnlyMany: The volume can be mounted as read-only by many nodes.
  • ReadWriteMany: The volume can be mounted as read-write by many nodes.
Table 6 FlexVolume

Parameter

Type

Description

driver

String

Name of the FlexVolume storage plug-in. Set this parameter based on the storage volume type.

  • huawei.com/fuxivol (EVS)
  • huawei.com/fuxinfs (SFS)
  • huawei.com/fuxiobs (OBS)
  • huawei.com/fuxiefs (SFS Turbo)

fsType

String

File system type. Set this parameter based on the storage volume type.

options

Options object

FlexVolume configuration items.

Table 7 Options

Parameter

Type

Description

fsType

String

File system type. Set this parameter based on the storage volume type.

  • ext4 (EVS)
  • nfs (SFS)
  • obs (OBS)
  • efs (SFS Turbo)

region

String

Region where the cloud storage is located.

volumeID

String

UUID of the cloud storage. If the cloud storage is an OBS bucket, set this parameter to the bucket name.

storageType

String

Cloud storage volume type.

  • bs (EVS)
  • nfs (SFS)
  • obs (OBS)
  • efs (SFS Turbo)
Table 8 PersistentVolumeStatus

Parameter

Type

Description

accessModes

Array of strings

Access mode of the PersistentVolume.

phase

String

PV status. Possible values:

  • Available: The volume is not bound to any PVC.
  • Bound: The PV has been bound to a PVC.
  • Released: The PVC bound to the PV has been deleted, but the PV has not been made available again for a new claim in the cluster.
  • Failed: Automatic reclaim of the volume has failed.

Request Example

None

Example Response

Status code: 200

The job for deleting a PersistentVolume is successfully delivered.

{
  "kind" : "PersistentVolume",
  "apiVersion" : "v1",
  "metadata" : {
    "name" : "pv-test",
    "selfLink" : "/api/v1/persistentvolumes/pv-test",
    "uid" : "0d93181d-3628-11e7-9093-fa163e8c373b",
    "resourceVersion" : "180886",
    "creationTimestamp" : "2017-05-11T08:58:51Z",
    "labels" : {
      "app" : "test"
    }
  },
  "spec" : {
    "flexVolume" : {
      "driver" : "huawei.com/fuxivol",
      "fsType" : "ext4",
      "options" : {
        "fsType" : "ext4",
        "kubernetes.io/namespace" : "default",
        "volumeID" : "0781b22f-4d89-4e9c-b026-80e545cea16c"
      }
    },
    "capacity" : {
      "storage" : "1Gi"
    },
    "accessModes" : [ "ReadWriteMany" ],
    "persistentVolumeReclaimPolicy" : "Delete"
  },
  "status" : {
    "phase" : "Available"
  }
}

Status Code

Status Code

Description

200

The job for deleting a PersistentVolume is successfully delivered.

Error Codes

For details, see Error Codes.

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