RHEVM: Add NFS Storage

  1. Start NFS and figure out the required nfs path.
  2. Name should end with /images or /ISO ..etc
  3. change permissionschown -R 36:36 /images
  4. Add “New domain” on rhevm storage tab and provide export path and select Datacenter/cluster
  5. Go to Datacenter and activate the respective domain.

Access RHEVM with CLI

Connect to rhevm cli:

[RHEVM shell (connected)]#  connect –url “https://” –user “@internal” –password “” –insecure

Deploy VM:

[RHEVM shell (connected)]#  add vm –name –cluster-name –template-name   –placement_policy-host-name

start vm:

[RHEVM shell (connected)]#  action vm start

[RHEVM shell (connected)]#  action vm stop

RUn script:

Include all rhev commands in file and run from rhevm shell:

Ex: If you would like to start 100 VM’s:

[RHEVM shell (connected)]#  file rhev_cmd.sh


Trace System calls using perf

This example shows how to trace sys_enter_io_submit, sys_exit_io_submit using perf.

1)Record while workload is running. ( My example runs IO on KVM VM)

perf record -ag -e syscalls:sys_enter_io_submit -e syscalls:sys_exit_io_submit

2) perf script

qemu-kvm 22423 [000] 35377.973736: syscalls:sys_enter_io_submit: ctx_id:  0x7fb1ee52c000, nr: 0x000000d1, iocbpp: 0x7fb1f7513110

7fb1ec79c697 io_submit (/usr/lib64/libaio.so.1.0.1)

2300000023 [unknown] ([unknown])

4e0000004e [unknown] ([unknown])

qemu-kvm 22423 [000] 35377.973751: syscalls:sys_exit_io_submit: 0x1

7fb1ec79c697 io_submit (/usr/lib64/libaio.so.1.0.1)

2300000023 [unknown] ([unknown])

4f0000004e [unknown] ([unknown])

subtract the exit – enter timestamps to find the duration

35377.973751 – 35377.973736 = 0.000015

Thanks to Stefanha Hajnoczi for help.

Qemu-kvm debug using gdb and put breakpoints on required systemcalls

Attach gdb to the qemu-kvm process. Start benchmark on VM and put a breakpoint on required systemcalls.  In this example, i am tracing  io_submit

1) Edit XML file

Change this

<domain type=’kvm’>


<domain type=’kvm’ xmlns:qemu=’http://libvirt.org/schemas/domain/qemu/1.0′&gt;

<qemu:arg value=’-s’/>

and restart VM

2) root@kvm-1 ~]# gdb /usr/lib/debug/lib/modules/3.10.0-229.4.2.el7.x86_64/vmlinux
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-64.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “x86_64-redhat-linux-gnu”.
For bug reporting instructions, please see:
Reading symbols from /usr/lib/debug/lib/modules/3.10.0-229.4.2.el7.x86_64/vmlinux…done.

3) attach qemu-kvm pid which needs to be traced

(gdb) attach <qemu-kvm pid>


(gdb) b io_submit
Breakpoint 1 at 0x7ff9fd094690: file io_submit.c, line 23.
(gdb) c

Breakpoint 1, io_submit (ctx=0x7ff9fee24000, nr=1, iocbs=0x7ffa045f2660) at io_submit.c:23
23    io_syscall3(int, io_submit, io_submit, io_context_t, ctx, long, nr, struct iocb **, iocbs)

Happy qemu Debugging

Thanks to Fam Zheng for help

virt-install with console

qemu-img create -f qcow2 /var/lib/libvirt/images/fed22.qcow2 10G

virt-install –name=fed22-qcow2 –vcpus=12 –ram=16000  –location=/home/psuriset/Fedoa-22-Server-x86_64.iso –disk path=/var/lib/libvirt/images/fed22.qcow2,bus=virtio,cache=none –network network=default,model=virtio  –os-type=linux –virt-type kvm –graphics none   -x “console=tty0 console=ttyS0,115200n8