Disk

BCC BCC

  • API Reference
    • Appendix
    • Automatic Snapshot Policy Related Interfaces
      • Bind automatic snapshot policy
      • Create automatic snapshot policy
      • Delete automatic snapshot policy
      • Query details of automatic snapshot policy
      • Query the list of automatic snapshot policies
      • Unbind automatic snapshot policy
      • Update automatic snapshot policy
    • Cluster Management Related Interfaces
      • Create EHC Cluster
      • Delete EHC Cluster
      • EHC Cluster List
      • Modify EHC Cluster
    • Common Request Headers and Response Headers
    • Dedicated Cluster Related Interfaces
      • Canceling Dedicated Cluster Auto-Renewal
      • Create a dedicated cluster
      • Dedicated Cluster Renewal
      • Dedicated Cluster Tag Binding
      • Dedicated Cluster Tag Unbinding
      • Enabling Dedicated Cluster Auto-Renewal
      • Querying Dedicated Cluster Details
      • Querying Dedicated Cluster List
      • Resizing Dedicated Cluster
    • Deployment Group Related Interfaces
      • Adjust Deployment Group
      • Create Deployment Group
      • Delete Deployment Group
      • Get Deployment Group Details
      • Modify deployment group
      • Query the deployment group list
      • Remove Instance from Deployment Group
    • Disk Related Interfaces
      • Attach a CDS disk
      • Bind a tag to a disk
      • Cancel Auto-renewal
      • Create a CDS disk
      • Detach a CDS disk
      • Disk Expansion and Type Change
      • Enable auto-renewal
      • Get Purchasable Disk Information
      • Modify disk properties
      • Query CDS Price
      • Query disk details
      • Query the disk list
      • Release a CDS disk (new)
      • Release a CDS disk
      • Rename a disk
      • Renew a disk
      • Roll back disk data
      • Shift charge for disks
      • Unbind a tag from a disk
    • Error response
    • General Description
    • Image Related Interfaces
      • Bind a tag to an image
      • Cancel cross-region replication of custom images
      • Create a custom image
      • Delete a custom image
      • Import an image
      • Modify Custom Image Name
      • Query available public image based on instance specifications
      • Query image details
      • Query List of Users with Shared Image Access
      • Query OS information based on instance IDs in batch
      • Query the image list
      • Replicate a custom image across regions
      • Share a custom image
      • Unbind a tag from an image
      • Unshare a custom image
    • Instance Related Interfaces
      • Add an instance to a security group
      • Add IPv6
      • Batch Adding Secondary IP Addresses for Primary Network Interface Card
      • Batch Convert to Postpay
      • Batch Unsubscribe Prepaid Instances
      • Billing Change - Convert to Subscription
      • Bind a role
      • Bind a tag to an instance
      • Change the instance subnet
      • Change the instance VPC
      • Convert to prepay in batch
      • Create an instance (by specifying instance package specifications)
      • Create automatic renewal rules
      • Create instance
      • Delete automatic renewal rules
      • Delete secondary IP address from the primary network interface card in batch
      • Early Release of Prepaid Instances
      • Enter rescue mode
      • Exit rescue mode
      • Instance Resizing (By Specifying Instance Package Specification)
      • Modify instance attributes
      • Modify instance description
      • Modify instance hostname
      • Modify the instance password
      • Query Instance List by Instance ID
      • Query instance list
      • Query Multiple Instance Details
      • Query recycle bin instance list
      • Query resizing specifications
      • Query the custom data of the instance
      • Query the details of a specified instance
      • Query the list of BCC instances eligible for no charge for stopped instances
      • Query the VNC address of the instance
      • Reboot an instance
      • Reinstall an instance
      • Reinstall OS for Instances (Batch Reinstallation)
      • Release instances in batch
      • Release IPv6
      • Release Postpay Instances (Release via POST Request)
      • Release recycle bin instances
      • Remove an instance from a security group
      • Remove the relationship between an instance and its deployment group
      • Renew an instance
      • Resize instances in batches
      • Resuming Billing for BCC in Recycle Bin
      • Retrieve a list of instance roles
      • Retrieve network interface card information for an instance
      • Set Auto-release of Spot Instance EIP
      • Set Instance Deletion Protection
      • Setting Auto-Release for Postpay
      • Start an instance
      • Starting Instances (Batch Start)
      • Stop an instance
      • Stopping Instances (Batch Stop)
      • Unbind a role
      • Unbind a tag from an instance
    • Key Pair Related Interfaces
      • Bind a key pair
      • Change description of key pair
      • Create a key pair
      • Delete a key pair
      • Import a key pair
      • Query key pair details
      • Query the key pair list
      • Rename a key pair
      • Unbind a key pair
    • Maintenance platform APIs
      • Maintenance Records Related Interfaces
      • Maintenance Task Related Interfaces
      • Pre-authorization Related Interfaces
    • Other APIs
      • Query instance package price
      • Query instance package specifications (new)
      • Querying Availability Zones By Package Specification
    • Overview
    • Region and Availability Zone Related Interfaces
      • Query list of availability zones
      • Retrieve the Domain Name List API
    • Reserved Instance Related Interfaces
      • Accept Reserved Instance Transfer
      • Adjust reserved instance
      • Bind Tag to Reserved Instance
      • Create Auto-renewal Rule for Reserved Instance
      • Create reserved instances
      • Disable Auto-renewal Rule for Reserved Instance
      • Initiate Reserved Instance Transfer
      • Query Reserved Instance
      • Reject Reserved Instance Transfer
      • Renew reserved instances
      • Reserved Instance Inbound List
      • Reserved Instance Outbound List
      • Revoke Reserved Instance Transfer
      • Unbind Tag from Reserved Instance
    • Security Group Related Interfaces
      • Authorize security group rules
      • Create a security group
      • Delete a security group
      • Delete security group rules
      • Instance associating with security group
      • Query the security group list
      • Replace security group for instance
      • Revoke security group rules
      • Unbind security group from instance
      • Update security group rules
    • Service domain
    • Snapshot Related Interfaces
      • Bind a tag to a snapshot chain
      • Create a snapshot
      • Delete a snapshot
      • Query snapshot chain list
      • Query snapshot details
      • Query the snapshot list
      • Replicate a snapshot across regions
      • Unbind a tag from a snapshot chain
    • Spot Instance Related Interfaces
      • Cancel Spot Instance Order
      • Create spot instances
      • Query Spot Instance Packages
      • Query Spot Price
  • Cloud Assistant API and SDK Reference
    • Python SDK
      • Batch Retrieval of bsm-agent State within Instances
      • CaClient
      • Command Interface
      • Historical records
      • Initialization
      • Install SDK
      • Log API
  • Cloud Assistant API Reference
    • Batch Retrieve Instance BSM-Agent Status
    • Command Interface
    • Common Request and Response Headers
    • Error response
    • General Description
    • Historical records
    • Log API
    • Service domain
  • FAQs
    • Billing class
    • Common Questions Overview
    • Images
    • Instances
    • Network class
    • Performance
    • Reserved Instance
    • Security class
    • Snapshots
    • Storage class
    • Virtual machine operation and maintenance class
  • Fault handling
    • GPU Instance Downtime Troubleshooting
    • Linux Baidu Cloud Compute Entering Single User Mode to Reset Paasword Reports Error-Authentication token lock busy
    • Linux Baidu Cloud Compute Entering Single User Mode to Reset Paasword Reports Error-Authentication token manipulation error
    • Linux Baidu Cloud Compute Entering Single User Mode to Reset Root Paasword
    • Linux Baidu Cloud Compute Execution Yum Update Reports Dependency Conflict
    • Linux Baidu Cloud Compute Setting Login Method
    • Unable to Remotely Connect to Linux Instance
    • Unable to Remotely Connect to Windows Instance
    • Windows Server Cannot Ping
  • Function Release Records
  • Go-SDK
    • Automatic snapshot policy
    • Availability zone
    • Dedicated CDS Cluster
    • Deployment group
    • Disk
    • Elastic high-performance computing cluster
    • Image
    • Initialization
    • Instance
    • Key pair
    • Overview
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
  • Java-SDK
    • Automatic snapshot policy
    • Availability zone
    • BCC instance
    • BccClient
    • Deployment group
    • Disk
    • Exception handling
    • Image
    • Install the SDK Package
    • Key pair
    • Log
    • Overview
    • Quick Start
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
    • Version Change Records
  • Operation guide
    • Deployment group
      • Adjust Deployment Group for Existing Instances
      • Create BCC Instance within Deployment Group
      • Create Deployment Group
      • Delete Deployment Group
      • Modify Deployment Group Information
      • Overview of deployment policy
      • Remove BCC Instance from Deployment Group
    • Elastic high-performance computing cluster
      • Create Elastic High-performance Computing Cluster
      • Overview of elastic hyper-computing cluster
    • Image
      • Baidu AI Cloud Image Service Agreement
      • Create a custom image
      • Creating Linux Image Based on Local System
      • Cross-region image replication
      • Data and Personal Information Protection Statement
      • Delete a custom image
      • How to Set Network Adapter Multi-Queue Properties
      • Image List
      • Image Overview
      • Image Quick Guide
      • Import Custom Image
        • Checking Network Configuration
        • Checking Virtio Driver
        • Creating Instance Using Imported Custom Image
        • Detecting Image Using Image Detection Tool
        • Image format check
        • Image Format Conversion
        • Image Import Restrictions
        • Import Overview
        • Install cloudbase-init
        • Installing Virtio Driver
        • System Optimization Operations (Linux)
      • OS Official End of Maintenance Plan
      • Public Image Release Records
        • 2023 BCC Public Image Release Records
        • 2023 EBC Public Image Release Records
        • 2024 BCC Public Image Release Records
        • 2024 EBC Public Image Release Records
        • 2025 BCC Public Image Release Records
      • Reinstall OS
      • Share a custom image
      • Windows Image Creation
    • Instance
      • Batch Sequential Naming
      • Change Availability Zone
      • Change Charge Type
        • Postpay to Subscription
        • Subscription to Postpay
      • Change Instance Configuration
      • Create instance
        • Create Instance Navigation
        • Create Instance via Custom Image
        • Create Instance via Purchase Page
        • Create Instances with Launch Templates
        • Purchase Instance with Same Configuration
      • Cross-AZ migration
      • Functional restrictions
      • Instance Overview
      • Modify instance name
      • Postpay Instance No Charge for Stopped Instances
      • Reboot an instance
      • Reclaim instance
      • Release an instance
      • Renew an instance
      • Reset password
      • Set IAM Role
      • Sign in to instance
        • Log in to Linux Instance
          • Connect to Baidu Cloud Compute Using SmartTerm
          • Connect to Linux instance using user name-password certification
          • Log in to Linux Instance Using SSH Key on Linux or Mac
          • Log in to Linux Instance Using SSH Key via SecureCRT
          • Remotely sign in to Baidu Cloud Computer via VNC
          • Sign in to Linux instances via SSH key in Putty
          • Sign in to Linux instances via SSH key in Xshell
        • Log in to Windows Instance
          • Remotely sign in to Baidu Cloud Computer via VNC
          • Sign in to Windows instance via remote desktop
        • Login Method Overview
      • Spot instances
        • Create spot instances
        • What Is Spot Instance
      • Start an instance
      • Stop an instance
        • Elastic Baremetal Instance and Elastic High-performance Computing Cluster Instance Halt Capability Configuration Instructions
        • Stop an instance
      • View instance
    • Launch Template
    • Network
      • Bind and Unbind EIP
      • Change Internal IP
      • Change subnet
      • Change VPC
      • Configure Dual Network Interface Card External Network Access for Windows Baidu Cloud Compute
      • Configure IPv6 Address
      • Elastic network interface
        • Configure elastic network interface
        • Create elastic network interface
        • Elastic Network Interface Overview
        • Mount elastic network interface
      • Elastic RDMA Network Interface
        • Elastic RDMA Network Interface Overview
        • Instructions for use
    • Operations and Monitor
      • Cloud Assistant
        • Cloud Assistant Overview
        • Cloud Assistant Usage Notes
        • Create command
        • FAQs
        • Historical records
        • Identity and access management
        • Instance list
        • My commands
        • Public commands
        • Upload files
      • Evacuate Faulty Instance
      • Instance Health Check
      • Maintenance Platform
        • Maintenance Platform Access Instructions
        • Maintenance Platform Overview
        • Maintenance Records Query
        • Maintenance Task
        • Pre-authorization Rule Settings
      • Monitor and Alarm
      • Self-Service Diagnostic Tool
        • Application Performance Diagnostic Tool Btune
        • Self-Service Diagnostic Tool Overview
      • Use Rescue Mode
    • Reserved Instance
      • FAQ
      • Introduction to reserved instance
      • Renew reserved instances
      • Reserved Instance AZ Change
      • Reserved Instance Cross-Account Transfer
      • Reserved Instance EHC Cluster Change
      • Reserved Instance Purchase
    • Resource Assessment
    • Security
      • Identity and access management
        • Identity and access management
        • Price Permission Control
      • Key pair
        • Bind SSH Key Pair
        • Create SSH Key Pair
        • Delete SSH Key Pair
        • SSH Key Pair Overview
        • Unbind SSH Key Pair
      • Security group
        • Associate with security group
        • Copy security group
        • Create a security group
        • Delete a security group
        • Disassociate security group
        • Edit security group
        • Security group overview
    • Server Migration
      • Migration Operation Steps
      • Server Migration Operation Process
      • Server Migration Overview
    • Snapshot
      • Automatic snapshot
      • Create disk snapshot
      • Delete a snapshot
      • Rollback snapshot
      • Snapshot Overview
    • Storage
      • Overview
      • System disk expansion
    • Tag Management
      • Configure Tag
      • Tag Management Overview
      • View Resource Bill Based on Tag
  • Operations Reference
    • Linux Operations Reference
      • Baidu Cloud Compute Delete or Modify File Prompting File System Read-Only
      • CentOS 7 Install Docker
      • Configure Linux Analysis Tools atop and kdump
      • Enter Single User Mode
        • CentOS 6 Enter Single User
        • CentOS 7 Enter Single User
        • CentOS 8 Enter Single User
        • FreeBSD 11 Single User Modify Password SOP
        • opensuse42
          • 3 Enter Single User
        • Ubuntu Enter Single User
        • OpenSUSE 42_3 Enter Single User
      • How to Enable or Disable Intel CPU Vulnerability Patch in Linux Image
      • How to Handle System Boot Exception Caused by fstab Configuration
      • How to Resolve Unable to Log in to Linux BCC Instance via SSH
      • Linux BCC Instance Insufficient Space Issue Resolution
      • Linux BCC Instance Lagging Issue
      • Linux Format and Mount Instance Mount Local Disk
      • Linux Modify Default Remote Connection Port
      • Linux Server CPU and Memory Full Issue Troubleshooting
      • Linux System Install Graphical Interface and Remote Connection
        • CentOS
          • CentOS 8 Install Graphical Interface and Connect Using VNC Viewer
          • CentOS6
            • 5 Install KDE Desktop Graphical Interface and Connect Using VNC Viewer
          • CentOS7
            • 2 Install GNOME Graphical Interface and Connect Using VNC Viewer
          • Install GNOME GUI on CentOS 7_2 and Connect via VNC Viewer
          • Install GUI on CentOS 8 and Connect via VNC Viewer
          • Install KDE Desktop GUI on CentOS 6_5 and Connect via VNC Viewer
        • opensuse
          • opensuse42
            • 3 Install Graphical Interface and Connect Using VNC Viewer
          • Install GUI on OpenSUSE 42_3 and Connect via VNC Viewer
        • Ubuntu
          • Ubuntu14
            • 04 Install Graphical Interface and Connect Using VNC Viewer
          • Ubuntu18
            • 04 Install Graphical Interface and Connect Using VNC Viewer
          • Install GUI on Ubuntu 14_04 and Connect via VNC Viewer
          • Install GUI on Ubuntu 18_04 and Connect via VNC Viewer
      • Performance test
        • Linux CPU Performance Test
        • Linux Disk IO Performance Test
        • Linux Network Performance Test
      • Ubunut16_04 Subscription Extended Security Maintenance (ESM)
    • Server configuration
      • Debian 9 Software Source Configuration Update
      • Linux PIP Configuration with Baidu Source
      • Online Instance with OFED Driver Kernel Replacement Solution
      • Windows PIP Configuration with Baidu Source
    • Windows Operations Reference
      • Blue Screen Crash General Handling Method
      • Configure Multi-User Access to Windows Server
      • Connecting to Windows Server Using Xshell
      • Data Disk Not Displayed After Server Reboot
      • Desktop and Application Color Turning Black Handling Method
      • Local Playback of Sound from Windows Server
      • Performance Resources
      • Remote Connection to Windows Unable to Use Clipboard
      • System Activation
      • System Black Screen Handling Method
      • Tutorial on Disabling Windows Firewall
      • Windows Allow Single User to Connect Multiple Sessions Method
      • Windows automatic update-related configuration
      • Windows BCC Instance Achieve SID Uniqueness After Joining Domain
      • Windows BCC Instance Lagging Issue
      • Windows CPU and Memory Full Troubleshooting Steps
      • Windows Delete Hardware Reserved Memory
      • Windows Instance Disk Space Insufficient Cleanup Tutorial
      • Windows Modify Default Remote Connection Port
      • Windows Quick Login
      • Windows Server Disable IE Enhanced Security Configuration Tutorial
      • Windows Set Only Allow Local & Fixed IP Access Remote Port
      • Windows Virtual Machine Auto Login Failure Handling Method
  • Product Description
    • Application scenarios
    • Correspondence Between Original and New Model Names
    • Discontinued Instance Specifications
    • Models and Their Regions
    • Product advantages
    • Usage restrictions
    • What Is Baidu Cloud Compute BCC
    • Instance specification
  • Product pricing
    • Billing overview
    • Charge type
      • Postpay Pricing
      • Reserved instances
      • Subscription (Prepay) Pricing
      • Reserved Instance
    • Refund policy
  • Python-SDK
    • BccClient
    • Disk
    • Image
    • Initialization
    • Install the SDK Package
    • Instance
    • Overview
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
    • Version Change Records
  • Python3-SDK
    • Automatic snapshot policy
    • BccClient
    • Dedicated CDS Cluster
    • Deployment group
    • Disk
    • Image
    • Initialization
    • Install the SDK Package
    • Instance
    • Key pair
    • Overview
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
  • Quick Start
    • Baidu Cloud Compute Security Description
    • Quick Configuration of Linux Baidu Cloud Compute
    • Quick Configuration of Windows Baidu Cloud Compute
  • Resources
    • Baidu AI Cloud Image Service Agreement
    • Image Quick Guide
  • Service Level Agreement (SLA)
    • Baidu Intelligent Cloud Baidu Cloud Compute Trusted Cloud
    • BCC Service Level Agreement SLA (V3_0)
  • Tag Service API Reference
    • Appendix 1
    • Domain name
    • General Description
    • Interface List
      • Create tag
      • Delete tag
      • Tag List
      • View resources bound to a tag
    • Introduction
  • Transfer
    • Site Offline Migration Solution
    • Site Smooth Migration Solution
  • Typical Practices
    • Connecting to Windows Server Using Xshell
    • Environment Setup
      • Manual Deployment of SQL Server 2008 R2 Express Edition
      • One-Click Setup for Linux Palworld Server
      • One-Click Setup for Windows Palworld Server
      • Set Up FTP Service on Linux
      • Setting Up Baota on Linux
      • Setting Up Baota on Windows
      • Tutorial on Setting Up IIS and FTP on Windows
      • Typical Practice for Setting Up Access VPN
      • Installing MySQL 8_0 Using Yum on CentOS 7 yum
    • Set Up FTP Service on Linux
    • Tag Management Practice
    • Tutorial on Disabling IE Enhanced Security Configuration on Windows Server 2008
    • Tutorial on Disabling Windows Firewall
    • Website Building Tutorial
      • Building a Website Using IIS Service on Windows 2008 and Windows 2012
      • Deploy SSL Certificate on Baidu Cloud Compute - Apache
      • Deploy SSL Certificate on Baidu Cloud Compute - IIS
      • Deploy SSL Certificate on Baidu Cloud Compute - Nginx
      • Deploy SSL Certificate on Baidu Cloud Compute - Tomcat
      • Installing and Configuring Apache Environment on Windows
      • Installing and Configuring Nginx Environment on Windows
      • CentOS-7_2 LNMP Environment Deployment
      • Deploy LAMP Environment on CentOS-7_2
  • Video Zone
    • Fault handling
    • Operation guide
      • Basic Functions
      • Environment Setup
      • Network Related
      • Operations Reference
      • Paasword Function
    • Operation guide
    • Product introduction
