The block host volume will still exist even when the blocks are all
deleted. Manually deleting block host volume will need another step
of unmounting. With this patch we auto-delete the block host volume
if there are no blocks.
The availablility check of bhv free space is not done within lock, hence
there is a possiblity that the available space has changed by the
time we decide to create the volume. This patch also fixes the race
condition.
Signed-off-by: Poornima G <pgurusid@redhat.com>
Currently, to GET/DELETE any block volume we mount all the block hosting
volumes and readdir all the volumes, and loop through it, to find the
block hosting volume, the block belongs to. This approach is not scalable.
Hence, in the metadata of the block hosting volume, we keep a list of all
the block volumes present in that host volume. This way, GET/DELETE walks
through the volume metadata rather than the readdir.
Signed-off-by: Poornima G <pgurusid@redhat.com>
When the block host cluster options are set to values other
than default, the block volume creation fails on the first
attempt, but succeeds on the subsequent attempts. This is
due to the initialization of block vol create req before
reading the cluster options. In this patch, change the order
of the same to fix the issue.
Signed-off-by: Poornima G <pgurusid@redhat.com>
- moved hosts parameter from mandatory to optional field in CreateBlockVolume
method of BlockProvider interface,since hosts field may not required for
other block providers like loopback.
- a common function for updating available hosting volume size will prevent
from duplicate code
Signed-off-by: Oshank Kumar <okumar@redhat.com>
- added block volume provider name in path parameter of url
- block provider will not be responsible for managing host volumes.
Signed-off-by: Oshank Kumar <okumar@redhat.com>