
# 创建云硬盘
#### 操作场景
本章节指导用户通过API创建云硬盘。API的调用方法请参见[如何调用API](https://support.huaweicloud.com/api-evs/evs_04_0009.html)。
以从快照创建云硬盘为例。
#### 前提条件
您需要规划云硬盘所在的区域信息，并根据区域确定调用API的Endpoint，详细信息请参见[使用前必读](https://support.huaweicloud.com/api-evs/evs_04_0001.html)。
#### 操作步骤
1. 从快照创建云硬盘，请先查询云硬盘快照列表，获取快照信息。 
   API：查询云硬盘快照详情列表
   - 请求样例 GET https://*{endpoint}*/v2/ba546eb46e7247c9aadb566ed7a1d31f/cloudsnapshots/detail
     
   
   - 响应样例
     ```
     {
       "count": 1,
       "snapshots": [
         {
           "status": "available",
           "description": null,
           "metadata": {},
           "size": 40,
           "id": "0b126d3b-f2af-404d-8d39-a42fce70065a",
           "name": "snapshot-test",
           "created_at": "2019-06-18T12:47:33.700070",
           "updated_at": "2019-06-18T12:47:38.234689",
           "volume_id": "037cf89a-8cea-4d63-ac57-345c0ffccfc2",
           "os-extended-snapshot-attributes:project_id": "ba546eb46e7247c9aadb566ed7a1d31f",
           "os-extended-snapshot-attributes:progress": "100%",
           "service_type": "EVS"
         }
       ]
     }
     ```
     
   
   
   回显中的"id"即为快照的ID。
   
   
2. 通过快照ID创建云硬盘。 
   API：创建云硬盘
   - 请求样例
     POST https://*{endpoint}* /v2.1/ba546eb46e7247c9aadb566ed7a1d31f/cloudvolumes
     ```
     {
         "volume": {
             "count": 1, 
             "availability_zone": "az-dc-1", 
             "description": "test_volume_1", 
             "size": 120, 
             "snapshot_id": "0b126d3b-f2af-404d-8d39-a42fce70065a", 
             "name": "test_volume_1", 
             "volume_type": "SATA"
         }
     }
     ```
     
   
   - 响应样例
     ```
     {
       "job_id": "ff8080816b512df7016b6ab8982b496b"
     }
     ```
     
   
   
   
   
 
