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

Detaching a Disk from an ECS

Updated on 2024-04-16 GMT+08:00

Function

This API is used to detach a disk from an ECS.

Constraints

The system disk, the device name of which is /dev/sda, and user disks can be detached from an ECS only when the ECS is stopped. There are no requirements on UVP VMTools.

When an ECS is in the active state, pay attention to the following constraints:

  1. Only data disks, the device name of which is not /dev/sda, can be detached from an ECS.
  2. Make sure that UVP VMTools have been installed and enabled on the ECS. Otherwise, the uninstallation will fail.
  3. For a Linux ECS, you need to log in to the ECS and run the umount command to disassociate the target disk from the file system. In addition, you need to ensure that no data is being written into or being read from the disk. Otherwise, the detachment will fail.
  4. For a Windows ECS, you need to ensure that no data is being written into or being read from the disk when a disk is to be detached from the running ECS. Otherwise, data will be lost.
  5. OSs supporting EVS disk detachment from a running ECS include two parts:
    • For the first part, see Overview > Concept > OSs for Public Images Supported by IMS in Image Management Service User Guide.
    • Table 1 lists the second part of supported OSs.
      Table 1 OSs supporting EVS disk detachment from a running ECS

      OS

      Version

      CentOS

      7.3 64bit

      7.2 64bit

      6.8 64bit

      6.7 64bit

      Debian

      8.6.0 64bit

      8.5.0 64bit

      Fedora

      25 64bit

      24 64bit

      SUSE

      SUSE Linux Enterprise Server 12 SP2 64bit

      SUSE Linux Enterprise Server 12 SP1 64bit

      SUSE Linux Enterprise Server 11 SP4 64bit

      SUSE Linux Enterprise Server 12 64bit

      OpenSUSE

      42.2 64bit

      42.1 64bit

      Oracle Linux Server release

      7.3 64bit

      7.2 64bit

      6.8 64bit

      6.7 64bit

      Ubuntu Server

      16.04 64bit

      14.04 64bit

      14.04.4 64bit

      Windows (SCSI EVS disks cannot be detached from a running ECS.)

      Windows Server 2008 R2 Enterprise 64bit

      Windows Server 2012 R2 Standard 64bit

      Windows Server 2016 R2 Standard 64bit

      Red Hat Linux Enterprise

      7.3 64bit

      6.8 64bit

  6. The forcible online disk detach function supports only VBD disks used by KVM ECSs.

    For other types of disks used by Xen ECSs, BMSs, and KVM ECSs, this API supports only online disk detachment.

  7. Disks which are forcibly detached online will use the disk drives and PCI addresses, so the disk drives and PCI addresses will not be assigned again.
  8. After a disk is forcibly detached, it still occupies the disk quota of the ECS.
  9. The system disk cannot be detached forcibly online.
  10. When a file system is attached to a disk and the disk is detached forcibly online, users need to manually detach all file systems attached to the disk.
  11. If logical partitions are created on the disk which is detached forcibly online, the logical partitions will become invalid.
  12. After a disk is forcibly detached, you need to restart the ECS to clear the residual.

URI

DELETE /v2.1/{project_id}/servers/{server_id}/os-volume_attachments/{volume_id}{?delete_flag}

Table 2 describes the parameters in the URI.
Table 2 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

server_id

Yes

Specifies the ECS ID.

volume_id

Yes

Specifies the volume ID.

Usage: DELETE /v2.1/{project_id}/servers/{server_id}/os-volume_attachments/{volume_id}?delete_flag=1

Table 3 describes the query parameters.

Table 3 Query parameters

Parameter

Mandatory

Type

Description

delete_flag

No

Integer

Specifies whether to support forcible online disk detachment.

The default value is 0. 1 indicates that the disk can be forcibly detached online.

Request

None

Response

None

Example Request

Detach the disk whose ID is 54667652-3029-4af8-9222-2d53066fd61c from a specified ECS.

DELETE https://{endpoint}/v2.1/6fbe9263116a4b68818cf1edce16bc4f/servers/ab258e25-e351-47c7-b6e3-0749c5d9ed6a/os-volume_attachments/54667652-3029-4af8-9222-2d53066fd61c

Example Response

None

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