All documents
menu
No results found, please re-enter

BCC BCC

  • API Reference
    • Appendix
    • Automatic Snapshot Policy Related Interfaces
      • Bind automatic snapshot policy
      • Create automatic snapshot policy
      • Delete automatic snapshot policy
      • Query details of automatic snapshot policy
      • Query the list of automatic snapshot policies
      • Unbind automatic snapshot policy
      • Update automatic snapshot policy
    • Cluster Management Related Interfaces
      • Create EHC Cluster
      • Delete EHC Cluster
      • EHC Cluster List
      • Modify EHC Cluster
    • Common Request Headers and Response Headers
    • Dedicated Cluster Related Interfaces
      • Canceling Dedicated Cluster Auto-Renewal
      • Create a dedicated cluster
      • Dedicated Cluster Renewal
      • Dedicated Cluster Tag Binding
      • Dedicated Cluster Tag Unbinding
      • Enabling Dedicated Cluster Auto-Renewal
      • Querying Dedicated Cluster Details
      • Querying Dedicated Cluster List
      • Resizing Dedicated Cluster
    • Deployment Group Related Interfaces
      • Adjust Deployment Group
      • Create Deployment Group
      • Delete Deployment Group
      • Get Deployment Group Details
      • Modify deployment group
      • Query the deployment group list
      • Remove Instance from Deployment Group
    • Disk Related Interfaces
      • Attach a CDS disk
      • Bind a tag to a disk
      • Cancel Auto-renewal
      • Create a CDS disk
      • Detach a CDS disk
      • Disk Expansion and Type Change
      • Enable auto-renewal
      • Get Purchasable Disk Information
      • Modify disk properties
      • Query CDS Price
      • Query disk details
      • Query the disk list
      • Release a CDS disk (new)
      • Release a CDS disk
      • Rename a disk
      • Renew a disk
      • Roll back disk data
      • Shift charge for disks
      • Unbind a tag from a disk
    • Error response
    • General Description
    • Image Related Interfaces
      • Bind a tag to an image
      • Cancel cross-region replication of custom images
      • Create a custom image
      • Delete a custom image
      • Import an image
      • Modify Custom Image Name
      • Query available public image based on instance specifications
      • Query image details
      • Query List of Users with Shared Image Access
      • Query OS information based on instance IDs in batch
      • Query the image list
      • Replicate a custom image across regions
      • Share a custom image
      • Unbind a tag from an image
      • Unshare a custom image
    • Instance Related Interfaces
      • Add an instance to a security group
      • Add IPv6
      • Batch Adding Secondary IP Addresses for Primary Network Interface Card
      • Batch Convert to Postpay
      • Batch Unsubscribe Prepaid Instances
      • Billing Change - Convert to Subscription
      • Bind a role
      • Bind a tag to an instance
      • Change the instance subnet
      • Change the instance VPC
      • Convert to prepay in batch
      • Create an instance (by specifying instance package specifications)
      • Create automatic renewal rules
      • Create instance
      • Delete automatic renewal rules
      • Delete secondary IP address from the primary network interface card in batch
      • Early Release of Prepaid Instances
      • Enter rescue mode
      • Exit rescue mode
      • Instance Resizing (By Specifying Instance Package Specification)
      • Modify instance attributes
      • Modify instance description
      • Modify instance hostname
      • Modify the instance password
      • Query Instance List by Instance ID
      • Query instance list
      • Query Multiple Instance Details
      • Query recycle bin instance list
      • Query resizing specifications
      • Query the custom data of the instance
      • Query the details of a specified instance
      • Query the list of BCC instances eligible for no charge for stopped instances
      • Query the VNC address of the instance
      • Reboot an instance
      • Reinstall an instance
      • Reinstall OS for Instances (Batch Reinstallation)
      • Release instances in batch
      • Release IPv6
      • Release Postpay Instances (Release via POST Request)
      • Release recycle bin instances
      • Remove an instance from a security group
      • Remove the relationship between an instance and its deployment group
      • Renew an instance
      • Resize instances in batches
      • Resuming Billing for BCC in Recycle Bin
      • Retrieve a list of instance roles
      • Retrieve network interface card information for an instance
      • Set Auto-release of Spot Instance EIP
      • Set Instance Deletion Protection
      • Setting Auto-Release for Postpay
      • Start an instance
      • Starting Instances (Batch Start)
      • Stop an instance
      • Stopping Instances (Batch Stop)
      • Unbind a role
      • Unbind a tag from an instance
    • Key Pair Related Interfaces
      • Bind a key pair
      • Change description of key pair
      • Create a key pair
      • Delete a key pair
      • Import a key pair
      • Query key pair details
      • Query the key pair list
      • Rename a key pair
      • Unbind a key pair
    • Maintenance platform APIs
      • Maintenance Records Related Interfaces
      • Maintenance Task Related Interfaces
      • Pre-authorization Related Interfaces
    • Other APIs
      • Query instance package price
      • Query instance package specifications (new)
      • Querying Availability Zones By Package Specification
    • Overview
    • Region and Availability Zone Related Interfaces
      • Query list of availability zones
      • Retrieve the Domain Name List API
    • Reserved Instance Related Interfaces
      • Accept Reserved Instance Transfer
      • Adjust reserved instance
      • Bind Tag to Reserved Instance
      • Create Auto-renewal Rule for Reserved Instance
      • Create reserved instances
      • Disable Auto-renewal Rule for Reserved Instance
      • Initiate Reserved Instance Transfer
      • Query Reserved Instance
      • Reject Reserved Instance Transfer
      • Renew reserved instances
      • Reserved Instance Inbound List
      • Reserved Instance Outbound List
      • Revoke Reserved Instance Transfer
      • Unbind Tag from Reserved Instance
    • Security Group Related Interfaces
      • Authorize security group rules
      • Create a security group
      • Delete a security group
      • Delete security group rules
      • Instance associating with security group
      • Query the security group list
      • Replace security group for instance
      • Revoke security group rules
      • Unbind security group from instance
      • Update security group rules
    • Service domain
    • Snapshot Related Interfaces
      • Bind a tag to a snapshot chain
      • Create a snapshot
      • Delete a snapshot
      • Query snapshot chain list
      • Query snapshot details
      • Query the snapshot list
      • Replicate a snapshot across regions
      • Unbind a tag from a snapshot chain
    • Spot Instance Related Interfaces
      • Cancel Spot Instance Order
      • Create spot instances
      • Query Spot Instance Packages
      • Query Spot Price
  • Cloud Assistant API and SDK Reference
    • Python SDK
      • Batch Retrieval of bsm-agent State within Instances
      • CaClient
      • Command Interface
      • Historical records
      • Initialization
      • Install SDK
      • Log API
  • Cloud Assistant API Reference
    • Batch Retrieve Instance BSM-Agent Status
    • Command Interface
    • Common Request and Response Headers
    • Error response
    • General Description
    • Historical records
    • Log API
    • Service domain
  • FAQs
    • Billing class
    • Common Questions Overview
    • Images
    • Instances
    • Network class
    • Performance
    • Reserved Instance
    • Security class
    • Snapshots
    • Storage class
    • Virtual machine operation and maintenance class
  • Fault handling
    • GPU Instance Downtime Troubleshooting
    • Linux Baidu Cloud Compute Entering Single User Mode to Reset Paasword Reports Error-Authentication token lock busy
    • Linux Baidu Cloud Compute Entering Single User Mode to Reset Paasword Reports Error-Authentication token manipulation error
    • Linux Baidu Cloud Compute Entering Single User Mode to Reset Root Paasword
    • Linux Baidu Cloud Compute Execution Yum Update Reports Dependency Conflict
    • Linux Baidu Cloud Compute Setting Login Method
    • Unable to Remotely Connect to Linux Instance
    • Unable to Remotely Connect to Windows Instance
    • Windows Server Cannot Ping
  • Function Release Records
  • Go-SDK
    • Automatic snapshot policy
    • Availability zone
    • Dedicated CDS Cluster
    • Deployment group
    • Disk
    • Elastic high-performance computing cluster
    • Image
    • Initialization
    • Instance
    • Key pair
    • Overview
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
  • Java-SDK
    • Automatic snapshot policy
    • Availability zone
    • BCC instance
    • BccClient
    • Deployment group
    • Disk
    • Exception handling
    • Image
    • Install the SDK Package
    • Key pair
    • Log
    • Overview
    • Quick Start
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
    • Version Change Records
  • Operation guide
    • Deployment group
      • Adjust Deployment Group for Existing Instances
      • Create BCC Instance within Deployment Group
      • Create Deployment Group
      • Delete Deployment Group
      • Modify Deployment Group Information
      • Overview of deployment policy
      • Remove BCC Instance from Deployment Group
    • Elastic high-performance computing cluster
      • Create Elastic High-performance Computing Cluster
      • Overview of elastic hyper-computing cluster
    • Image
      • Baidu AI Cloud Image Service Agreement
      • Create a custom image
      • Creating Linux Image Based on Local System
      • Cross-region image replication
      • Data and Personal Information Protection Statement
      • Delete a custom image
      • How to Set Network Adapter Multi-Queue Properties
      • Image List
      • Image Overview
      • Image Quick Guide
      • Import Custom Image
        • Checking Network Configuration
        • Checking Virtio Driver
        • Creating Instance Using Imported Custom Image
        • Detecting Image Using Image Detection Tool
        • Image format check
        • Image Format Conversion
        • Image Import Restrictions
        • Import Overview
        • Install cloudbase-init
        • Installing Virtio Driver
        • System Optimization Operations (Linux)
      • OS Official End of Maintenance Plan
      • Public Image Release Records
        • 2023 BCC Public Image Release Records
        • 2023 EBC Public Image Release Records
        • 2024 BCC Public Image Release Records
        • 2024 EBC Public Image Release Records
        • 2025 BCC Public Image Release Records
      • Reinstall OS
      • Share a custom image
      • Windows Image Creation
    • Instance
      • Batch Sequential Naming
      • Change Availability Zone
      • Change Charge Type
        • Postpay to Subscription
        • Subscription to Postpay
      • Change Instance Configuration
      • Create instance
        • Create Instance Navigation
        • Create Instance via Custom Image
        • Create Instance via Purchase Page
        • Create Instances with Launch Templates
        • Purchase Instance with Same Configuration
      • Cross-AZ migration
      • Functional restrictions
      • Instance Overview
      • Modify instance name
      • Postpay Instance No Charge for Stopped Instances
      • Reboot an instance
      • Reclaim instance
      • Release an instance
      • Renew an instance
      • Reset password
      • Set IAM Role
      • Sign in to instance
        • Log in to Linux Instance
          • Connect to Baidu Cloud Compute Using SmartTerm
          • Connect to Linux instance using user name-password certification
          • Log in to Linux Instance Using SSH Key on Linux or Mac
          • Log in to Linux Instance Using SSH Key via SecureCRT
          • Remotely sign in to Baidu Cloud Computer via VNC
          • Sign in to Linux instances via SSH key in Putty
          • Sign in to Linux instances via SSH key in Xshell
        • Log in to Windows Instance
          • Remotely sign in to Baidu Cloud Computer via VNC
          • Sign in to Windows instance via remote desktop
        • Login Method Overview
      • Spot instances
        • Create spot instances
        • What Is Spot Instance
      • Start an instance
      • Stop an instance
        • Elastic Baremetal Instance and Elastic High-performance Computing Cluster Instance Halt Capability Configuration Instructions
        • Stop an instance
      • View instance
    • Launch Template
    • Network
      • Bind and Unbind EIP
      • Change Internal IP
      • Change subnet
      • Change VPC
      • Configure Dual Network Interface Card External Network Access for Windows Baidu Cloud Compute
      • Configure IPv6 Address
      • Elastic network interface
        • Configure elastic network interface
        • Create elastic network interface
        • Elastic Network Interface Overview
        • Mount elastic network interface
      • Elastic RDMA Network Interface
        • Elastic RDMA Network Interface Overview
        • Instructions for use
    • Operations and Monitor
      • Cloud Assistant
        • Cloud Assistant Overview
        • Cloud Assistant Usage Notes
        • Create command
        • FAQs
        • Historical records
        • Identity and access management
        • Instance list
        • My commands
        • Public commands
        • Upload files
      • Evacuate Faulty Instance
      • Instance Health Check
      • Maintenance Platform
        • Maintenance Platform Access Instructions
        • Maintenance Platform Overview
        • Maintenance Records Query
        • Maintenance Task
        • Pre-authorization Rule Settings
      • Monitor and Alarm
      • Self-Service Diagnostic Tool
        • Application Performance Diagnostic Tool Btune
        • Self-Service Diagnostic Tool Overview
      • Use Rescue Mode
    • Reserved Instance
      • FAQ
      • Introduction to reserved instance
      • Renew reserved instances
      • Reserved Instance AZ Change
      • Reserved Instance Cross-Account Transfer
      • Reserved Instance EHC Cluster Change
      • Reserved Instance Purchase
    • Resource Assessment
    • Security
      • Identity and access management
        • Identity and access management
        • Price Permission Control
      • Key pair
        • Bind SSH Key Pair
        • Create SSH Key Pair
        • Delete SSH Key Pair
        • SSH Key Pair Overview
        • Unbind SSH Key Pair
      • Security group
        • Associate with security group
        • Copy security group
        • Create a security group
        • Delete a security group
        • Disassociate security group
        • Edit security group
        • Security group overview
    • Server Migration
      • Migration Operation Steps
      • Server Migration Operation Process
      • Server Migration Overview
    • Snapshot
      • Automatic snapshot
      • Create disk snapshot
      • Delete a snapshot
      • Rollback snapshot
      • Snapshot Overview
    • Storage
      • Overview
      • System disk expansion
    • Tag Management
      • Configure Tag
      • Tag Management Overview
      • View Resource Bill Based on Tag
  • Operations Reference
    • Linux Operations Reference
      • Baidu Cloud Compute Delete or Modify File Prompting File System Read-Only
      • CentOS 7 Install Docker
      • Configure Linux Analysis Tools atop and kdump
      • Enter Single User Mode
        • CentOS 6 Enter Single User
        • CentOS 7 Enter Single User
        • CentOS 8 Enter Single User
        • FreeBSD 11 Single User Modify Password SOP
        • opensuse42
          • 3 Enter Single User
        • Ubuntu Enter Single User
        • OpenSUSE 42_3 Enter Single User
      • How to Enable or Disable Intel CPU Vulnerability Patch in Linux Image
      • How to Handle System Boot Exception Caused by fstab Configuration
      • How to Resolve Unable to Log in to Linux BCC Instance via SSH
      • Linux BCC Instance Insufficient Space Issue Resolution
      • Linux BCC Instance Lagging Issue
      • Linux Format and Mount Instance Mount Local Disk
      • Linux Modify Default Remote Connection Port
      • Linux Server CPU and Memory Full Issue Troubleshooting
      • Linux System Install Graphical Interface and Remote Connection
        • CentOS
          • CentOS 8 Install Graphical Interface and Connect Using VNC Viewer
          • CentOS6
            • 5 Install KDE Desktop Graphical Interface and Connect Using VNC Viewer
          • CentOS7
            • 2 Install GNOME Graphical Interface and Connect Using VNC Viewer
          • Install GNOME GUI on CentOS 7_2 and Connect via VNC Viewer
          • Install GUI on CentOS 8 and Connect via VNC Viewer
          • Install KDE Desktop GUI on CentOS 6_5 and Connect via VNC Viewer
        • opensuse
          • opensuse42
            • 3 Install Graphical Interface and Connect Using VNC Viewer
          • Install GUI on OpenSUSE 42_3 and Connect via VNC Viewer
        • Ubuntu
          • Ubuntu14
            • 04 Install Graphical Interface and Connect Using VNC Viewer
          • Ubuntu18
            • 04 Install Graphical Interface and Connect Using VNC Viewer
          • Install GUI on Ubuntu 14_04 and Connect via VNC Viewer
          • Install GUI on Ubuntu 18_04 and Connect via VNC Viewer
      • Performance test
        • Linux CPU Performance Test
        • Linux Disk IO Performance Test
        • Linux Network Performance Test
      • Ubunut16_04 Subscription Extended Security Maintenance (ESM)
    • Server configuration
      • Debian 9 Software Source Configuration Update
      • Linux PIP Configuration with Baidu Source
      • Online Instance with OFED Driver Kernel Replacement Solution
      • Windows PIP Configuration with Baidu Source
    • Windows Operations Reference
      • Blue Screen Crash General Handling Method
      • Configure Multi-User Access to Windows Server
      • Connecting to Windows Server Using Xshell
      • Data Disk Not Displayed After Server Reboot
      • Desktop and Application Color Turning Black Handling Method
      • Local Playback of Sound from Windows Server
      • Performance Resources
      • Remote Connection to Windows Unable to Use Clipboard
      • System Activation
      • System Black Screen Handling Method
      • Tutorial on Disabling Windows Firewall
      • Windows Allow Single User to Connect Multiple Sessions Method
      • Windows automatic update-related configuration
      • Windows BCC Instance Achieve SID Uniqueness After Joining Domain
      • Windows BCC Instance Lagging Issue
      • Windows CPU and Memory Full Troubleshooting Steps
      • Windows Delete Hardware Reserved Memory
      • Windows Instance Disk Space Insufficient Cleanup Tutorial
      • Windows Modify Default Remote Connection Port
      • Windows Quick Login
      • Windows Server Disable IE Enhanced Security Configuration Tutorial
      • Windows Set Only Allow Local & Fixed IP Access Remote Port
      • Windows Virtual Machine Auto Login Failure Handling Method
  • Product Description
    • Application scenarios
    • Correspondence Between Original and New Model Names
    • Discontinued Instance Specifications
    • Models and Their Regions
    • Product advantages
    • Usage restrictions
    • What Is Baidu Cloud Compute BCC
    • Instance specification
  • Product pricing
    • Billing overview
    • Charge type
      • Postpay Pricing
      • Reserved instances
      • Subscription (Prepay) Pricing
      • Reserved Instance
    • Refund policy
  • Python-SDK
    • BccClient
    • Disk
    • Image
    • Initialization
    • Install the SDK Package
    • Instance
    • Overview
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
    • Version Change Records
  • Python3-SDK
    • Automatic snapshot policy
    • BccClient
    • Dedicated CDS Cluster
    • Deployment group
    • Disk
    • Image
    • Initialization
    • Install the SDK Package
    • Instance
    • Key pair
    • Overview
    • Region
    • Reserved Instance
    • Security group
    • Snapshot
  • Quick Start
    • Baidu Cloud Compute Security Description
    • Quick Configuration of Linux Baidu Cloud Compute
    • Quick Configuration of Windows Baidu Cloud Compute
  • Resources
    • Baidu AI Cloud Image Service Agreement
    • Image Quick Guide
  • Service Level Agreement (SLA)
    • Baidu Intelligent Cloud Baidu Cloud Compute Trusted Cloud
    • BCC Service Level Agreement SLA (V3_0)
  • Tag Service API Reference
    • Appendix 1
    • Domain name
    • General Description
    • Interface List
      • Create tag
      • Delete tag
      • Tag List
      • View resources bound to a tag
    • Introduction
  • Transfer
    • Site Offline Migration Solution
    • Site Smooth Migration Solution
  • Typical Practices
    • Connecting to Windows Server Using Xshell
    • Environment Setup
      • Manual Deployment of SQL Server 2008 R2 Express Edition
      • One-Click Setup for Linux Palworld Server
      • One-Click Setup for Windows Palworld Server
      • Set Up FTP Service on Linux
      • Setting Up Baota on Linux
      • Setting Up Baota on Windows
      • Tutorial on Setting Up IIS and FTP on Windows
      • Typical Practice for Setting Up Access VPN
      • Installing MySQL 8_0 Using Yum on CentOS 7 yum
    • Set Up FTP Service on Linux
    • Tag Management Practice
    • Tutorial on Disabling IE Enhanced Security Configuration on Windows Server 2008
    • Tutorial on Disabling Windows Firewall
    • Website Building Tutorial
      • Building a Website Using IIS Service on Windows 2008 and Windows 2012
      • Deploy SSL Certificate on Baidu Cloud Compute - Apache
      • Deploy SSL Certificate on Baidu Cloud Compute - IIS
      • Deploy SSL Certificate on Baidu Cloud Compute - Nginx
      • Deploy SSL Certificate on Baidu Cloud Compute - Tomcat
      • Installing and Configuring Apache Environment on Windows
      • Installing and Configuring Nginx Environment on Windows
      • CentOS-7_2 LNMP Environment Deployment
      • Deploy LAMP Environment on CentOS-7_2
  • Video Zone
    • Fault handling
    • Operation guide
      • Basic Functions
      • Environment Setup
      • Network Related
      • Operations Reference
      • Paasword Function
    • Operation guide
    • Product introduction
  • Document center
  • arrow
  • BCCBCC
  • arrow
  • Go-SDK
  • arrow
  • Disk
Table of contents on this page
  • Create a CDS disk
  • Query the disk list
  • Query disk details
  • Attach a CDS disk
  • Detach a CDS disk
  • Release a CDS disk
  • Release a disk (POST)
  • Rename a disk
  • Modify disk properties
  • Shift charge for disks
  • Enable automatic renewal for disks
  • Disable automatic renewal for disks
  • Disk expansion
  • Roll back disk data
  • Renew a disk
  • Release a CDS disk (new)
  • Query disk information available for purchase in a specific availability zone
  • Bind a tag to a disk
  • Unbind a tag from a disk

Disk

Updated at:2025-10-20

Create a CDS disk

Support creating a cloud disk server (CDS)or creating a CDS disk from a CDS data disk snapshot. You can create a CDS disk by referring to the following code:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14	args := &api.CreateCDSVolumeArgs{
15 PurchaseCount: 2,                  // Purchase count
16 CdsSizeInGB:   5,                  // Disk size
17 StorageType:   api.StorageTypeHdd, // Storage class
18 ChargeType:   api.PaymentTimingPostPaid, // Bill type
19 ZoneName:    "cn-bj-c",         // Availability zone
20 Name:        "test-create-cds", // Disk name
21 Description: "test-desc", // Disk description
22 Tags: []model.TagModel{ // Bound tags
23            {
24 // Tag key
25                TagKey:   "Key-***",
26 // Tag value
27                TagValue: "Value***",
28            },
29        },       
30	}
31	result, err := bccClient.CreateCDSVolume(args)
32	if err != nil {
33            fmt.Println("create CDS volume failed:", err)
34        } else {
35            fmt.Println("create CDS volume success: ", result)
36        }
37}

