IBM Storwize and SVC CLI: Volume and Host Mapping - 夜莺博客

IBM Storwize and SVC CLI: Volume and Host Mapping

IBM Spectrum Virtualize - the software running on Storwize V7000, SVC and FlashSystem - uses a small, consistent set of CLI verbs for provisioning: you create a managed disk, map it to a host, and the host sees a LUN. Almost every provisioning problem comes from one of three places: the host object does not exist or has the wrong WWPN, the volume is in an image mode that does not match how it will be used, or the mapping landed in the wrong I/O group. This guide walks the provisioning sequence and the queries that prove each step worked.

Check the Cluster Before You Provision

Confirm that both nodes are online and that the volume will be created in the correct pool.

lscluster
lssystem
lspool
lsmdiskgrp -delim :
lsnode

If the cluster shows a degraded or one-sided state, fix that first: provisioning into a cluster with a failed node puts new volumes at risk and can leave mappings half-configured.

Create the Volume

Volume creation uses mkvdisk with a size in MB, a grain size, and a provisioning policy - thinly provisioned for general workloads, fully allocated for latency-sensitive databases.

mkvdisk -mdiskgrp Pool0 -iogrp 0 -size 100 -unit gb -vtype striped   -rsize 2% -autoexpand -grainsize 256 -warning 80 -name app01_data

lsvdisk app01_data
lsvdisk -delim : app01_data | grep -E "id|mdisk_grp_name|capacity|status"

-rsize 2% is the thin-provisioned space reservation, and it is the value that protects you when the pool runs short. A fully allocated volume uses -rsize 100%. Pick one and stay consistent; mixing both in the same pool makes capacity reporting hard to interpret.

Define the Host

Hosts are identified by iSCSI IQN or Fibre Channel WWPN. One host object can own several WWPNs, which is typical for a dual-fabric, dual-HBA server.

mkhost -name esxi01 -hbawwpn 21000024FF5A1234 -force
addhostport -hbawwpn 21000024FF5A5678 esxi01
lshost esxi01
lshost -delim : | grep -i esxi01

Configure the host type correctly - -type should match the operating system so that quirks such as LUN reporting and ALUA behaviour line up. A host typed as "generic" can still work but loses the vendor-specific handling.

Map the Volume to the Host

Mapping creates the LUN presentation to both nodes of the I/O group so either node can serve the I/O.

mkvdiskhostmap -host esxi01 app01_data
lsvdiskhostmap -host esxi01
lsvdisk app01_data | grep -i mapping
lshostvdiskmap esxi01

To present a specific LUN ID (useful when a host expects fixed numbering), pass it explicitly with -scsi:

mkvdiskhostmap -host esxi01 -scsi 5 app01_data

After the mapping, the host must rescan its HBA or iSCSI session. On ESXi that is a rescan of the storage adapter; on Linux it is rescan-scsi-bus.sh or a write to the host scan path.

FlashCopy and Consistency Groups

For snapshot workflows, FlashCopy maps a source volume to a target. Watch the copy rate on production volumes - a full-rate FlashCopy on a busy source can starve real I/O.

mkvdisk -mdiskgrp Pool0 -size 100 -unit gb -name app01_snap -vtype striped
mkflash -copyrate 50 app01_data app01_snap
lsfcmap
lsfcmap -delim : | grep app01

Capacity and Health Queries Worth Memorising

lsvdisk -bytes
lsmdiskgrp -bytes
lsvdisk -filtervalue status=degraded
lsdependentmdisks
lseventlog -message yes -last 50

Thin-provisioned environments drift toward a full pool quietly. Set the volume warning threshold, monitor lsmdiskgrp -bytes per pool, and alert well before the reserve space is consumed - once real capacity is exhausted, writes to thin volumes fail regardless of the host's own free space. For a different array family, HPE 3PAR createvv, createhost and presentvlun covers the equivalent workflow, and Storwize V3700 cluster error troubleshooting handles the failure case.

原文链接:https://www.ibm.com/docs/en/flashsystem-7x00/9.1.2?topic=reference-volume-commands