Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the available storage types for kvm

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What this article shares with you is about the available storage types of kvm, which the editor thinks is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Virtual disk file

You can use LVM (Logical Volume Manager) to create storage pools to manage KVM storage, and when creating a KVM virtual machine, virtual disk files are used as back-end storage by default. If you use this type of configuration, what the virtual machine can see is an actual hard disk, but it actually uses a hard disk represented by a virtual disk file. An additional file system layer is included here, and this file system layer also causes the system to slow down.

Of course, virtual disk files also have its benefits, virtual disk files can be easily used by other KVM virtual machines, but if you want to optimize KVM virtualization performance, you still need to consider other KVM storage.

File system-based storage

When deploying KVM hosts, you can select the file system directory (dir) or formatted block devices (fs) as KVM storage. By default, using dir,KVM creates a disk image file in the selected local file system directory.

If you use the fs option, you need to provide the name of the formatted file system where the disk image files are stored. The biggest difference between this option and directory type storage is that the formatted disk image is not mounted under a specified path.

Using any of the above options, you can use a local file system or a physically SAN-based file system. Compared with SAN, local storage copper is not accessed concurrently by multiple hosts at the same time.

Another file-based disk storage method is netfs, which only requires you to provide the name of a network file system, such as a mounted Samba file system. It is convenient to use this method as KVM storage, because it can be easily accessed from another server, and it also allows you to access the same disk file on multiple hosts.

The various types of file system-based KVM storage methods mentioned above all have some disadvantages: file system. Because the operation of the virtual machine of KVM to the hard disk is not written directly to the storage medium of KVM, but the file system on the host host. This means that when accessing the file system, you need to go through an unnecessary intermediate access layer, which usually degrades performance.

So, if you want to pursue the performance of KVM virtualization, device-based storage may be a better choice.

Device-based storage

Another way is to use device-based storage. There are four ways to provide this type of physical storage device access: disk, iSCSI, SCSI, and logical. Disk allows you to read and write to the disk directly. ISCSI and SCSI provide an alternative way to access the disk that is comparable to the original scheme. The advantage of this type of KVM storage is that you can use persistent naming without relying on the order in which the host discovers the device.

These ways of accessing the disk also have disadvantages: inflexible and rigid. If you use this type of storage, there is basically no way to modify the size of the virtual disk or take snapshots for the virtual machine.

LVM (Logical Volume Manager) is the best way to improve flexibility in KVM storage. One benefit is that LVM allows you to use snapshots, and the other is that it can only be used as part of KVM virtualization, otherwise it cannot be used.

LVM allows storage to be placed in a storage volume group, which makes it easy to create a logical volume based on the storage volume group. Volume groups are abstract physical disk devices, so when you run out of available disk space, you can add a new device to the volume group, which actually increases the available direct storage space to the logical volume. The use of LVM makes the allocation of device space more flexible and makes it easier to add and remove storage.

Finally, LVM can work well in stand-alone scenarios and multi-host scenarios. If you need to access multiple hosts at the same time, you only need to create logical volumes based on SAN. If you use LVM clustering, you can easily configure all hosts to access logical volumes at the same time.

Use of KVM storage pool

To facilitate the management of KVM storage, you can create storage pools. Creating a storage pool at the host level makes it easier to access KVM storage devices. Using the KVM storage pool, you can also prepare the implementation of the storage manager for access. This strategy is useful in large environments because the storage administrator is usually not the same person as the virtual machine administrator, so it is a good choice to create a KVM storage pool before creating a virtual machine.

When you go deep into KVM virtualization, configure a KVM storage pool at the host level and provide LVM logical volumes in the pool.

The above are the available storage types of kvm, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report