Prompt:

  • The CDS disk creation API is asynchronous. You can query the disk status through the [Query Disk Details](#Query disk details) API. For detailed use of the API, please refer to the BCC API documentation Query Disk Details

Query the disk list

You can query all disk lists with the following code. It supports pagination queries and filtering based on the BCC instance ID to which the cloud disk server is attached:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Parameters for querying the disk list
15	queryArgs := &api.ListCDSVolumeArgs{
16 Marker:     "v-3uIJ",  // Starting disk ID
17 MaxKeys:    10,            // Maximum count of results to return
18 InstanceId: "i-cVh8", // Instance ID to which the disk is attached
19 ZoneName:   "cn-bj-a",         // Availability zone
20 ClusterId:  "DC-rWKx****", // Dedicated cluster ID
21	}
22	res, err := bccClient.ListCDSVolume(queryArgs)
23	if err != nil {
24		fmt.Println(err)
25	} else {
26		fmt.Println(res)
27	}
28}

Query disk details

You can retrieve detailed information about a specific disk with its disk ID, and you can query disk details with the following code:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5)
6func main() {
7 // Set your AK, SK and the endpoint to be accessed
8	ak := "ak"
9	sk := "sk"
10	endpoint := "bcc.bj.baidubce.com"
11 // Create a BCC client
12	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
13	
14 // Retrieve detailed information for a specified CDS volume
15 res, err := bccClient.GetCDSVolumeDetail("v-3uIJ****") // Specify the CDS disk ID
16	if err != nil {
17		fmt.Println(err)
18	} else {
19		fmt.Println(res)
20	}
21}

