Skip to content

Commit ba90acd

Browse files
Documentation for checkVolume API
1 parent 13cc7e5 commit ba90acd

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

source/adminguide/storage.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,58 @@ Bytes read/write, as well as the total IO/s, are exposed via UI, as shown in the
962962
These statistics are obtained from the hypervisor directly and they represent
963963
"current" bytes/s and IO/s values at the time of collection.
964964
965+
Check and repair Volume
966+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
967+
968+
When there are any leaks or any inconsistencies in the volume, then the checkVolume API can be used to
969+
check any such errors in the volume and helps in repairing. This feature is currently available only
970+
for KVM. This API uses "qemu-img check" command on the KVM host.
971+
972+
Also a global or storage pool level setting "volume.check.and.repair.leaks.before.use" is available which allows
973+
to do a check and repair leaks operation for the volume during instance start and volume attach operations.
974+
This will help in repairing any leaks for the volume before using it. This is a blocking operations, meaning
975+
instance start or volume attach will be performed only after the check and repair operation is completed.
976+
The setting helps in defining whether to allow this operation or not.
977+
978+
checkVolume API takes two parameters as input
979+
980+
- "id" for the volume UUID
981+
982+
- "repair" an optional parameter whether to repair the volume or not. Parameter takes "leaks" or "all" as the input.
983+
984+
Following is the example for checkVolume API usage and the result in the volume response.
985+
986+
.. code:: bash
987+
988+
[root@mgmt]# cmk check volume id=55937826-2f08-414a-9eef-4c6b7d6fd3b1 repair=leaks
989+
{
990+
"jobid": "aaa6f348-cbbd-4ead-bea3-97114ab22351"
991+
}
992+
[root@mgmt]# cmk query asyncjobresult jobid=aaa6f348-cbbd-4ead-bea3-97114ab22351
993+
{
994+
.
995+
.
996+
"volumecheckresult": {
997+
"allocated-clusters": "110",
998+
"check-errors": "0",
999+
"leaks": 73,
1000+
"filename": "/mnt/e72364b6-eab0-369f-af0b-2ec8bed9d8ac/55937826-2f08-414a-9eef-4c6b7d6fd3b1",
1001+
"format": "qcow2",
1002+
"fragmented-clusters": "32",
1003+
"image-end-offset": "7995392",
1004+
"total-clusters": "131072"
1005+
},
1006+
"volumerepairresult": {
1007+
"allocated-clusters": "110",
1008+
"check-errors": "0",
1009+
"leaks-fixed": 73,
1010+
"filename": "/mnt/e72364b6-eab0-369f-af0b-2ec8bed9d8ac/55937826-2f08-414a-9eef-4c6b7d6fd3b1",
1011+
"format": "qcow2",
1012+
"fragmented-clusters": "32",
1013+
"image-end-offset": "7995392",
1014+
"total-clusters": "131072"
1015+
},
1016+
}
9651017
9661018
Working with Volume Snapshots
9671019
-----------------------------

0 commit comments

Comments
 (0)