In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to understand KVM storage virtualization, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can gain something through the detailed introduction of this article.
Storage virtualization for KVM is managed through storage pools (Storage Pool) and volumes (Volume).
Storage Pool is a piece of storage space that can be seen on the host, which can be of many types, which will be discussed in more detail later. Volume is a piece of space divided in Storage Pool, and the host allocates Volume to the virtual machine, and what Volume sees in the virtual machine is a hard disk.
Let's learn about different types of Storage Pool.
Storage Pool of directory type
The file directory is the most commonly used Storage Pool type.
KVM uses the host directory / var/lib/libvirt/images/ as the default Storage Pool.
So what is Volume?
The answer is the file under this directory, and a file is a Volume.
Do you remember that when we created the first virtual machine kvm1, we put the image file cirros-0.3.3-x86_64-disk.img in this directory. The file cirros-0.3.3-x86_64-disk.img, or Volume, is the boot disk for kvm1.
So how did KVM know to use the / var/lib/libvirt/images directory as the default Storage Pool?
In fact, all available Storage Pool of KVM are defined in the / etc/libvirt/storage directory of the host. Each Pool has a xml file. By default, there is a default.xml, which contains the following contents:
Note: the type of Storage Pool is "dir" and the path to the directory is / var/lib/libvirt/images
Let's add a new disk to the virtual machine kvm1 and see what happens.
Open the configuration page of kvm1 in virt-manager and right-click to add new hardware
Create an 8G volume in the default Pool.
Click "Finish" to see the information about the new disk.
An 8G file kvm1.img has been added under / var/lib/libvirt/images/
Root@ubuntu:~# ls-l / var/lib/libvirt/images/ total 14044-rw-r-r- 1 root root 14417920 Sep 4 11:24 cirros-0.3.3-x86_64-disk.img-rw--- 1 root root 8589934592 Sep 4 21:39 kvm1.img
Using files to do Volume has many advantages: convenient storage, good portability, replicability and remote access.
The first few advantages are easy to understand, and here's a little more explanation of "remotely accessible".
Remote access means that the image files are not necessarily placed in the host local file system, but can also be stored in a remote file system connected through the network, such as NFS, or in a distributed file system, such as GlusterFS.
In this way, the image files can be shared among multiple hosts, and it is convenient for virtual machines to do Live Migration; between different hosts. If it is a distributed file system, the feature of multiple copies can also ensure the high availability of image files.
KVM supports multiple Volume file formats, which can be selected when adding Volume
Raw is the default format, that is, the original disk mirror format, good portability, good performance, but fixed size, can not save disk space.
Qcow2 is the recommended format. Cow stands for copy on write, which can save disk space, support AES encryption, support zlib compression, support multiple snapshots, and have many features.
Vmdk is the virtual disk format of VMWare, which means that VMWare virtual machines can run directly on KVM.
The above is how to understand KVM storage virtualization. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.