How to use the command 'virsh pool-info' (with examples)
The virsh pool-info
command is used to list information about a virtual machine storage pool. It provides details such as the name, UUID, state, persistence type, autostart status, capacity, space allocated, and space available for the specified storage pool.
Use case 1: List information about a storage pool by name
Code:
virsh pool-info --pool name
Motivation: If you want to gather information about a specific storage pool by its name, you can use this command. It allows you to retrieve details such as the storage pool’s state, capacity, and space availability.
Explanation:
virsh pool-info
: The command used to retrieve information about a virtual machine storage pool.--pool name
: The--pool
flag followed by the name of the storage pool you want to retrieve information for.
Example output:
Name: mypool
UUID: 489nefs7-38ef-4a47-a263-23b44cfd742e
State: running
Persistence: yes
Autostart: disable
Capacity: 100 GiB
Allocation: 50 GiB
Available: 50 GiB
Use case 2: List information about a storage pool by UUID
Code:
virsh pool-info --pool uuid
Motivation: If you are aware of the UUID of a storage pool but not its name, you can use this command to retrieve information about it. This is useful when you want to reference a specific storage pool by its UUID during virtual machine management tasks.
Explanation:
virsh pool-info
: The command used to retrieve information about a virtual machine storage pool.--pool uuid
: The--pool
flag followed by the UUID of the storage pool you want to retrieve information for.
Example output:
Name: mypool
UUID: 489nefs7-38ef-4a47-a263-23b44cfd742e
State: running
Persistence: yes
Autostart: disable
Capacity: 100 GiB
Allocation: 50 GiB
Available: 50 GiB
Conclusion:
The virsh pool-info
command is a useful tool for obtaining detailed information about virtual machine storage pools. By specifying either the name or UUID of a storage pool, you can gather essential details such as its state, capacity, and space availability.