此内容没有您所选择的语言版本。

Chapter 10. Volumes


The volumes collection provides information about volumes in a Red Hat Gluster Storage environment.
The following table shows specific elements contained in a volume resource representation.
Expand
Table 10.1. Volume elements
Element Type Description Properties
volumeName relationship Name of the volume to be created.
volumeType relationship DISTRIBUTE, REPLICATE, DISTRIBUTED_REPLICATE.
replicaCount complex replicaCount is mandatory if volumeType is REPLICATE or DISTRIBUTED_REPLICATE
bricks complex list of bricks of a volume. You can add/remove bricks to/from a volume.
options complex list of options of the volume  

Example 10.1. An XML representation of a volume

  <gluster_volume href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50" id="6d4bc7ed-4278-45e1-973e-e9a5e061de50">
    <actions>
        <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/rebalance" rel="rebalance"/>
        <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/stoprebalance" rel="stoprebalance"/>
        <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/resetoption" rel="resetoption"/>
        <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/resetalloptions" rel="resetalloptions"/>
        <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/setoption" rel="setoption"/>
        <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/start" rel="start"/>
        <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/stop" rel="stop"/>
    </actions>
    <name>newVol</name>
    <link href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glustervolumes/6d4bc7ed-4278-45e1-973e-e9a5e061de50/bricks" rel="bricks"/>
    <cluster href="/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59" id="419590b8-5aa0-473b-9651-aa41f1372c59"/>
    <volume_type>distribute</volume_type>
    <transport_types>
        <transport_type>tcp</transport_type>
    </transport_types>
    <replica_count>0</replica_count>
    <options/>
    <status>
        <state>down</state>
    </status>
</gluster_volume>
Copy to Clipboard Toggle word wrap

10.1. Creating a Volume

Creation of a new volume requires the volumeName, volumeType,transportType and brick elements. The API creates a new volume with a POST request to the URI containing a representation of the new volume
.

Example 10.2. Creating a volume

POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes HTTP/1.1
Accept: application/xml
Content-type: application/xml

<gluster_volume>
  <name>data</name>
  <volume_type>distribute</volume_type>
  <bricks>
    <brick>
      <server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id>
      <brick_dir>/export/data/brick1</brick_dir>
    </brick>
    <brick>
      <server_id>de173e6a-fb05-11e1-a2fc-0050568c4349</server_id>
      <brick_dir>/export/data/brick2</brick_dir>
    </brick>
  </bricks>
</gluster_volume>
Copy to Clipboard Toggle word wrap
cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes -d "<gluster_volume><name>data</name><volume_type>DISTRIBUTE</volume_type><bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick1</brick_dir></brick><brick><server_id>de173e6a-fb05-11e1-a2fc-0050568c4349</server_id><brick_dir>/export/data/brick2</brick_dir></brick></bricks></gluster_volume>"
The API returns the following representation of the newly created volume resource:
HTTP/1.1 201 Created
Content-Type: application/xml

<gluster_volume href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554" id="83101900-2f12-4855-838e-36b8a9e04554">
    <name>data</name>
    <actions>
        <link href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/start" rel="start"/>
        <link href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/stop" rel="stop"/>
        <link href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/setOption" rel="setOption"/>
        <link href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/rebalance" rel="rebalance"/>
        <link href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/resetOption" rel="resetOption"/>
        <link href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/resetAllOptions" rel="resetAllOptions"/>
    </actions>
    <link href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks" rel="bricks"/>
    <cluster href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95" id="99408929-82cf-4dc7-a532-9d998063fa95"/>
    <volume_type>distribute</volume_type>
    <transport_types>
        <transport_type>TCP</transport_type>
    </transport_types>
    <replica_count>0</replica_count>
    <options/>
    <state>DOWN</state>
</gluster_volume>
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat