From 5f20d1d96c03868a74ceccf5d3e9cbda635ce14d Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Mon, 5 Feb 2024 13:47:21 +0530 Subject: [PATCH 1/4] Documentation for checkVolume API --- source/adminguide/storage.rst | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/source/adminguide/storage.rst b/source/adminguide/storage.rst index 3e1a68f7ed..c84e5e7702 100644 --- a/source/adminguide/storage.rst +++ b/source/adminguide/storage.rst @@ -962,6 +962,58 @@ Bytes read/write, as well as the total IO/s, are exposed via UI, as shown in the These statistics are obtained from the hypervisor directly and they represent "current" bytes/s and IO/s values at the time of collection. +Check and repair Volume +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When there are any leaks or any inconsistencies in the volume, then the checkVolume API can be used to +check any such errors in the volume and helps in repairing. This feature is currently available only +for KVM. This API uses "qemu-img check" command on the KVM host. + +Also a global or storage pool level setting "volume.check.and.repair.leaks.before.use" is available which allows +to do a check and repair leaks operation for the volume during instance start and volume attach operations. +This will help in repairing any leaks for the volume before using it. This is a blocking operations, meaning +instance start or volume attach will be performed only after the check and repair operation is completed. +The setting helps in defining whether to allow this operation or not. + +checkVolume API takes two parameters as input + +- "id" for the volume UUID + +- "repair" an optional parameter whether to repair the volume or not. Parameter takes "leaks" or "all" as the input. + +Following is the example for checkVolume API usage and the result in the volume response. + +.. code:: bash + + [root@mgmt]# cmk check volume id=55937826-2f08-414a-9eef-4c6b7d6fd3b1 repair=leaks + { + "jobid": "aaa6f348-cbbd-4ead-bea3-97114ab22351" + } + [root@mgmt]# cmk query asyncjobresult jobid=aaa6f348-cbbd-4ead-bea3-97114ab22351 + { + . + . + "volumecheckresult": { + "allocated-clusters": "110", + "check-errors": "0", + "leaks": 73, + "filename": "/mnt/e72364b6-eab0-369f-af0b-2ec8bed9d8ac/55937826-2f08-414a-9eef-4c6b7d6fd3b1", + "format": "qcow2", + "fragmented-clusters": "32", + "image-end-offset": "7995392", + "total-clusters": "131072" + }, + "volumerepairresult": { + "allocated-clusters": "110", + "check-errors": "0", + "leaks-fixed": 73, + "filename": "/mnt/e72364b6-eab0-369f-af0b-2ec8bed9d8ac/55937826-2f08-414a-9eef-4c6b7d6fd3b1", + "format": "qcow2", + "fragmented-clusters": "32", + "image-end-offset": "7995392", + "total-clusters": "131072" + }, + } Working with Volume Snapshots ----------------------------- From 808e673e8036054d7200d132a5baa2df8bc05840 Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Wed, 7 Feb 2024 15:55:35 +0530 Subject: [PATCH 2/4] updated example command usage --- source/adminguide/storage.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/adminguide/storage.rst b/source/adminguide/storage.rst index c84e5e7702..e1608f17c5 100644 --- a/source/adminguide/storage.rst +++ b/source/adminguide/storage.rst @@ -986,10 +986,6 @@ Following is the example for checkVolume API usage and the result in the volume .. code:: bash [root@mgmt]# cmk check volume id=55937826-2f08-414a-9eef-4c6b7d6fd3b1 repair=leaks - { - "jobid": "aaa6f348-cbbd-4ead-bea3-97114ab22351" - } - [root@mgmt]# cmk query asyncjobresult jobid=aaa6f348-cbbd-4ead-bea3-97114ab22351 { . . From 062d4fa80ef0f21e716b7ad3a7cc2404cb813f28 Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Tue, 20 Feb 2024 12:42:17 +0530 Subject: [PATCH 3/4] Added volume format details --- source/adminguide/storage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/adminguide/storage.rst b/source/adminguide/storage.rst index e1608f17c5..731d593938 100644 --- a/source/adminguide/storage.rst +++ b/source/adminguide/storage.rst @@ -967,7 +967,7 @@ Check and repair Volume When there are any leaks or any inconsistencies in the volume, then the checkVolume API can be used to check any such errors in the volume and helps in repairing. This feature is currently available only -for KVM. This API uses "qemu-img check" command on the KVM host. +for KVM and volumes with QCOW2 format. This API uses "qemu-img check" command on the KVM host. Also a global or storage pool level setting "volume.check.and.repair.leaks.before.use" is available which allows to do a check and repair leaks operation for the volume during instance start and volume attach operations. From 7afacee9a604eb1aca90f40db6fbec1e510a1ab4 Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Tue, 20 Feb 2024 12:52:15 +0530 Subject: [PATCH 4/4] rephrasing some sentences --- source/adminguide/storage.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/adminguide/storage.rst b/source/adminguide/storage.rst index 731d593938..ffd7b25139 100644 --- a/source/adminguide/storage.rst +++ b/source/adminguide/storage.rst @@ -966,12 +966,12 @@ Check and repair Volume ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When there are any leaks or any inconsistencies in the volume, then the checkVolume API can be used to -check any such errors in the volume and helps in repairing. This feature is currently available only +check for any such errors in the volume and helps in repairing them. This feature is currently available only for KVM and volumes with QCOW2 format. This API uses "qemu-img check" command on the KVM host. -Also a global or storage pool level setting "volume.check.and.repair.leaks.before.use" is available which allows -to do a check and repair leaks operation for the volume during instance start and volume attach operations. -This will help in repairing any leaks for the volume before using it. This is a blocking operations, meaning +Also, a global or storage pool level setting "volume.check.and.repair.leaks.before.use" is available which allows +to check and repair any leaks of the volume during instance start and volume attach operations. +This will help in repairing any leaks of the volume before using it. This is a blocking operation, meaning instance start or volume attach will be performed only after the check and repair operation is completed. The setting helps in defining whether to allow this operation or not.