[libvirt-users] data monitored by "virDomainBlockStats" API not consistent with ones reading from /proc/[pid]/io, and corrugated with /proc/diskstats
by coperd
Hi, all.
While monitoring KVM VMs’ disk utilisation using libvirt API “virDomainBlockStats", I find that the results acquired is not consistent
with the value read from /proc/[vm_pid]/io(i only care about “rd_bytes" and “wr_bytes” fields). Since libvirt doesn’t support host level monitoring,
i have to calculate the host’s disk utilisation by reading from the /proc/diskstats file. What’s worse, the individual VM’s disk data may
be greater that the physical disk’s total value during some sampling time.
It is supposed that the VM’s disk “rd_bytes" and “wr_bytes" should never exceed the value of the physical disk respectively, right ? Doesn’t
libvirt virDomainBlockStats read disk information from “proc” ?
I want to calculate VM’s bandwidth, here is my way:
Firstly, we can get total disk utilisation using tools like iostat("iostat -x”, the %util field represent the disk’s utilisation percentage)
Then, given a sampling time period, 10s for example, i collected total bytes read/written by each VM by virDomainBlockStats and total
bytes of the physical disk by /proc/diskstats, then delta(VM’s rd+wr bytes)/delta(physical disk’s rd+wr bytes) * %util is the VM’s
disk utilization percentage during this time period.
Since the appearance of the above situation, i can’t get correct result. I have search a lot for this question, but no answers. Any help would
be appreciated.
10 years, 5 months
[libvirt-users] qemu-bridge-helper issue
by abhishek jain
Hi
I'm able to run the below command using root permission....
sudo kvm -netdev bridge,br=qbr0ccdca50-fa,id=hostnet -M ppce500
Warning: netdev hostnet has no peer
Could not initialize SDL(No available video device) - exiting
However when I'm running the same command without root authority,I'm
getting following logs...
kvm -netdev bridge,br=qbr0ccdca50-fa,id=hostnet -M ppce500
failed to create tun device: Operation not permitted
failed to launch bridge helper
kvm: -netdev bridge,br=qbr0ccdca50-fa,id=hostnet: Device 'bridge' could not
be initialized
I need to run the above command without root authority.Please help
regarding this.
Thanks
Abhishek Jain
10 years, 5 months
[libvirt-users] [netcf]IFF_RUNNING flag on a bridge device
by Jianwei Hu
Hi All,
I have one netcf question, please help me to resolve it, thanks.
I can set a IFF_RUNNING flag to a bridge device which are no interface device attached. What status of a flag on a bridge device in current kernel?(w/o interface), is this a new change in kernel or other component? In netcf, but there is a patch to fix that flag issue, I can't understand it.
fix wrong status of bridge devices
The IFF_RUNNING flag is not set on a bridge device if there are no devices attached to it. So bridges without attached devices are reported as inactive. Destroying inactive devices leads to an error and thus the device can't be removed (easily) from the operating system. This patch checks if the device is a bridge and if so ignores the IFF_RUNNING flag.
https://git.fedorahosted.org/cgit/netcf.git/commit/?id=7fa5fa5a1e43e6e2af...
My testing results of IFF_RUNNING on non-device bridge:
Version:
[root@rhel6 boot]# rpm -q kernel netcf
kernel-2.6.32-468.el6.x86_64
netcf-0.2.4-1.el6.x86_64
[root@rhel6 ~]# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no
[root@rhel6 ~]# ifconfig br0
br0 Link encap:Ethernet HWaddr 6A:3B:6F:DF:17:A9
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:468 (468.0 b)
[root@rhel6 ~]# ifconfig br0 up
[root@rhel6 ~]# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no
[root@rhel6 ~]# ifconfig br0
br0 Link encap:Ethernet HWaddr 6A:3B:6F:DF:17:A9
inet6 addr: fe80::683b:6fff:fedf:17a9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:866 (866.0 b)
10 years, 5 months
[libvirt-users] get domain id or something else that can help determine domain in network ethernet
by Vasiliy Tolstov
Hello. I need to do some specific steps to bring up network for domain.
I can't use bridge, nat, and other modes.
I prefer ethernet type networking that bring up by script.
But in case os script i have one big problem - how can i determine and
get some domain data - for example if i get domain id, or mac address
i can get other needed config.
How can i get this data inside the script? Now i can get only
interface name, that can't helps me, because it does not contains
domain id...
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
jabber: vase(a)selfip.ru
10 years, 5 months
Re: [libvirt-users] bridge could not be initialized
by Kashyap Chamarthy
On Tue, Jun 24, 2014 at 05:24:01PM +0530, Kashyap Chamarthy wrote:
> [Please keep the list in CC for technical questions.]
Now adding the list for real.
>
> On Mon, Jun 23, 2014 at 04:45:25PM +0530, abhishek jain wrote:
> > Hi
> >
> > I'm trying to run VM from controller node onto compute node and it is
> > stucking at spawning state.
>
> There could be any number of reasons. You need to carefully examine Nova
> logs (/var/log/nova/) to see what's going on when you invoke a guest via
> Nova. Hard to say without more investigative details.
--
/kashyap
10 years, 5 months
[libvirt-users] Strange IPv6 Issues
by Tim Schumacher
Hi folks,
I'm having the problem that my guests are most of the time not
reachable via IPv6 and cant connect to IPv6 hosts, but if I ping the
public IPv6-Adress of my bridge, the host can use IPv6 again. This is
for incomming and outgoing traffic.
I've attached my network xml file.
virsh version reports this:
Compiled against library: libvirt 1.2.4
Using library: libvirt 1.2.4
Using API: QEMU 1.2.4
Running hypervisor: QEMU 2.0.0
Routing on the guest looks like this:
$ ip -6 route
2a01:4f8:200:2265:5054:ff:febe:e8e6 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
default via fe80::5054:ff:fe32:e58 dev eth0 metric 1024
Routing on the host looks like this:
$ ip -6 route
2a01:4f8:200:2265::/64 dev eth0 proto kernel metric 256
2a01:4f8:200:2265::/64 dev virbr0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
fe80::/64 dev vnet0 proto kernel metric 256
fe80::/64 dev vnet1 proto kernel metric 256
fe80::/64 dev virbr0 proto kernel metric 256
fe80::/64 dev vnet2 proto kernel metric 256
fe80::/64 dev vnet3 proto kernel metric 256
fe80::/64 dev vnet4 proto kernel metric 256
fe80::/64 dev vnet5 proto kernel metric 256
default via fe80::1 dev eth0 metric 1024
I'm running Debian Jessy on the host and on the guest. That means that
they all are running Kernel 3.14.
If you have any idea what could be causing this or if you need any
information please post.
Thanks for your time and help
Tim
10 years, 5 months
[libvirt-users] ERROR: Domain not found: no domain with matching name 'ubuntu'
by Sanket Panhale
Hi guys,
I am new to QEMU-KVM, libvmi and libvirt stuff.
Libvmi uses libvirt.
I am trying to to run process-list example of libvmi and getting error as
below. It seems that this error may be due to libvirt as it is not able to
find domain.
I seek your kind help on below error:
spanhal1@seclab2:~/KVMModule/libvmi-0.10.1$ sudo ./examples/process-list
ubuntu
libvir: QEMU error : Domain not found: no domain with matching name 'ubuntu'
VMI_ERROR: Failed to get domain id from name.
Failed to init LibVMI library.1
Here are few details of step I performed:
1. I have installed KVM module. (version 3.5)
2. Installed QEMU-KVM. (version 1.2.0)
3. Installed libvirt(version 0.1.2.5)
4. Installed libvirt-bin(version 0.9.8-2ubuntu17.19)
5. Installed libvmi. (version 0.10.1)
6. Then I am trying to run process-list example and I am getting error as
above.
sudo ./examples/process-list ubuntu
To deal with this, I tried creating VM with domain name ubuntu using steps
given at below link.
https://help.ubuntu.com/community/KVM/CreateGuests
http://virt-tools.org/learning/install-with-command-line/
Create VM:
$sudo apt-get install virtinst
$sudo fallocate -l 8192M /var/lib/libvirt/images/guest.img
$sudo qemu-img create -f qcow2 /var/lib/libvirt/images/guest.qcow2 8192
spanhal1@seclab2:~/KVMModule$ sudo virt-install --connect qemu:///system -n
ubuntu -r 512 -f guest.qcow2 -s 12 -c
/home/spanhal1/KVMModule/ubuntu-12.04.4-desktop-amd64.iso --vnc
--noautoconsole --os-type linux --accelerate --network=network:default
ERROR Host does not support any virtualization options
Here are few workaround and information for this error:
1. spanhal1@seclab2:~/KVMModule$ modprobe kvm
spanhal1@seclab2:~/KVMModule$ lsmod | grep kvm
kvm_intel 137888 0
kvm 422160 1 kvm_intel
2. spanhal1@seclab2:~/KVMModule$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
Check if virutalization is enabled by BIOS:
spanhal1@seclab2:/var/log/libvirt$ sudo modprobe msr
spanhal1@seclab2:/var/log/libvirt$ sudo rdmsr 0x3a
5
(Values 3 and 5 mean it's activated).
Libvirt log:
2014-06-12 20:06:24.033+0000: 1305: error : virCommandWait:2188 : internal
error Child process (LC_ALL=C
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
/usr/local/bin/qemu-system-x86_64 -help) status unexpected: exit status 1
2014-06-12 20:06:24.034+0000: 1305: error : virCommandWait:2188 : internal
error Child process (LC_ALL=C
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
/usr/local/bin/qemu-system-x86_64 -help) status unexpected: exit status 1
Machine Details:
Intel(R) Core(TM) i3-3240 CPU @ 3.40GHz
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave avx
f16c lahf_lm arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority
ept vpid fsgsbase smep erms
OS: Ubuntu 12.04.1 LTS
Config file for Libvmi:
ubuntu {
ostype = "Linux";
sysmap = "/boot/System.map-3.5.0-22-generic";
linux_name = 0x460;
linux_tasks = 0x240;
linux_mm = 0x278;
linux_pid = 0x2b4;
linux_pgd = 0x48;
}
Thanks,
Sanket.
10 years, 5 months
[libvirt-users] /etc/machine-id
by Gene Czarcinski
I was under the impression that the value of /etc/machine-id was unqiue
for every OS installation on a system. This seems to be the case on
real hardware. That is, if I install Fedora 19, Fedora 20, and
Fedora-rawhide on a system, they will each have a different value for
/etc/machine-id.
This does not seem to be the case for qemy-kvm-libvirt virtual systems.
SOmetimes they are different but I just noticed that a virtual system
with both Fedora 20 and Fedora rawhide installed (btrfs partitioning),
the two installations have the same value in /etc/machine-id. The two
installs have different ext4 partitions for /boot, different subvols for
the respective rootfs and the same/shared subvol for /home.
Comment? Bug?
Gene
10 years, 5 months
[libvirt-users] Managed USB passthrough
by Michael Han
Does the "managed" attribute of the hostdev element for a USB device
make a difference? The Domain XML Format docs has the following
sentence for the hostdev element:
If managed is omitted or "no", and for USB devices, the user is
responsible to call virNodeDeviceDettach (or virsh nodedev-dettach)
before starting the guest or hot-plugging the device, and
virNodeDeviceReAttach (or virsh nodedev-reattach) after hot-unplug or
stopping the guest.
Is that still accurate? The device seems to get passed through fine to
my LXC container without any dettach/reattach calls. But I'm seeing
some other strange USB behaviour in the guest and just want to see if
it's at all related to the managed attribute.
Cheers.
10 years, 5 months
[libvirt-users] Access permissions of passed through character devices
by Pickartz, Simon
Dear all,
I am using libvirt in conjunction with LXC. In accordance with http://libvirt.org/formatdomain.html#elementsHostDevCaps I pass an InfiniBand adapter through to the guest container. However, within the container the access permissions are not the same. Within the host they are like this:
crw-rw-rw- 1 root root 10, 56 20. Jun 09:40 rdma_cm
crw-rw-rw- 1 root root 231, 224 20. Jun 09:41 ucm0
crw-rw-rw- 1 root root 231, 0 20. Jun 09:41 umad0
crw-rw-rw- 1 root root 231, 1 20. Jun 09:41 umad1
crw-rw-rw- 1 root root 231, 192 20. Jun 09:41 uverbs0
Within the guest, only root may read or write from/to the device:
crw------- 1 root root 10, 56 20. Jun 09:40 rdma_cm
crw------- 1 root root 231, 224 20. Jun 09:41 ucm0
crw------- 1 root root 231, 0 20. Jun 09:41 umad0
crw------- 1 root root 231, 1 20. Jun 09:41 umad1
crw------- 1 root root 231, 192 20. Jun 09:41 uverbs0
Do you have any ideas how I can tell lxc via libvirt to change the permissions in such a way that they correspond to those on the host system?
Best regards,
Simon
10 years, 5 months