第 13 章 Managing storage for virtual machines
A virtual machine (VM), just like a physical machine, requires storage for data, program, and system files. As a VM administrator, you can assign physical or network-based storage to your VMs as virtual storage. You can also modify how the storage is presented to a VM regardless of the underlying hardware.
To provide storage for your virtual machines (VMs) running on a RHEL 10 host, you can use multiple types of storage hardware and services. Each of these types has different requirements, benefits, and use cases.
- File-based storage
File-based virtual disks are disk image files on your host file system, which are stored in a directory-based
libvirtstorage pool.File-based disks are quick to set up and easy to migrate, but create additional overhead for the local file system, which can have negative impact on the performance.
In addition, certain
libvirtfeatures, such as snapshots, require a file-based virtual disk.For instructions on attaching file-based storage to your VMs, see Attaching a file-based virtual disk to your virtual machine by using the command line or Attaching a file-based virtual disk to your virtual machine by using the web console.
- Disk-based storage
VMs can use an entire physical disk or partition instead of virtual disks.
Disk-based storage has the best performance of the available storage types and also provides direct access to host disks. However, you cannot create snapshots for such storage, and it is difficult to migrate.
For instructions on attaching disk-based storage to your VMs, see Attaching disk-based storage to your virtual machine by using the command line or Attaching disk-based storage to your virtual machine by using the web console.
- LVM-based storage
VMs can use the Logical Volume Manager (LVM) to allocate storage directly from a volume group (VG).
LVM storage has better performance than file-based disks and is easy to resize, but can be more difficult to migrate.
For instructions on attaching LVM-based storage to your VMs, see Attaching LVM-based storage to your virtual machine by using the command line or Attaching LVM-based storage to your virtual machine by using the web console.
- Network-based storage
Instead of local hardware, you can use remote storage, such as the Network File System (NFS).
This is useful for shared storage in clusters or high-availability environments. However, network-based storage is generally slower than local storage, and your network bandwidth can further limit the performance.
For instructions on attaching NFS-based storage to your VMs, see Attaching NFS-based storage to your virtual machine by using the command line or Attaching NFS-based storage to your virtual machine by using the web console.