virsh io_cache_mode 虚拟机io种类

简介: virsh io_cache_mode 虚拟机io种类

doc

https://documentation.suse.com/sles/11-SP4/html/SLES-kvm4zseries/cha-qemu-cachemodes.html

cache mode


15.2 Description of Cache Modes

cache mode unspecified


In qemu-kvm versions older than v1.2 (eg SLES11 SP2), not specifying a cache mode meant that writethrough would be used as the default. Since that version, the various qemu-kvm guest storage interfaces have been fixed to handle writeback or writethrough semantics more correctly, allowing for the default caching mode to be switched to writeback. The guest driver for each of ide, scsi, and virtio have within their power to disable the write back cache, causing the caching mode used to revert to writethrough. The typical guest’s storage drivers will maintain the default caching mode as writeback, however.

cache = writethrough


This mode causes qemu-kvm to interact with the disk image file or block device with O_DSYNC semantics, where writes are reported as completed only when the data has been committed to the storage device. The host page cache is used in what can be termed a writethrough caching mode. The guest’s virtual storage adapter is informed that there is no writeback cache, so the guest would not need to send down flush commands to manage data integrity. The storage behaves as if there is a writethrough cache.

cache = writeback

This mode causes qemu-kvm to interact with the disk image file or block device with neither O_DSYNC nor O_DIRECT semantics, so the host page cache is used and writes are reported to the guest as completed when placed in the host page cache, and the normal page cache management will handle commitment to the storage device. Additionally, the guest’s virtual storage adapter is informed of the writeback cache, so the guest would be expected to send down flush commands as needed to manage data integrity. Analogous to a raid controller with RAM cache.

cache = none


This mode causes qemu-kvm to interact with the disk image file or block device with O_DIRECT semantics, so the host page cache is bypassed and I/O happens directly between the qemu-kvm userspace buffers and the storage device. Because the actual storage device may report a write as completed when placed in its write queue only, the guest’s virtual storage adapter is informed that there is a writeback cache, so the guest would be expected to send down flush commands as needed to manage data integrity. Equivalent to direct access to your hosts’ disk, performance wise.

cache = unsafe

This mode is similar to the cache=writeback mode discussed above. The key aspect of this “unsafe” mode, is that all flush commands from the guests are ignored. Using this mode implies that the user has accepted the trade-off of performance over risk of data loss in the event of a host failure. Useful, for example, during guest install, but not for production workloads.

cache=directsync


This mode causes qemu-kvm to interact with the disk image file or block device with both O_DSYNC and O_DIRECT semantics, where writes are reported as completed only when the data has been committed to the storage device, and when it is also desirable to bypass the host page cache. Like cache=writethrough, it is helpful to guests that do not send flushes when needed. It was the last cache mode added, completing the possible combinations of caching and direct access semantics.

15.3 Data Integrity Implications of Cache Modes

cache = writethrough, cache = none, cache=directsync

These are the safest modes, and considered equally safe, given that the guest operating system is “modern and well behaved”, which means that it uses flushes as needed. If you have a suspect guest, use writethough, or directsync. Note that some file systems are not compatible with cache=none or cache=directsync, as they do not support O_DIRECT, which these cache modes relies on.

cache = writeback


This mode informs the guest of the presence of a write cache, and relies on the guest to send flush commands as needed to maintain data integrity within its disk image. This is a common storage design which is completely accounted for within modern filesystems. But it should be noted that because there is a window of time between the time a write is reported as completed, and that write being committed to the storage device, this mode exposes the guest to data loss in the unlikely event of a host failure.

cache = unsafe


This mode is similar to writeback caching except the guest flush commands are ignored, nullifying the data integrity control of these flush commands, and resulting in a higher risk of data loss due to host failure. The name “unsafe” should serve as a warning that there is a much higher potential for data loss due to a host failure than with the other modes. Note that as the guest terminates, the cached data is flushed at that time.

15.4 Performance Implications of Cache Modes


The choice to make full use of the page cache, or to write through it, or to bypass it altogether can have dramatic performance implications. Other factors which influence disk performance include the capabilities of the actual storage system, what disk image format is used, the potential size of the page cache and the IO scheduler used. Additionally, not flushing the write cache increases performance, but with risk, as noted above. As a general rule, high end systems typically perform best with cache = none, because of the reduced data copying that occurs. The potential benefit of having multiple guests share the common host page cache, the ratio of reads to writes, and the use of aio = native (see below) should also be considered.

相关文章
|
29天前
|
XML 存储 数据安全/隐私保护
使用virsh migrate进行虚拟机迁移
使用virsh migrate进行虚拟机迁移
48 0
|
9月前
|
安全 虚拟化
VMWare 虚拟机 CPU 设置里针对 CPU 的虚拟化 IOMMU(IO 内存管理单元) 选项功能介绍
VMWare 虚拟机 CPU 设置里针对 CPU 的虚拟化 IOMMU(IO 内存管理单元) 选项功能介绍
|
2月前
|
XML 数据格式
virsh一个管理虚拟机的命令行工具
virsh是一个管理虚拟机的命令行工具,提供了丰富的命令来查看、创建、管理虚拟机。以下是一些常用的virsh命令: 1. **查看帮助和版本**: - `virsh --help`:查看virsh命令的帮助信息。 - `virsh -version`:查看virsh的版本信息。 2. **查看虚拟机**: - `virsh list`:显示当前正在运行的虚拟机。 - `virsh list --all`:显示主机下的所有虚拟机,包括未运行的。 3. **创建和管理虚拟机**: - `virsh define xml`:使用XML文件定义(创建)虚拟机。
157 0
|
Linux KVM 虚拟化
【CentOS】配置kvm虚拟机virsh Console连接
配置KVM虚拟化中,虚拟机的console串口连接终端
751 0
【CentOS】配置kvm虚拟机virsh Console连接
|
29天前
|
Unix Linux 虚拟化
虚拟机VMware知识积累
虚拟机VMware知识积累
|
4天前
|
存储 SQL 运维
服务器数据恢复—Isilon存储误删除vmware虚拟机的数据恢复案例
Isilon存储使用的是分布式文件系统OneFS。在Isilon存储集群里面每个节点均为单一的OneFS文件系统,所以Isilon存储在进行横向扩展的同时不会影响数据的正常使用。Isilon存储集群所有节点提供相同的功能,节点与节点之间没有主备之分。当用户向Isilon存储集群中存储文件时,OneFS文件系统层面将文件划分为128K的片段分别存放到不同的节点中,而节点层面将128K的片段分成8K的小片段分别存放到节点的不同硬盘中。用户文件的Indoe信息、目录项及数据MAP则会分别存储在所有节点中,这样可以确保用户不管从哪个节点都可以访问到所有数据。Isilon存储在初始化时会让用户选择相应的
35 12
|
2天前
|
存储 Linux 虚拟化
入职必会-开发环境搭建32-VMware虚拟机下载和安装
VMware虚拟机是一种基于VMware虚拟化技术的软件解决方案,它可以在一台物理计算机上创建多个独立的虚拟计算机环境。这些虚拟机可以运行不同的操作系统,如Windows、Linux等,使用户能够在单台计算机上同时运行多个操作系统。
入职必会-开发环境搭建32-VMware虚拟机下载和安装