Storage Pool of LVM type-playing with OpenStack (8) every 5 minutes)
LVM Storage Pool
Not only can a file be allocated to the client as a virtual disk, but also the LV In the VG on the host can be allocated to the virtual machine as a virtual disk.
However, because LV does not have an MBR Boot Record for the disk, it cannot be used as the boot disk of the Virtual Machine and can only be used as the data disk.
In this configuration, the VG on the host is a Storage Pool, and the LV In the VG is Volume.
The advantage of LV is that it has good performance. The disadvantage is that it is inferior to image files in terms of management and mobility, and it cannot be remotely used through the network.
The following is an example.
First, create a 10 Gb VG on the host machine and name it HostVG.
Then a Storage Pool definition file/etc/libvirt/storage/HostVG. xml is created. The content is
Run the virsh command to create a new Storage Pool "HostVG"
And enable this HostVG
Now we can add the LV Virtual Disk for the Virtual Machine kvm1 in virt-manager.
Click Browse
You can see that HostVG is already in the Stroage Pool list. Select HostVG
Name volume newlv and set the size to 100 MB.
Click Finish. newlv is created successfully.
Click Choose Volume
Click Finish to add newlv as volume to kvm1.
The new volume is successfully added.
On the host machine, an LV named newlv is added.
Other Storage pools
KVM also supports iSCSI, Ceph and other types of Storage Pool, here is not a one-to-one introduction, the most commonly used is the directory type, other types can refer to the document http://libvirt.org/storage.html
In the next section, we will discuss the principles of KVM network virtualization.