diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 0cd9dcc0b..7d576cf22 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -136,6 +136,8 @@ func (cs *ControllerServer) parseVolCreateRequest( // always round up the request size in bytes to the nearest MiB/GiB rbdVol.VolSize = util.RoundOffBytes(volSizeBytes) + // RequestedVolSize has the size of the volume requested by the user. + rbdVol.RequestedVolSize = rbdVol.VolSize // start with pool the same as journal pool, in case there is a topology // based split, pool for the image will be updated subsequently diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index 9fc149d14..ed758d8c7 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -164,7 +164,10 @@ type rbdVolume struct { VolName string `json:"volName"` MonValueFromSecret string `json:"monValueFromSecret"` VolSize int64 `json:"volSize"` - DisableInUseChecks bool `json:"disableInUseChecks"` + // RequestedVolSize has the size of the volume requested by the user and + // this value will not be updated when doing getImageInfo() on rbdVolume. + RequestedVolSize int64 + DisableInUseChecks bool `json:"disableInUseChecks"` readOnly bool Primary bool ThickProvision bool