virsh-domblklist
List block devices attached to a domain
TLDR
List the target name and source path of the block devices
List the disk type and device value as well as the target name and source path
SYNOPSIS
virsh domblklist domain [--inactive] [--details] [--fields
PARAMETERS
domain
The name, ID, or UUID of the domain to list block devices for.
--inactive
List block devices for an inactive (shut down) domain.
--details
Show detailed information for each block device, including target, type, and source.
--fields
Comma-separated list of fields to display. Use --details for available fields.
--separator
Separator to use between fields when using --fields option.
--all
List all domains block devices.
--transient
List devices only from transient (runtime) domain config.
DESCRIPTION
The virsh domblklist command is used to list all the block devices (hard drives, CD-ROM drives, etc.) attached to a specified virtual machine domain. It provides a way to inspect the virtual disks a domain is utilizing without needing to access the domain's configuration file directly. The command retrieves a list of block device paths within the domain's virtual environment. The paths generally represent the filenames or device nodes associated with the virtual disks. Using this information, administrators can verify disk assignments, troubleshoot storage-related issues, and manage virtual disk configurations.
The command output shows the target device names configured for the guest, not necessarily the host devices. This differs from `virsh domblkinfo`, which provides detailed information about a specific block device.
CAVEATS
The paths reported by virsh domblklist are relative to the guest. They may not directly correspond to files on the host system. The '--inactive' flag will only work if the domain's XML configuration is available. If the domain configuration has been removed (e.g., using 'undefine'), it will not be possible to list block devices using '--inactive'.
EXAMPLES
List block devices for a domain named 'myguest':virsh domblklist myguest
List block devices with details for an inactive domain named 'myguest':virsh domblklist myguest --inactive --details