diff --git a/redhat/notes/2024/2024.12.disk.vs.volume.md b/redhat/notes/2024/2024.12.disk.vs.volume.md index 9fd0b3c7..c4589429 100644 --- a/redhat/notes/2024/2024.12.disk.vs.volume.md +++ b/redhat/notes/2024/2024.12.disk.vs.volume.md @@ -1,5 +1,13 @@ # kvm compare disk and volume +There is performance difference for kvm's disk which is based on type block vs type file. And type block outperforms type file for x2 at least. + +Now we try it out. We will create a vm, with 3 disks +1. 50GB, lv, for rhel os +2. 40GB, lv, which will mount as block disk, raw. +3. 30GB, lv, which will create xfs on it, and create a qcow2 file, and mount the file as file disk. + +# deploy the base env ```bash @@ -67,7 +75,6 @@ mkdir -p /data/lv mount /dev/vgdata/lv03 /data/lv - cd /data/kvm wget https://mirror.web-ster.com/rocky/9/isos/x86_64/Rocky-x86_64-minimal.iso @@ -91,7 +98,30 @@ virt-install --name=demo-01 \ --cdrom /data/kvm/Rocky-x86_64-minimal.iso +``` +dump the vm config +```bash +virsh dumpxml demo-01 +``` +the config related with disk are. +```xml + + + + + + +
+ + + + + + + +
+ ``` go into the vm @@ -221,6 +251,366 @@ lsblk # sdb 8:16 0 447.1G 0 disk # ├─sdb1 8:17 0 46.6G 0 part # └─sdb2 8:18 0 46.6G 0 part + + +virsh dumpxml demo-01 + + demo-01 + d17ed943-e8b4-450f-8f03-5827b37e8a14 + + + + + + 16777216 + 16777216 + 8 + + /machine + + + hvm + + + + + + + + + + Cooperlake + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + destroy + + + + + + /usr/libexec/qemu-kvm + + + + + + +
+ + + + + + + +
+ + + + + + + +
+ + + + + + +
+ + + +
+ + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + +