KVM learning (seven) storage pool

Storage pool to multiple disks resource pooling using, Libvirt, storage can be managed in a unified storage pool, to simplify the operation.
Virtual machine operations, storage pools and volumes is not required, administrators ensure proper configuration and connection.
Currently I have three storage pools circumstances
Here Insert Picture Description
find their configuration file
Here Insert Picture Description
there are some parameters, but does not recommend changes to direct XML, by virsh pool-edit iso changes will not abnormal.
Here Insert Picture Description

virsh pool-edit iso

Found is to open a vi
Here Insert Picture Description
Had about the operation of the storage pool

pool-list

Here Insert Picture Description

poolL-info

Here Insert Picture Description

Catalog-based storage pool

Prepare a directory, set the directory permissions, SELinux configuration directory context, operating isolate virtual machine and a virtual machine.
Here Insert Picture Description

semanage fcontext -a -t virt_image_t '/guest_images(/.*)?'

Because / guest_images this directory is created by hand, not the default directory, and there is no default security context, we need to be manually set.
This command will give / guest_images directory and all contents of the directory to set the default security context type is virt_image_t
Create a storage pool, there are two methods:

通过virt-manager创建存储池

Here Insert Picture Description
Just select the target path / guest_images
Here Insert Picture Description
delete the pool when the pool must be stopped, there is a plus sign to the right of the dot stops, then the rightmost delete, delete the pool.

通过virsh创建存储池
virsh pool-define as guest_images dir --target "/guest_images"

Here Insert Picture Description
Start up
Here Insert Picture Description
settings automatically enabled

virsh pool-autostart guest_images

Here Insert Picture Description
Here Insert Picture Description
This is to create a storage pool through virsh
Also, we need to stop removing the pool pool

virsh pool-destroy guest_images
virsh pool-delete guest_images

Here Insert Picture Description

But the profile still further, to clear all use undefine

virsh pool-undefine guest_images

Here Insert Picture Description

Partition based storage pool

libvirtd will automatically mount the partition

Released seven original articles · won praise 0 · Views 143

Guess you like

Origin blog.csdn.net/qq_40908430/article/details/104211845