[Libvir] PATCH: Create a logfile for each QEMU vm
by Daniel P. Berrange
Most of the error reporting the QEMU daemon is focused on sending errors
wrt to RPC ops to the client. There is no provision currently for getting
info about the QEMU vm itself when problems occur. The most common problem
is some mis-configurable in the XML causes qemu to fail to start up. This
results in the completely accurate & completely useless (mea-culpa) error
message
libvirt.libvirtError: virDomainCreateLinux() failed internal error
End-of-file while reading PTY startup output'
What this means is that qemu crashed/exited at startup. Now this patch
does not (yet) directly address that stupid error message, but what it
does do is provide a way to diagnose the real problem.
For every VM we start it will create a logfile
/etc/libvirt/qemu/logs/[vmname].log
Or
$HOME/.libvirt/qemu/logs/[vmname].log
And all output from QEMU's stderr/stdout will get written to this file.
So
# virsh --connect qemu:///system start wizz
libvir: QEMU error : internal error End-of-file while reading PTY startup output
error: Failed to start domain wizz
# cat /etc/libvirt/qemu/logs/wizz.log
qemu: could not open hard disk image '/home/berrange/src/xen/virtinst--devel/demo'
Next up I'm going to work on
a) Improving the error message
b) Adding validation that disk images actually exist before
launching QEMU since that's the most common error we're seeing
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
17 years, 7 months
[Libvir] AC_PROG_CPP
by Richard W.M. Jones
We have AC_PROG_CPP, but apparently no C++ code? In any case unless a
C++ compiler is installed, I get:
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 7 months
[Libvir] Question on acquiring cpuTime in struct _virDomainInfo
by Jan Michael
Hi everyone,
using libvirt I'm trying to calculate cpu utilization of a node in
percent. But sometimes values beyond 100.0% are being calculated.
This is because a domain spend more time on a cpu than time is
elapsed in the meantime.
A short explanation of the way how cpu utilization is computed in my
case:
1. - open two connections with
conn_cur/conn_old = virConnectOpenReadOnly(NULL);
2. - get current time
gettimeofday(&time_old, NULL);
- get domain by id with
dom_old = virDomainLookupByID(conn_old, id)
- get domain information
virDomainGetInfo(dom_old, &info_old);
3. - sleep a second
4. - doing same stuff like in 2. but with _cur
5. - compute cpu utilization by dividing used cputime by elapsed time
and multiply with 100
Am I right if I suppose that cpuTime for _virDomainInfo structure
will be directly acquired from the hypervisor in virDomainGetInfo
(dom_old, &info_old) or is it already present with getting the domain
itself? Is there any better solution of doing this, which is more
precise?
And another general question:
The monitoring utility of xen, called xentop, provides also
statistics about networking and vbds. Are there any plans to provide
this values by libvirt in the future?
Cheers,
Jan
17 years, 7 months
[Libvir] Please check my autoconf libvirt.m4
by Richard W.M. Jones
Attached is an autoconf snippet which allows you to check that the
libvirt library is installed (not necessarily development headers
though) and check the version number.
If any autoconf experts (hello, Mark) would like to check it makes
sense, that'd be great.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 7 months
Re: [Libvir] [RFC]OpenVZ XML def
by Richard W.M. Jones
Shuveb Hussain wrote:
>> There is the same problem with the Xen libraries. Dan had to rewrite a
>> lot of code concerning access to the hypervisor.
>
> No matter how different I think, the end result looks just like the
> OpenVZ library code :-P
> So, I'm trying to write code that looks different, but does the same
> thing. The OpenVZ utilities are however, scripting friendly. Their
> text output is consistent. How about writing a daemon for OpenVZ that
> "talks" to the OpenVZ utilities, rather than trying to re-write the
> utilities? Would this be a bad idea?
It sounds like a very good idea. There can also be no question of
infringement if done this way.
> The actual libvirt can then
> connect to this daemon to get the real stuff done. This is what I did
> in my EasyVZ GUI tool for OpenVZ.
Why is the daemon needed though? The libvirt calls can just launch the
OpenVZ command line tools as necessary. We got into daemons with QEMU,
and it's nothing but trouble.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 7 months
[Libvir] Re: [Fedora-xen] BUG at arch/x86_64/mm/../../i386/mm/hypervisor.c:185!
by Richard W.M. Jones
Naoki wrote:
> On Mon, 2007-05-21 at 18:53 +0100, Richard W.M. Jones wrote:
>> I've been stressing Xen all week, and found plenty of bugs but not this
>> one. Can I ask a few questions about your set-up?
>
> Fire away..
>
>> - Is this dmesg in the dom0 or the domU (guest)?
>
> dom0
>
>> - You seem to have an x86-64 SMP kernel. Can you provide details of
>> the machine (how many cores, how much RAM, etc.)
>
> Single chip, dual core, intel Core 2 Duo.
>
> Family: Pentium 4
> Manufacturer: Intel
> ID: 47 0F 00 00 FF FB EB BF
> Signature: Type 0, Family 15, Model 4, Stepping 7
>
>
>> - How many guests are you running, and of what sort. eg. What is the
>> guest OS? Is it paravirt or full-virt?
>
> I had one inactive guest running.
> dom0 is running x86_64 kernel 2.6.20-2925.8.fc7xen.
> And I'm on rawhide fully updated.
That's the same set-up I'm using. Do you get this problem often? Is it
reproducible? Is there a particular thing that you are doing when this
happens?
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
17 years, 7 months
[Libvir] [RFC]OpenVZ XML def
by Shuveb Hussain
Hi,
I am adding OpenVZ support to Libvirt and work is progressing well.
I'm able to list VM instances and I'm slowly trying to cover the basic
API functions one by one. That brings us to the creation of OpenVZ
based VMs. Just wanted to discuss the basic XML definition format so
that I can get comments and improve if need be:
<domain type='openvz'>
<name>openvzdemo</name>
<uuid>55a2441d-e012-40fe-a4f7-78e176015d40</uuid>
<vpsid>101</vpsid>
<template>vps.basic</template>
<onboot>true</onboot>
<os template='slackware-10.2-i386-minimal'/>
<network>
<hostname>openvzhost</hostname>
<ip address='192.168.1.101'
netmask='255.255.255.0'
defgw='192.168.1.1'
/>
<nameserver>192.168.1.1</nameserver>
<nameserver>202.56.250.5</nameserver>
</network>
</domain>
Does this look OK?
Regards,
--
Shuveb Hussain.
EasyVZ - OpenVZ management GUI: http://easyvz.sourceforge.net
I blog at http://binarykarma.org
Spread the Karma.
17 years, 7 months
[Libvir] [RFC] Life-cycle Management of the domain take2
by Saori Fukuta
Hi,
I'm making a patch to provide a changing allocation dynamically and statically
without keeping state at the library.
And this is still uncompleted works, but I would like to hear your comments.
Attached patch shows below:
# virsh --help setmem
NAME
setmem - change memory allocation
SYNOPSIS
virsh setmem <domain> <kilobytes> [ --static | --dynamic ]
DESCRIPTION
Change the current memory allocation in the guest domain.
OPTIONS
<domain> domain name, id or uuid
<kilobytes> number of kilobytes of memory
--static static change
--dynamic dynamic change
First, I made upper interface.
---
virsh.c ( attached file "add_option2virsh.patch )
- add 2 options as follows:
--dynamic, --static
- call new APIs:
virDomainSetMaxMemory -> virDomainSetMaxMemoryScope
virDomainSetMemory -> virDomainSetMemoryScope
virDomainSetVcpus -> virDomainSetVcpusScope
---
libvirt.c ( attached file "add_option2libvirt.patch )
- add 3 APIs:
virDomainSetMaxMemoryScope
virDomainSetMemoryScope
virDomainSetVcpusScope
and I will add lower driver as follows in the case of setmem.
---
drivers ( attached file "add_option2driver.patch )
- xen_unified.c : add xenUnifiedDomainSetMemoryScope
- xend_internal.c : add xenDaemonDomainSetMemoryScope
- other : set NULL to domainSetMemoryScope
I plan to achieve allocation dynamically and statically by such a way
at xenDaemonDomainSetMemoryScope.
1. get configuration from the Xen Daemon using sexpr_get.
2. change the value
when static option is specified, change the node of configuration using
new API that I will make.
when dynamic option is specified, change the allocation using xend_op
3. set configuration to the Xen Daemon using xend_op
Why I did not use virDomainGetXMLDesc and virDomainDefineXML was some elements
ware lost in current XML.
For example, there is no "vncpasswd", "cpus", "localtime" in XML configuration
with virDomainGetXMLDesc. So when I set the "vncpasswd" the "vncpasswd" will
disappear after I define the XML configuration.
How does this sound ?
Thanks,
Saori Fukuta.
17 years, 7 months
[Libvir] QEMU without KVM
by Steven W. Moyer
I'm working on getting QEMU running with libvirt and virt-manager and have thus far had no success. I chose QEMU because it didn't require CPU support for full-virtualization (I got a bit older CPUs).
Now I'm at a stand-still trying to get it running. My libvirt is compiled with QEMU support, but I'm getting a "virConnectOpenReadOnly() failed error when it tries to connect the the hypervisor. A couple questions:
1) How do I start qemu as a service? I actually have 6 guests running.
2) How do I connect from libvirt to qemu? (either running or not).
Could someone who's already been there give me a little libvirt/qemu tutorial?
Thanks, smoyer
--
Steven W. Moyer
Principle Architect, Assurance Applications
C-COR Solutions, LLC
60 Decibel Road
State College, PA 16801
Office Phone: 814-231-4408
Front Desk: 814-238-2461
Cell Phone: 814-883-0391
Fax: 814-278-6540
E-mail: smoyer(a)c-cor.com
AIM: StevenWMoyer
ICQ: 349680381
Jabber: smoyer1(a)jabber.jcware.org
MSN: smoyer64
Yahoo: smoyer64
17 years, 7 months