Attach a CDS disk

You can attach a detached disk to a corresponding BCC instance. The following code attaches a CDS disk to the corresponding BCC instance:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "http://bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14	args := &api.AttachVolumeArgs{
15 // Set instance ID to which the disk will be mounted
16		InstanceId: "i-***",
17	}
18	result, err := bccClient.AttachCDSVolume(
19 // Set the disk ID to be attached
20		"v-***",
21		args)
22	fmt.Println(result)
23	fmt.Println(err)
24}

Prompt:

  • The CDS disk must be attached to a BCC instance located in the same zone; otherwise, a 403 error will occur.
  • Mounting is only permitted when the disk status is "Available" and the instance status is either "Running" or "Stopped." Otherwise, calling this API will result in a 409 error.

Detach a CDS disk

You can detach an already attached disk from its corresponding BCC virtual machine. The following code can be used to detach a CDS disk:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "http://bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14	args := &api.DetachVolumeArgs{
15 // Set instance ID to which the disk will be mounted
16		InstanceId: "i-***",
17	}
18	err := bccClient.DetachCDSVolume(
19 // Set the disk ID to be attached
20		"v-***",
21		args)
22	fmt.Println(err)
23}

Prompt:

  • This operation can only be performed when the instance is in the Running or Stopped state; otherwise, a 409 error will occur.
  • If the disk with the given volumeId is not attached to the instance with the given instanceId, the operation will fail, and a 404 error will occur.

