A storage pool of type dir
is a directory path. The only meaningful value is the directory path itself so all other parameters are ignored. In your example, /var/lib/libvirt/rhpol_virsh
is a location in your filesystem that will be mapped to the storage pool rhpol_virsh
.
Another way of viewing this command, which I prefer, is by named parameter rather than positional parameter. This also defines your pool as rhpol_virsh
as being part of your filesystem starting at /var/lib/libvirt/rhpol_virsh
:
virsh pool-define-as rhpol_virsh --type dir --target /var/lib/libvirt/rhpol_virsh
At the risk of over complicating matters, but trying to answer your comment questions, the man page defines positional parameters as follows:
pool-define-as name --print-xml type [source-host] [source-path] [source-dev] [source-name] [<target>] [--source-format format]
Since the pool definition doesn't need anything except target
we need -
placeholders to get to the target
. Thus pool-define-as rhpol_virsh - - - - /var/lib/libvirt/rhpol_virsh
.
Once you have defined the storage pool you need to start it:
virsh pool-autostart rhpol_virsh # Start on boot
virsh pool-start rhpol_virsh # Start now
You can see which storage pools are defined, and their status, with virsh pool-list
. If you add something to a storage pool you may need to tell the libvirt
suite that the pool contents need refreshing:
virsh pool-list | awk '/active/{print$1}' | xargs -n1 virsh pool-refresh