If a Volume is cloned from another volume, the bricks of cloned volume
will also belong to same LV thinpool as the original Volume. So before
removing the thinpool a check was made to confirm if number of Lvs in
that thinpool is zero. This check was causing hang when parallel
Volume delete commands were issued.
With this PR, number of Lvs check is removed, instead of that captured
the failure of thinpool delete and handled it gracefully.
This PR also adds support for gracefully delete the volume if lv or
thinpool already deleted by previous failed transaction or manual delete.
Signed-off-by: Aravinda VK <avishwan@redhat.com>
it will be user friendly if we have total,
free,used field in device response.
total size= total size of device.
free size= available size of device for
volume creation.
used size= space used for volume creation.
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
If a device exists with same name in different Peer, it is possible to
get the available size information of the device from different
Peer than getting information locally.
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Moved lvm related functions from `$SRC/glusterd2/snapshot/lvm`
and `$SRC/plugins/device/deviceutils/` to `$SRC/pkg/lvmutils`
Also moved fs related functions from `plugins/deviceutils` to
`$SRC/pkg/fsutils`.
Fixes: #1187
Signed-off-by: Aravinda VK <avishwan@redhat.com>
This patch creates the arbiter brick for the smart volume as per the
calculation:
brick size = 4 KB * ( size in KB of largest data brick in volume or
replica set / average file size in KB)
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
During a snapshot restore, we need to delete the parent
lv's if it is auto provisioned or snapshot provisioned
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
On Volume delete,
- Unmount the Brick if mounted
- Remove LV
- Remove Thinpool if number of Lvs in the thinpool is zero
Fixes: #938
Signed-off-by: Aravinda VK <avishwan@redhat.com>
The err string returned by `exec.Command.{Run,Output}` will
not contains `stderr`, Output in log/CLI will just display `exited with
status 1`. This patch adds the content of `stderr` along with the error
message.
Signed-off-by: Aravinda VK <avishwan@redhat.com>