How to Identify the LUN ID Associated with an Instance Volume
Problem
To identify the LUN ID on the backend storage that corresponds to a particular instance (VM) volume. This is useful for troubleshooting, storage mapping, and validating multipath connectivity.
Environment
- Private Cloud Director Virtualization - v2025.4 and Higher
- Private Cloud Director Kubernetes – v2025.4 and Higher
- Self-Hosted Private Cloud Director Virtualization - v2025.4 and Higher
- Component - Storage / Block Storage (Cinder, Multipath, LUN Mapping)
Procedure
- List the VM’s attached volumes
Run the following command on the compute node hosting the VM:
$ virsh domblklist <DOMAIN_ID>Example output: $ virsh domblklist vm-101Target Source------------------------------------------------vda /var/lib/libvirt/images/vm1.qcow2vdb /dev/disk/by-id/dm-name-mpathcqThe above command lists all block devices (disks) attached to the specified VM and shows their mapping to host devices.
In the above example output, we can see vdb is a block device mapped via multipath.
- Obtain the WWID of the multipath device
Identify the multipath name from Step 1 (mpathcq) and run:
$ multipath -ll | grep -A5 <DM-NAME>Example output:$ multipath -ll | grep -A5 mpathcqmpathcq (123123123123123abc25abc) dm-9 3PARdata,VVsize=50G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw`-+- policy='round-robin 0' prio=50 status=active |- 0:0:1:2 sdv 65:80 active ready running |- 2:0:3:2 sdab 65:176 active ready running |- 0:0:0:2 sdz 65:144 active ready running- The WWID is
123123123123123abc25abc(this uniquely identifies the volume). - The devices (sdv, sdab, sdz) show their
Host:Channel:Target:LUN (H:C:T:L)tuples.
- Identifying the LUN ID from above output
- In the tuples 0:0:1:2 , 2:0:3:2 , 0:0:0:2 → the last number = LUN ID.
- So, this volume maps to LUN ID 2 on the storage backend.
- We can also cross check using by-path
$ ls -l /dev/disk/by-path/ | grep <DEVICE-NAME>Example output: $ ls -l /dev/disk/by-path/ | grep sdvlrwxrwxrwx 1 root root 9 Aug 20 10:15 pci-0000:3b:00.0-fc-0x1235000abc-lun-2 -> ../../sdvOutput will show a symlink including lun-2, confirming the backend LUN mapping.
Additional Information
- In the SCSI address format
Host:Channel:Target:LUN (H:C:T:L), the last digit (L) represents the LUN ID. virsh domblklisthelps you trace which device (e.g., /dev/dm-*) is attached to a VM.multipath -llmaps that device to its WWID and shows the backend paths, where you can identify the LUN ID./dev/disk/by-path/provides human-readable symlinks, including names like lun-<N>, making it easier to confirm the LUN number.