Release a CDS disk

It is used to release unattached CDS disk. Specify whether to delete snapshots associated with the disk. By default, all snapshots of the disk will be retained, but the association with the disk will be removed.

Go
1err = client.DeleteCDSVolume(volumeId)
2if err != nil {
3    fmt.Println("delete CDS volume failed:", err)
4} else {
5    fmt.Println("delete CDS volume success")
6}

Prompt:

  • An attached CDS disk cannot be released, and system disks cannot be released either.
  • Once released, a disk cannot be recovered. By default, all snapshots of the disk will be retained, but their association with the disk will be removed.
  • This operation can only be executed when the disk status is "Available," "Expired," or "Error." Otherwise, a 409 error will be returned.

Release a disk (POST)

Prompt:

  • This API releases unattached CDS disks; system disks cannot be released.
  • Users can decide whether to delete snapshots associated with the disk. By default, all disk snapshots will be kept, but their association with the disk will be removed.
  • Users can specify whether to move the disk to the recycle bin
  • This operation can only be executed when the disk status is "Available," "Expired," or "Error." Otherwise, a 409 error will be returned.
  • If the disk corresponding to the volumeId does not exist, a 404 error will be returned You can release a disk with the following code:
Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14	
15 // Disk ID
16	volumeId := "v-***"                 
17	args := &api.DeleteCDSVolumeArgs{
18 // Whether to delete automatic snapshots associated with the disk
19		AutoSnapshot:   "on",
20 // Whether to delete manual snapshots associated with the disk
21		ManualSnapshot: "on",
22 // Whether to move the disk to the recycle bin; if set to off, the disk will be released directly without entering the recycle bin
23		Recycle:        "off",               
24	}
25    
26 // Request to release the disk
27	err := bccClient.DeleteCDSVolumeNew(volumeId, args)
28	fmt.Println(err)
29}

Rename a disk

You can rename a CDS disk with the following code:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 volumeId := "" // Disk ID to be renamed
15	args := &api.RenameCSDVolumeArgs{
16 Name: "testVolume", // New disk name
17	}
18	err := bccClient.RenameCDSVolume(volumeId, args)
19	if err != nil {
20		fmt.Println("rename CDS volume failed", err)
21	} else {
22		fmt.Println("rename CDS volume success")
23	}
24}

Modify disk properties

You can modify the name and description of a specified disk with the following code:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14	args := &api.ModifyCSDVolumeArgs{
15 CdsName: "name", // CDS name to be modified
16 Desc:    "desc", // Modified CDS description
17	}
18 volumeId := "v-vG0z****" // Disk ID
19	err := bccClient.ModifyCDSVolume(volumeId, args)
20	if err != nil {
21		fmt.Println("modify CDS volume failed: ", err)
22	} else {
23		fmt.Println("modify CDS volume success")
24	}
25}

Shift charge for disks

You can change the disk charge type using the code provided below. Two conversions are supported: from pay-as-you-go (postpay) to subscription (prepay) and vice versa. When switching to subscription (prepay), you must specify the purchase period.

  • You can switch a subscribed (prepaid) disk to a pay-as-you-go (postpaid) billing model using the following code.
Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14	
15 // Disk ID
16	volumeId := "v-***"                     
17	args := &api.ModifyChargeTypeCSDVolumeArgs{   
18		Billing: &api.Billing{
19 // Postpay flag, optional
20			PaymentTiming: api.PaymentTimingPostPaid,
21		},
22	}
23 // Request to change a prepaid disk to be postpaid
24	err := bccClient.ModifyChargeTypeCDSVolume(volumeId, args)
25	fmt.Println(err)    
26}
  • You can change a pay-as-you-go (postpaid) disk to a subscribed (prepaid) disk with the following code:
Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Disk ID
15	volumeId := "v-***"                    
16	args := &api.ModifyChargeTypeCSDVolumeArgs{
17		Billing: &api.Billing{
18 // Prepay flag, optional
19			PaymentTiming: api.PaymentTimingPrePaid,
20			Reservation: &api.Reservation{
21 // Reserved duration, in month, value range [1,9]
22				ReservationLength:   1,
23 // Unit of reserved duration. Currently, only month is supported, and it is not required.
24				ReservationTimeUnit: "month",
25			},
26		},
27	}
28 // Request to change the postpaid disk to the prepaid disk
29	err := bccClient.ModifyChargeTypeCDSVolume(volumeId, args)
30	fmt.Println(err)
31}

Enable automatic renewal for disks

