Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let lvm create metadata volume automatically
Right now we create lvm metadata volume first and then data volume and then pass it to lvm to convert it into a thin pool (lvconvert). This means lvm internally creates an spare logical volume (used during repair) and needs free space in volume group for that spare volume. But lvm does not tell how big an spare volume will be so caller does not know how much free space to leave in volume group. And that means if user passes in DATA_SIZE=100%FREE by the time we call lvconvert, there is no free space left and lvconvert fails. And we leave the system in uncleaned state (metadata and data volumes behind). Dusty came up with idea that why not let lvm create metadata, data and spare volume. That way docker-storage-setup does not have to deal with how much free space to leave. Also use option --poolmetadatasize option to specify size of metadata, so that we retain control on how big metadata volume should be. This should allow users to pass in DATA_SIZE as 100%FREE. Though lvm developers say it is not a good idea to fill up volume group completely and leave some space free so that later either metadata, data or spare volume can grow as need be. This patch changes behavior of MIN_DATA_SIZE. Previously we will make sure free space in VG is more than MIN_DATA_SIZE before creating data volume (and after crating metadata volume). Now we do the same check before creating metadata volume. Given metadata volume is very small (.1% of data size). This can be considered sort of round off error and should not be a real problem. Reported-by: Dusty Mabe <[email protected]> Signed-off-by: Vivek Goyal <[email protected]>
- Loading branch information