opencomputeproject/ocp-diag-autoval-ssd

ns resize calc nsze/ncap need check Namespace Size/Capacity Granularity first

kwzhu123 opened this issue · 0 comments

1
/src/autoval_ssd/lib/utils/storage/nvme/nvme_resize_utils.py
def ns_resize(
host: Host,
nvme_id_ctrls: Dict[str, Any],
sweep_param_unit: SweepParamUnitEnum,
sweep_param_key: SweepParamKeyEnum,
device: str,
sweep_param_value: Union[int, float],
**kwargs: Dict[Any, Any],
) -> None:
...
nsze = NvmeResizeUtil.get_idema_lba_counts(num_bytes, block_size)
ncap = nsze

2
need check ns Granularity first, some vendor's drive have LBA count alignt limit
sudo nvme id-ns-granularity /dev/nvme0
NSG : Namespace Size Granularity : 0x1000
NCG : Namespace Capacity Granularity : 0x1000 #need 4k alignt

3
NVMe Specification
image