Skip to content

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

@kwzhu123

Description

@kwzhu123

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions