[libvirt-users] virsh list not working with xen 4
by Rogério Vinhal Nunes
Hi, I'm having some trouble to get libvirt to show the correct power state
of my virtual machines. I'm using Ubuntu 10.04 + Xen 4.1.1 + libvirt 0.8.8.
virsh list --all only shows turned off machines registered in xend. If I
turn them on, they just "disappear", and when I start machines directly from
xml, they just doesn't appear at all.
Libvirt is correctly connecting to xen as I can use the other commands fine,
just the list option doesn't seem to work at all. What can I do to change
that?
# virsh version
Compiled against library: libvir 0.8.8
Using library: libvir 0.8.8
Using API: Xen 3.0.1
Running hypervisor: Xen 4.1.0
12 years, 2 months
[libvirt-users] converting save/dump output into physical memory image
by Andrew Tappert
A lot of people in the security community, myself included, are
interested in memory forensics these days. Virtualization is a natural
fit with memory forensics because it allows one to get access to a
guest's memory without having to introduce any extra software into the
guest or otherwise interfere with it. Incident responders are
particularly interested in getting memory dumps from systems they're
investigating.
Virsh has "save" and "dump" commands for storing the state of a guest to
a file on disk, but memory of KVM guests doesn't get saved in the
"standard" input format for memory forensics tools, which is a raw
physical memory image. (This is what you'd get via the classical "dd
/dev/mem" approach or the contemporary equivalent using the crash
driver; and VMware Server and Workstation produce .vmem files, which are
such raw physical memory images, when a guest is paused or snapshotted.)
In order to analyze the memory of Libvirt/KVM guests with my Linux
memory forensics software, Second Look, I've created a tool for
converting Libvirt-QEMU-save files (output of virsh save command) or
QEMU-savevm files (output of virsh dump command) to raw physical memory
images.
I've got a basic working capability, though I'm still tracking down some
problems with a guest allocated 8GB RAM--not all the memory seems to be
present in the save or dump file. And I haven't tested very extensively
yet, version support is limited to what I myself am currently running, etc.
I'd like to know if this is a capability that others are interested in.
Is this something that would be of interest to the Libvirt project if I
were to contribute the code, or to the KVM project, or do you think it
best exists as a separate project?
I've also got a proof-of-concept tool for converting hibernate images to
raw physical memory images. Perhaps a collection of tools for
converting various memory dump formats would be a good project. Anyone
else interested in this kind of stuff? As an author of commercial
memory forensics software I've got a vested interest in availability of
good memory acquisition capabilities. But there are a number of people
working on FOSS Linux memory analysis tools, too...
Andrew
12 years, 5 months
[libvirt-users] Thread-safety issues with vbox driver ?
by Jean-Baptiste Rouault
Hi,
I'm experiencing weird things with the vbox driver when using multiple threads.
Following is the snippet of code I experience problems with
/*****************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <libvirt/libvirt.h>
void *create_and_destroy(void *arg)
{
virDomainPtr dom = (virDomainPtr)arg;
char buf[VIR_UUID_STRING_BUFLEN];
virDomainGetUUIDString(dom, buf);
if (virDomainCreate(dom) != 0) {
printf("failed to start %s\n", buf);
goto end;
}
printf("%s started\n", buf);
if (virDomainDestroy(dom) != 0) {
printf("failed to destroy %s\n", buf);
}
printf("%s destroyed\n", buf);
end:
virDomainFree(dom);
pthread_exit(NULL);
}
int main(int argc, char **argv)
{
virConnectPtr conn = virConnectOpen("vbox:///session");
int i;
int count = virConnectNumOfDefinedDomains(conn);
char **names = malloc(count * sizeof(char *));
virConnectListDefinedDomains(conn, names, count);
virDomainPtr *doms = malloc(count * sizeof(virDomainPtr));
for (i = 0 ; i < count ; ++i) {
doms[i] = virDomainLookupByName(conn, names[i]);
}
pthread_t *threads = malloc(count * sizeof(pthread_t));
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
for (i = 0 ; i < count ; ++i) {
pthread_create(&threads[i], &attr, create_and_destroy, (void *)doms[i]);
}
pthread_attr_destroy(&attr);
for (i = 0 ; i < count ; ++i) {
pthread_join(threads[i], NULL);
}
virConnectClose(conn);
pthread_exit(NULL);
}
/************************************************/
Here is the output of the program with 2 defined domains:
> libvir: VBOX error : operation failed: OpenRemoteSession/LaunchVMProcess failed, domain can't be started
> failed to start c538c89a-70da-42ab-a88a-5aeb15698c12
> 034cf837-abe7-4c48-8373-0ddcf480d416 started
> 034cf837-abe7-4c48-8373-0ddcf480d416 destroyed
Sometimes the first domain really fails to start, but sometimes it starts correctly but libvirt reports
an error. Sometimes domains aren't destroyed but libvirt reports no error at all.
If there is only one domain, no problem occurs at all. I also tried the same code (ie with multiple domains)
but with only one thread and it works well.
I managed to reproduce these issues with libvirt 0.9.4, 0.9.7, using VirtualBox 4.0 and 4.1.
--
Jean-Baptiste ROUAULT
Ingénieur R&D - diateam : Architectes de l'information
Phone : +33 (0)9 53 16 02 70 Fax : +33 (0)2 98 050 051
12 years, 7 months
[libvirt-users] [API reference] confused by CPU time term
by Zhihua Che
Hi, everyone
I'm writing a virtual machine monitor based on libvirt. As I read
the api reference, I found I'm confused by some terms.
1, What is cumulative I/O wait CPU time?
API reference says that VIR_NODE_CPU_STATS_IOWAIT indicate
cumulative I/O wait CPU time. I'm confused by this time. As far as I
know, when cpu meets IO wait situation, it will schedule another task,
so, how this IO wait time is accounted?
2, How do I get VCPU runtime?
In my mind, VIR_DOMAIN_CPU_STATS_CPUTIME indicates the physical
cpu time consumed by the domain. Is there any API by which I can query
virtual CPU running stats in one domain?
12 years, 7 months
[libvirt-users] PCI passthrough error
by Jaap Winius
Hi folks,
Has anyone encountered the following PCI passthrough error?
error: internal error Process exited while reading console \
log output: char device redirected to /dev/pts/1
assigned_dev_pci_read: pread failed, ret = 0 errno = 2
It's produced after I've detached the PCI device from the base OS and
have tried to start up the guest domain.
To get to this point, I mostly followed these instructions:
http://docs.fedoraproject.org/en-US/Fedora/13/html/Virtualization_Guide/c...
The distro I'm using is Debian squeeze, which by default comes with
libvirt 0.8.3 and qemu-kvm 0.12.5, although to avoid a different PCI
passthrough error, I used Debian backports for squeeze to upgrade them
to libvirt 0.9.8 and qemu-kvm 1.0.
The motherboard involved has VT-d support, which I've enabled with the
"intel_iommu=on" kernel option (dmesg shows "Intel-IOMMU: enabled"). I
did not bother with setsebool because SELinux is disabled.
According to lspci, the device I want to pass through to the guest
domain, a USB controller, has bus/slot/function 00:1a.0, so I added
the following stanza to the <devices> section of my guest domain:
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x00'
slot='0x1a' function='0x0'/>
</source>
</hostdev>
Actually, every time I save this configuration, libvirt changes it to:
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x00'
slot='0x1a' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x05' function='0x0'/>
</hostdev>
Huh, slot 5? I don't have any PCI devices that use slot 5. Well, at
least the system doesn't complain, but I worry that this might be a
symptom of something more serious.
Anyway, I'd be very grateful if anyone has any tips on how I might
avoid the aforementioned error and get PCI passthrough to to work.
Thanks,
Jaap
12 years, 7 months
[libvirt-users] Suggestions on building VM disks from scratch
by Dale Amon
This may not be the best forum to ask, but it does
seem to be one where it is as likely as anywhere
that someone will have dealt with a similar problem.
I need to define a procedure for last resort disaster
recovery from an incremental file level backup of the
root partition (and any others that are critical.)
Now it is easy enough to create a raw virtual disk
with dd, then to losetup and do a cfdisk and mkfs,
then mount it and rsync the backup onto it.
At this point I would like to be able to install
grub and make the virtual disk bootable. I have
'issues' with the way grub does things and the way
it seems to make certain assumptions for you. The
virtual disk is in actuality going to become an hd(0)
on the virtual machine; but my past experience with
grub is that it is going to assume you really
intend to install the MBR on your running system disk;
but if you tell it hd(1) then when you try to boot
it ain't gonna work.
Has anyone dealt with these issues? It's more than
just a VM one; I run up against it time and again.
A few months ago I attempted to attach a brand
new SATA disk via a USB converter to my laptop so
I could build a system on it for a machine that
has not CD, no floppy, etc, etc. I damn near clobbered
my laptop but fortunately caught the problem in time
and fixed it before a reboot... in which case I'd
have *really* had issues.
12 years, 7 months
[libvirt-users] virsh - specifying openvz vm sample in domain creation xml
by Jamshaid
Hello
I need to specify the "vm sample name" in domain creation xml. This is
the option which is provided to vzctl wtih --config parameter, I can
see that in openvz_driver.c there is below code .....
if ((vmdef->profile && *(vmdef->profile))) {
ADD_ARG_LIT("--config");
ADD_ARG_LIT(vmdef->profile);
}
But i am not sure what to put in "domain creation xml" to avail that
option ? I cant find anything about it in documentation or around google.
Regards
James
12 years, 7 months
[libvirt-users] Libvirt source code cannot built with libnettle.
by Chatsiri Ratana
Hello All,
I try to build dependency library name is gnutls which require by libvirt,
but show error us below.
$./configure
checking for shared library run path origin... done
checking whether to use nettle... yes
checking for libnettle... no
configure: error:
***
*** Libnettle 2.4 was not found.
I specify macros are
LD_LIBRARY_PATH=$LD_LIBRARY_PATH/path_of_nettle_2.4/lib and
"PATH:path_of_nettle_2.4/bin/:$PATH" on ~/.bashrc . Why show an errors for
requiring libnettle version 2.4?
VIM command line for show data in config.log. it's show as below.
739 | #define __EXTENSIONS__ 1
740 | #define _ALL_SOURCE 1
741 | #define _DARWIN_C_SOURCE 1
742 | #define _GNU_SOURCE 1
743 | #define _POSIX_PTHREAD_SEMANTICS 1
744 | #define _TANDEM_SOURCE 1
745 | #define HAVE_FSEEKO 1
746 | #define STDC_HEADERS 1
747 | /* end confdefs.h. */
748 | #include <nettle/ripemd160.h>
749 | int
750 | main ()
751 | {
752 | ripemd160_init (0)
753 | ;
754 | return 0;
755 | }
756 configure:8887: result: no
757 configure:8913: error:
758 ***
759 *** Libnettle 2.4 was not found.
Best Regards,
Chatsiri Rattana.
--
:--------------------------------------------------------
http://about.me/chatsiri.ratana
12 years, 7 months
[libvirt-users] vzctl 3.1 not supported in virsh ?
by Jamshaid
Hello
If i use virsh with vzctl 3.1 i get below error
virsh -c openvz:///system
error: /Could not extract vzctl version
It works ok with vzctl 3.0.x
Is there any way i can use virsh with vzctl 3.1 ?
----------------------------------------------------------------
[root@test ~]# /usr/bin/virsh --version=long
Virsh command line tool of libvirt 0.9.11
See web site at http://libvirt.org/
Compiled with support for:
Hypervisors: QEmu/KVM UML OpenVZ VirtualBox Test
Networking: Remote Daemon Network Bridging Nwfilter
Storage: Dir Filesystem SCSI Multipath iSCSI LVM
Miscellaneous: Secrets Debug
--------------------------------------------------------
[root@test ~]# vzctl --version
vzctl version 3.1
--------------------------------------------------------
Regards
James
/
12 years, 7 months
[libvirt-users] virsh create failed: cannot set CPU affinity on process 0
by 杨镭
Hello Everyone:
We can't create vm on a physical server with 64 CPU(as reported by
/proc/cpuinfo). The error message is: "cannot set CPU affinity on process 0"
The following is the capabilities detected by libvirt:
<arch>x86_64</arch>
<model>Westmere</model>
<vendor>Intel</vendor>
<topology sockets='4' cores='10' threads='2'/>
I wonder if libvirt uses incorrect CPU topology information to set process
affinity which lead to the error above.
12 years, 7 months