You can enable automatic renewal for disks with the following code:

Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14    
15    volumeId := "v-***"
16	renewTimeUnit := "month"
17 // Set auto-renewal period: 1-9 for monthly renewal, 1-3 for yearly renewal
18	renewTime := 4
19	args := &api.AutoRenewCDSVolumeArgs{
20 // Disk ID
21		VolumeId:      volumeId,
22 // Unit of renewal time, current value: month
23		RenewTimeUnit: renewTimeUnit,
24 // Renewal time, value range: 1-9
25		RenewTime:     renewTime,			
26	}
27	err := bccClient.AutoRenewCDSVolume(args)
28	fmt.Println(err)   
29}
  • Note: Auto-renewal is only supported for data disks.
  • Note: Auto-renewal cannot be performed for disks with an expired status.
  • This asynchronous API allows you to check the disk expiration time using the Query Disk Details API.

Disable automatic renewal for disks

You can disable auto-renewal for disks with the following code:

Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14    
15    volumeId := "v-***"
16	args := &api.CancelAutoRenewCDSVolumeArgs{
17 // Disk ID
18		VolumeId: volumeId,
19	}
20	err := bccClient.CancelAutoRenewCDSVolume(args)
21	fmt.Println(err)
22}
  • Note: Auto-renewal can only be disabled for data disks.
  • This asynchronous API allows you to check the disk expiration time using the Query Disk Details API.

Disk expansion

You can expand the disk size with the following code:

Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Disk ID
15    volumeId := "v-***"
16 // Request parameter for expanding the disk size
17	args := &api.ResizeCSDVolumeArgs{
18 // Expansion size, in GB
19		NewCdsSizeInGB: 60,
20 // Expansion type
21		NewVolumeType:  api.StorageTypeEnhancedPl1,   
22	}
23    
24 // Request to expand the CDS disk, changing both disk type and size
25	err := bccClient.ResizeCDSVolume(volumeId, args)
26	fmt.Println(err)
27}

Prompt:

  • Disks can only be expanded; reducing their size is not supported.
  • Only disks in the "Available" status can undergo expansion operation
  • Disk expansion is executed by an asynchronous API; the disk expansion status can be queried through the [Query Disk Details](#Query disk details) API.

Roll back disk data

You can use a snapshot of the specified disk itself to roll back disk data, and you can perform disk data rollback with the following code:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 volumeId := "v-zBms****"   // Disk ID
15	
16	args := &api.RollbackCSDVolumeArgs{
17 SnapshotId: "s-HkbJ****",   // Snapshot ID
18	}
19	err := bccClient.RollbackCDSVolume(volumeId, args)
20	if err != nil {
21		fmt.Println(err)
22	}
23}

Prompt:

  • The disk must be in the "Available" status to initiate a rollback.
  • The snapshot ID specified must originate from the same disk ID.
  • When rolling back a system disk, ensure the instance status is either Running or Stopped before initiating this operation.
  • When rolling back a system disk snapshot, all data generated on the system disk after the snapshot was created will be completely lost and cannot be recovered.

Renew a disk

Renewing a disk extends its expiration duration. You can renew a disk with the following code:

Go
1package main
2import (
3	"fmt"
4	"github.com/baidubce/bce-sdk-go/services/bcc"
5	"github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9	ak := "ak"
10	sk := "sk"
11	endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13	bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Configuration parameters for the instance to be modified
15	args := &api.PurchaseReservedCSDVolumeArgs{
16		Billing: &api.Billing{
17			PaymentTiming: api.PaymentTimingPrePaid,
18			Reservation: &api.Reservation{
19 ReservationLength:   1,       // Renewal period
20 ReservationTimeUnit: "month", // Unit of renewal period
21			},
22		},
23	}
24 volumeId := "v-dj5Q****"   // Disk ID
25	err := bccClient.PurchaseReservedCDSVolume(volumeId, args)
26	if err != nil {
27		fmt.Println("purchase reserve CDS volume failed:", err)
28	} else {
29		fmt.Println("purchase reserve CDS volume success")
30	}
31}

Release a CDS disk (new)

You can release a CDS disk along with its associated snapshots and specify whether to move them to the recycle bin with the following code

Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Disk ID
15	volumeId := "v-***"                 
16	args := &api.DeleteCDSVolumeArgs{
17 // Whether to delete automatic snapshots associated with the disk
18		AutoSnapshot:   "on",
19 // Whether to delete manual snapshots associated with the disk
20		ManualSnapshot: "on",
21 // Whether to move the disk to the recycle bin; if set to off, the disk will be released directly without entering the recycle bin
22		Recycle:        "off",               
23	}
24    
25 // Request to release the disk
26	err := bccClient.DeleteCDSVolumeNew(volumeId, args)
27	fmt.Println(err)
28}

Prompt:

  • This API releases unattached CDS disks; system disks cannot be released.
  • Compared to the old API, this version provides functionality for controlling whether snapshots associated with the disk should be deleted.

Query disk information available for purchase in a specific availability zone

You can query disk information available for purchase in a designated availability zone with the following code

GO
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Availability zone name; when the passed zoneName is an empty string or an invalid zone, purchasable disk information for all availability zones will be returned.
15    zoneName := "cn-bj-d"			
16	
17 // Request to query purchasable disk information in the availability zone
18	result, err := bccClient.GetAvailableDiskInfo(zoneName)
19	fmt.Println(err)
20	fmt.Println(result)
21}

Bind a tag to a disk

You can bind a tag to a specified disk with the following code

Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Disk ID
15    volumeId := "v-***"             
16	tagArgs := &api.TagVolumeArgs{
17 // Whether to bind the tag to the associated resource
18		RelationTag: false,             
19		ChangeTags: []api.Tag{
20			{
21 // Tag key
22				TagKey:   "Key-***",
23 // Tag value
24				TagValue: "Value***",
25			},
26			{
27 // Tag key
28				TagKey:   "Key-***",
29 // Tag value
30				TagValue: "Value***",
31			},
32		},
33	}
34 // Request to bind a tag to the disk
35	err := bccClient.TagVolume(volumeId, tagArgs)
36	fmt.Println(err)
37}

Unbind a tag from a disk

You can bind a tag to a specified disk with the following code

Go
1package main
2import (
3    "fmt"
4    "github.com/baidubce/bce-sdk-go/services/bcc"
5    "github.com/baidubce/bce-sdk-go/services/bcc/api"
6)
7func main() {
8 // Set your AK, SK and the endpoint to be accessed
9    ak := "ak"
10    sk := "sk"
11    endpoint := "bcc.bj.baidubce.com"
12 // Create a BCC client
13    bccClient, _ := bcc.NewClient(ak, sk, endpoint)
14 // Disk ID
15    volumeId := "v-***"              
16    tagArgs := &api.TagVolumeArgs{
17 // Whether to unbind the tag from the associated resource
18		RelationTag: false,             
19        ChangeTags: []api.Tag{
20            {
21 // Tag key
22				TagKey:   "Key-***",
23 // Tag value
24				TagValue: "Value***",
25			},
26            {
27 // Tag key
28				TagKey:   "Key-***",
29 // Tag value
30				TagValue: "Value***",
31			},
32        },
33    }
34 // Request to unbind a tag from the disk
35    err := bccClient.UntagVolume(volumeId, tagArgs)
36    fmt.Println(err)
37}

Previous
Deployment group
Next
Elastic high-performance computing cluster