Libvirt
by Gk Gk
Hi All,
I am trying to collect memory, disk and network stats for a VM on kvm host.
It seems that the statistics are not matching what the OS inside the VM is
reporting. Why is this discrepancy ?
Is this a known bug of libvirt ? Also I heard that libvirt shows cumulative
figures for these measures ever since the VM was created. Also I tested by
creating a new vm and comparing the stats without a reboot . Even in this
case, the stats dont agree. Can someone help me here please ?
Thanks
Kumar
10 months, 2 weeks
WinServer2016 guest no mouse in VirtManager
by John McInnes
Hi! I recently converted several Windows Server VMs from HyperV to libvirt/KVM. The host is running openSUSE Leap 15.3. I used virt-v2v and I installed virtio drivers on all of them and it all went well - except for one VM. The mouse does not work for this VM in VirtualMachineManager. There is no cursor and no response. There are no issues showing in Windows Device Manager. The mouse shows up as a PS/2 mouse. Interestingly if I RDP into this VM using Microsoft Remote Desktop the mouse works fine. Any ideas?
----
John McInnes
jmcinnes /\T svt.org
1 year, 7 months
libvirt_connect_get_nic_models
by Simon Fairweather
Hi
Can you confirm that I source get an array of these when running this api
call, currently I just get a return of false
root@computenode:/mnt/testpool# qemu -nic model=help
Supported NIC models:
e1000
e1000-82544gc
e1000-82545em
e1000e
i82550
i82551
i82557a
i82557b
i82557c
i82558a
i82558b
i82559a
i82559b
i82559c
i82559er
i82562
i82801
ne2k_pci
pcnet
rtl8139
tulip
virtio-net-pci
virtio-net-pci-non-transitional
virtio-net-pci-transitional
vmxnet3
function domain_get_nic_models($arch = 'x86_64') {
$tmp = libvirt_connect_get_nic_models($this->conn, $arch) ;
return ($tmp) ? $tmp : $this->_set_last_error();
}
1 year, 8 months
Snapshots of EFI VMs
by Simon Fairweather
Is there a timeline to fully support create/remove and revert for these VMs?
1 year, 8 months
how to add LD_PRELOAD in the xml
by Marc
How should I add LD_PRELOAD to domain xml. I guess within:
<qemu:commandline>
<qemu:arg value='env=LD_PRELOAD=/usr/lib64/libtcmalloc.so'/>
</qemu:commandline>
but this is generating syntax errors.
1 year, 8 months
Fwd: Need help
by Gk Gk
FYI....
---------- Forwarded message ---------
From: Gk Gk <ygk.kmr(a)gmail.com>
Date: Wed, Dec 21, 2022 at 9:46 PM
Subject: Re: Need help
To: Daniel P. Berrangé <berrange(a)redhat.com>
I have just created a new vm and rechecked the disk stats. This time around
too, they seem to be different as shown below:
>From libvirt python library:
---
disk_name=sda
read_req=10501,read_bytes=263819776,write_req=1933,write_bytes=82269184
---
So the write_bytes from above amounted to 78 MB approx.
But from within the vm :
---
root@sample2:~# iostat -p sda -h
Linux 4.15.0-101-generic (sample2) 12/21/2022 _x86_64_ (1 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
1.9% 0.0% 1.3% 0.4% 0.0% 96.4%
Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda
40.45 643.6k 21.2M 217.5M 7.2G
sda1
40.04 637.6k 21.2M 215.5M 7.2G
----
7.2 G is far from 78 MB. Am I doing wrong anywhere ? Btw, I did not
reboot the new vm this time
On Wed, Dec 21, 2022 at 9:30 PM Daniel P. Berrangé <berrange(a)redhat.com>
wrote:
> On Wed, Dec 21, 2022 at 09:26:14PM +0530, Gk Gk wrote:
> > Thanks Daniel for the response.
> >
> > I am wondering what exactly is the difference in the process for a soft
> and
> > hard reboot in the context of a kvm guest ? Can you throw some light here
> > please ?
>
> KVM will always do a soft reboot, where QEMU keeps running.
>
>
> With regards,
> Daniel
> --
> |: https://berrange.com -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o-
> https://www.instagram.com/dberrange :|
>
>
1 year, 8 months
Fwd: Need help
by Gk Gk
For larger reach.......
---------- Forwarded message ---------
From: Gk Gk <ygk.kmr(a)gmail.com>
Date: Thu, Dec 22, 2022 at 8:35 AM
Subject: Re: Need help
To: Daniel P. Berrangé <berrange(a)redhat.com>
Hi Daniel,
Did you get a chance to check this out ? Please let me know....
On Wednesday, December 21, 2022, Gk Gk <ygk.kmr(a)gmail.com> wrote:
> I have just created a new vm and rechecked the disk stats. This time
around too, they seem to be different as shown below:
> From libvirt python library:
> ---
> disk_name=sda
read_req=10501,read_bytes=263819776,write_req=1933,write_bytes=82269184
> ---
>
> So the write_bytes from above amounted to 78 MB approx.
> But from within the vm :
> ---
> root@sample2:~# iostat -p sda -h
> Linux 4.15.0-101-generic (sample2) 12/21/2022 _x86_64_ (1 CPU)
>
> avg-cpu: %user %nice %system %iowait %steal %idle
> 1.9% 0.0% 1.3% 0.4% 0.0% 96.4%
>
> Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn
> sda
> 40.45 643.6k 21.2M 217.5M 7.2G
> sda1
> 40.04 637.6k 21.2M 215.5M 7.2G
> ----
> 7.2 G is far from 78 MB. Am I doing wrong anywhere ? Btw, I did not
reboot the new vm this time
>
>
>
> On Wed, Dec 21, 2022 at 9:30 PM Daniel P. Berrangé <berrange(a)redhat.com>
wrote:
>>
>> On Wed, Dec 21, 2022 at 09:26:14PM +0530, Gk Gk wrote:
>> > Thanks Daniel for the response.
>> >
>> > I am wondering what exactly is the difference in the process for a
soft and
>> > hard reboot in the context of a kvm guest ? Can you throw some light
here
>> > please ?
>>
>> KVM will always do a soft reboot, where QEMU keeps running.
>>
>>
>> With regards,
>> Daniel
>> --
>> |: https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
>> |: https://libvirt.org -o-
https://fstop138.berrange.com :|
>> |: https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|
>>
>
1 year, 8 months
Need help
by Gk Gk
Hi All,
I am trying to get guest VM's disk statistics using a libvirt python
library as follows:
---
raw_xml = domain.XMLDesc(0)
for disk in doc.getElementsByTagName('disk'):
disk_data = disk.getElementsByTagName('target')
---
The above code is yielding the following stats for two disks inside the VM:
--
disk_name=sda
read_req=34137,read_bytes=445358592,write_req=2405970,write_bytes=24943391744
disk_name=sdb
read_req=34357,read_bytes=450754048,write_req=2405984,write_bytes=24943465472
---
The write_bytes divided by 1024 yields 24358853 kB.
But when I compare the above statistics from the iostat data shown from
inside the VM, I see a stark difference between the two results as shown
below:
---
root@sample:~# iostat
Linux 4.15.0-101-generic (sample) 12/21/2022 _x86_64_ (1 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.27 0.00 0.03 0.02 0.01 99.68
Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 0.24 0.04 11.87 400052 121844120
sdb 0.00 0.00 1.19 5269 12223752
----
Why is there a huge difference in the number of bytes read and written for
the two disks as reported by libvirt ? Please explain.
Thanks
Kumar
1 year, 8 months
Failed to connect socket to '/var/run/libvirt/virtnetworkd-sock': No such file or directory
by 陈新隆
Hi team,
i'm trying to hotplug an interface to guest, after execute the command
below I got an error :
```
virsh attach-interface --domain 1 --type network --source net1 --model
virtio-non-transitional --target /sys/devices/virtual/net/net1/tap603053
--mac ac:de:48:77:a2:32 --config --live
error: Failed to attach interface
error: Failed to connect socket to '/var/run/libvirt/virtnetworkd-sock': No
such file or directory
```
According to https://libvirt.org/daemons.html there's two arch of daemon
which is "monolithic" and "modular" , so I was wondering if I connect to
the monolithic daemon (libvirtd) to attach the interface should works. Then
I execute the command below :
```
bash-4.4# virsh -c qemu:///system?socket=/var/run/libvirt/libvirt-sock
attach-interface --domain 1 --type network --source net1 --model
virtio-non-transitional --target /sys/devices/virtual/net/net1/tap603053
--mac ac:de:48:77:a2:32 --config --live
Authorization not available. Check if polkit service is running or see
debug message for more information.
error: Failed to attach interface
error: Failed to connect socket to '/var/run/libvirt/virtnetworkd-sock': No
such file or directory
```
Still, I got the same error. My question is :
1. How should I hotplug/unplug an interface without virtnetworkd ?
2. Am I right about the guess of "If I use monolithic daemon then I can
hotplug/unplug an interface without virtnetworkd ?
1 year, 8 months