Re: [libvirt-users] virsh dominfo does not show correct cpuTime
by changqian zuo
I was getting vCPU use time outside of guest with libvirt-python API, and
them calculate utilization with (cpuTime2 - cpuTime1) / (t2 - t1). I was
not doing this inside the guest os.
2015-07-24 15:09 GMT+08:00 2020human <human2020(a)qq.com>:
> You calculate is vCPU use time not utilization。
>
> use_time/total_cpu_time is utilization。
>
> total_cpu_time=`cat /proc/stat |sed -n '1p'|awk '{ print
> sum=$2+$3+$4+$5+$6+$7+$8+$9+$10}'`
>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "changqian zuo";<zuochangqian(a)gmail.com>;
> *发送时间:* 2015年7月24日(星期五) 中午1:51
> *收件人:* "libvirt-users"<libvirt-users(a)redhat.com>;
> *主题:* [libvirt-users] virsh dominfo does not show correct cpuTime
>
> Hi,
>
> I am doing some domain resource monitoring work. I use
>
> cat /dev/urandom | md5sum
>
> to simulate vCPU load and write a script to calculate vCPU utilization. It
> seems all good at the beginning. After I abort the ``cat ... md5sum``
> command in domain, I see some strange data as below:
>
> CPU time: 8410960000000
> CPU util: 99.8410609331%
> CPU time: 8411970000000
> CPU util: 100.843672381%
> CPU time: 8412380000000
> CPU util: 40.9336949531%
> CPU time: 8412440000000
> CPU util: 5.9899303915%
> *CPU time: 8412440000000*
> *CPU util: 0.0%*
> CPU time: 8412490000000
> CPU util: 4.99165856007%
> *CPU time: 8412490000000*
> *CPU util: 0.0%*
> *CPU time: 8412490000000*
> *CPU util: 0.0%*
> CPU time: 8412570000000
> CPU util: 7.987195515%
> *CPU time: 8412570000000*
> *CPU util: 0.0%*
> CPU time: 8412590000000
> CPU util: 1.99668576091%
> CPU time: 8412670000000
> CPU util: 7.98700539474%
> CPU time: 8412720000000
> CPU util: 4.99167281754%
> CPU time: 8412780000000
> CPU util: 5.98888552548%
>
> Looking at those 0.0% lines. Strange, though the guest is running, cpuTime
> does not increase. How can this happen? Any one helps? Thanks.
>
> Host information:
>
> - CentOS Linux release 7.0.1406 (Core)
> - libvirt 1.2.8
> - qemu-kvm-rhev 2.1.2
>
> ----- python script to capture cpu domain usage ----
> import libvirt
> import time
>
> conn = libvirt.openReadOnly("qemu:///system")
> dom = conn.lookupByName('cpu-test')
> last_time = time.time()
> last_cpu_time = dom.info()[4]
>
> while True:
> time.sleep(1)
> this_time = time.time()
> dom_info = dom.info()
>
> print "CPU time: %s" % dom_info[4]
> print "CPU util: %s%%" % ((dom_info[4] - last_cpu_time) / ((this_time -
> last_time) * 10000000))
>
> last_cpu_time = dom_info[4]
> last_time = this_time
> ----------------------------- end -----------------------------
>
>
>
9 years, 4 months
[libvirt-users] virsh dominfo does not show correct cpuTime
by changqian zuo
Hi,
I am doing some domain resource monitoring work. I use
cat /dev/urandom | md5sum
to simulate vCPU load and write a script to calculate vCPU utilization. It
seems all good at the beginning. After I abort the ``cat ... md5sum``
command in domain, I see some strange data as below:
CPU time: 8410960000000
CPU util: 99.8410609331%
CPU time: 8411970000000
CPU util: 100.843672381%
CPU time: 8412380000000
CPU util: 40.9336949531%
CPU time: 8412440000000
CPU util: 5.9899303915%
*CPU time: 8412440000000*
*CPU util: 0.0%*
CPU time: 8412490000000
CPU util: 4.99165856007%
*CPU time: 8412490000000*
*CPU util: 0.0%*
*CPU time: 8412490000000*
*CPU util: 0.0%*
CPU time: 8412570000000
CPU util: 7.987195515%
*CPU time: 8412570000000*
*CPU util: 0.0%*
CPU time: 8412590000000
CPU util: 1.99668576091%
CPU time: 8412670000000
CPU util: 7.98700539474%
CPU time: 8412720000000
CPU util: 4.99167281754%
CPU time: 8412780000000
CPU util: 5.98888552548%
Looking at those 0.0% lines. Strange, though the guest is running, cpuTime
does not increase. How can this happen? Any one helps? Thanks.
Host information:
- CentOS Linux release 7.0.1406 (Core)
- libvirt 1.2.8
- qemu-kvm-rhev 2.1.2
----- python script to capture cpu domain usage ----
import libvirt
import time
conn = libvirt.openReadOnly("qemu:///system")
dom = conn.lookupByName('cpu-test')
last_time = time.time()
last_cpu_time = dom.info()[4]
while True:
time.sleep(1)
this_time = time.time()
dom_info = dom.info()
print "CPU time: %s" % dom_info[4]
print "CPU util: %s%%" % ((dom_info[4] - last_cpu_time) / ((this_time -
last_time) * 10000000))
last_cpu_time = dom_info[4]
last_time = this_time
----------------------------- end -----------------------------
9 years, 4 months
[libvirt-users] global lock when executing hook scripts
by Vasiliy Tolstov
Hello. I'm try to understand, why in case of 20 workers libvirt fully
locked when runs qemu hook (when domain starts) virsh list freezes.
As i understand in case of using more workers it utilized to run hooks
too, but as i see in pstree only main libvirt process executes hook.
Why this happening?
pstree -a -p 6642
libvirtd,6642 -d -l
├─qemu,9272 /etc/libvirt/hooks/qemu testvm prepare begin -
│ └─prepare,9468 -x /usr/local/prepare.sh testvm
│ └─sleep,9469 5000
├─{libvirtd},6643
├─{libvirtd},6644
├─{libvirtd},6645
├─{libvirtd},6646
├─{libvirtd},6647
├─{libvirtd},6648
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
9 years, 4 months
[libvirt-users] libvirtd error missing cpu model
by abhishek jain
Hi Team
I'm facing following error while running libvirt on ppc platfrom with cpu
model as e5500..
2015-07-15 06:30:37.307+0000: 3976: warning : virQEMUCapsInit:1001 : Failed
to get host CPU
2015-07-15 06:30:37.642+0000: 3976: error : virFirewallApply:936 : out of
memory
2015-07-15 06:31:16.451+0000: 3969: error : cpuNodeData:344 : this function
is not supported by the connection driver: cannot get node CPU data for ppc
architecture
Below is the output of important files..
cat /proc/cpuinfo
processor : 0
cpu : e5500
clock : 1400.000000MHz
revision : 2.1 (pvr 8024 1021)
bogomips : 75.00
cat /usr/share/libvirt/cpu_map.xml
<model name='POWERPC_e5500'>
<vendor name='Freescale'/>
<pvr value='0x80240000'/>
</model>
<model name='POWERPC_e6500'>
<vendor name='Freescale'/>
<pvr value='0x80400000'/>
</model>
</arch>
</cpus>
Thanks
Abhishek Jain
9 years, 4 months
[libvirt-users] [Libvirt ] qemu+tls failed to verify peer's certificate
by Dhaval_Shah1@dell.com
Dell Customer Communication
Hi everyone,
I am trying to do a virsh using TLS Certificate. I am getting an error that "error: authentication failed: Failed to verify peer's certificate"
I am following the steps mentioned in the http://wiki.libvirt.org/page/TLSSetup
I have generated CA Certificate, client certificate and server certificate and placed them as mentioned in above site.
After that when I am trying to do a virsh it is failing. Please let me know if anyone has encountered this kind of issue.
virsh -c qemu+tls://172.14.5.6/system list
error: failed to connect to hypervisor
error: authentication failed: Failed to verify peer's certificate
Thanks & Regards,
Dhaval Shah
9 years, 4 months
[libvirt-users] Migrate KVM linux based VM to microsoft Hyper-v
by test comp
Hi,
I am searching around this topic but didn't get any suitable link, can you
guys please help with this.
i have my linux based VM as .img which is built on top of VirtIO protocol
and runs fine on KVM or qemu.
i am trying to port the same on the Microsoft Hyper-V but it is not working.
I get blank screen with no other actions, tried the same on virtual box
also but result is same.
i have converted the vm.img format to .vhd, .vhdx, .vmdk , .vdi using
different tools like qemu-img ,
and other windows based tools. but no success.
I am running hyper-v on windows 10.
My existing linux based VM setup works on qemu both in Centos and windows,
but other than that
its not working on any other hyper visor.
i am not sure whether i need to update My VM's drivers to support hyper-V.
Please guide me in the
right direction.
Regards
Roshan S
9 years, 4 months
[libvirt-users] Clustering configuration for evaluation
by Jean-Pierre Ribeauville
Hi,
I need to set up a two -nodes RHEL cluster in order to check KVM guests migration stuff.
Could you , please , give me some advice regarding :
- HW pieces I need to setup the cluster ( I already got the two servers)
- The RHEL packages and subscriptions needed for the cluster and the guests management on top of this cluster.
Thx for help.
J.P. Ribeauville
P: +33.(0).1.47.17.27.78
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
9 years, 4 months
[libvirt-users] Hot Cloning - clone running Virtual Machines
by NoxDaFox
Greetings,
I am running a test automation service which makes use of QEMU/KVM. As the
tests run for few minutes, the time spent booting the OS (Windows) is quite
a waste of resources so I decided to play a bit around the idea of hot
cloning running VMs.
Following an old discussion I found, I proceeded with saving the VM state
through virsh save, edit its XML file with virsh save-image-edit and
restore it through virsh restore.
The problem comes when I try to change some specific fields in the XML. As
I run several instances on the same server, I need to provide different
names and UUIDs to avoid collisions. Unfortunately, libvirt forbids this
operation issuing the following error message:
error: unsupported configuration: Target domain uuid
7c85e288-88fe-43d2-8b9c-89af4c83c10a does not match source
62f28517-8601-4d2e-942c-a20d087f9f4a
Same thing applies with the name field.
Is this a limitation of the API or it is a designed protection mechanism?
Would it be possible to overcome this limit?
Thank you.
9 years, 4 months
[libvirt-users] Can't figure out how to restart VM after making config changes in virt-manager
by KARR, DAVID
I finally figured out my VNC configuration, so I can now run virt-manager to inspect and manipulate my VM.
I initially created the VM with "virt-install", but I haven't been able to see the console or do anything with it.
When I ran virt-manager, I tried to configure the vcpus (1->4) and change the boot order (cdrom, then disk, as I created the VM with an ISO).
When I made these changes, virt-manager said they would take effect on the next restart of the VM. So, then I tried to restart the VM from virt-manager. The "Run" button is disabled, so I assume that means it detects that the VM is running. I've tried clicking "Shut Down" and selecting "Reboot" from the dropdown, but neither of those seem to do anything. I've tried to view the console window, but I've only ever seen a black screen there.
I believe some people mentioned that I should try sshing to the VM. I would do that if I could find an IP address or hostname that appears to correspond to this VM. The obvious, using the VM name, didn't work.
I'm not sure what to do here.
9 years, 4 months
[libvirt-users] Cannot migrate vm between servers
by Chris Lewis
Hello,
I issue the command below to migrate virtual machine "jabber" from host
vmserver5 to vmserver3
I see the machine is created at the destination, paused on both sides,
but the process fails with the error below (and the destination VM is
removed)
root@vmserver5:~/# virsh migrate --p2p --unsafe jabber
qemu+ssh://vmserver3/system
error: internal error: migration was active, but no RAM info was set
Relevant Software versions:
vmserver5:
||/ Name Version Architecture Description
+++-==============================================-============================-============================-=
vmserver3:
||/ Name Version Architecture Description
+++-==================================-=============================-============-============================
ii kvm 1:1.1.2+dfsg-6+deb7u8
amd64 dummy transitional package from kvm to qemu-kvm
ii libvirt-bin 1.2.9-9~bpo70+1 amd64
programs for the libvirt library
ii qemu-kvm 1.1.2+dfsg-6+deb7u8 amd64
Full virtualization on x86 hardware
Both machines have shared storage mounted in same place. Very little
info on web regarding this error.
Can anyone suggest what is going on?
Thanks in advance
Chris Lewis
9 years, 4 months