@@ -962,6 +962,54 @@ Bytes read/write, as well as the total IO/s, are exposed via UI, as shown in the
962962These 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 for any such errors in the volume and helps in repairing them. This feature is currently available only
970+ for KVM and volumes with QCOW2 format. 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 check and repair any leaks of the volume during instance start and volume attach operations.
974+ This will help in repairing any leaks of the volume before using it. This is a blocking operation, 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+ .
991+ .
992+ " volumecheckresult" : {
993+ " allocated-clusters" : " 110" ,
994+ " check-errors" : " 0" ,
995+ " leaks" : 73,
996+ " filename" : " /mnt/e72364b6-eab0-369f-af0b-2ec8bed9d8ac/55937826-2f08-414a-9eef-4c6b7d6fd3b1" ,
997+ " format" : " qcow2" ,
998+ " fragmented-clusters" : " 32" ,
999+ " image-end-offset" : " 7995392" ,
1000+ " total-clusters" : " 131072"
1001+ },
1002+ " volumerepairresult" : {
1003+ " allocated-clusters" : " 110" ,
1004+ " check-errors" : " 0" ,
1005+ " leaks-fixed" : 73,
1006+ " filename" : " /mnt/e72364b6-eab0-369f-af0b-2ec8bed9d8ac/55937826-2f08-414a-9eef-4c6b7d6fd3b1" ,
1007+ " format" : " qcow2" ,
1008+ " fragmented-clusters" : " 32" ,
1009+ " image-end-offset" : " 7995392" ,
1010+ " total-clusters" : " 131072"
1011+ },
1012+ }
9651013
9661014Working with Volume Snapshots
9671015-----------------------------
0 commit comments