[libvirt-users] A RFE for libvirt
by whuang
Hi,
I am a libvirt user , there is a requirement about libvirt :
I need a virsh cmd like "#virsh *create-as* --disk --net " to create a
very sample guest
I have not xml file and I think it's a little hard for me to create a
NEW xml for libvirt , so I need a virsh cmd like "vol-create-as " help
me do that.
I know there are a lot of options for creating a guest , I just need
--disk and --net options , others libvirt can set a defaut value .
I just want an easy way to create a guest :>
Wenlong
--
Best Regards!
Wenlong Huang
IRC Account: wenlong
Phone: 62608117 / 15011214521
12 years, 6 months
[libvirt-users] Fine grained authorisation
by Sam Wilson
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi List,
I am trying to provide a solution using KVM on RHEL for a number of
technical staff sharing server resources. We would like to be able to
"restrict" a number of guests from certain users to follow the
principle of least privilege.
So in short, is there a way of defining access to individual guests
via libvirt / polkit or is read only / read write the best we can
expect for the foreseeable future?
Cheers,
Sam
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
iF4EAREIAAYFAk/QWhsACgkQFdt86iEfl/cYagD9FGktnsqyGkfzXWkUyFtJmQc2
VX6ZG2iXmKD75R7c6IgA/j5WvnsXdBA6jPO9/WnX83CmmorPc9oRN6lpYTxXgkON
=38VZ
-----END PGP SIGNATURE-----
12 years, 6 months
Re: [libvirt-users] The default location of vm snapshots
by SimpleCloud
Thanks a lot for the details.
From http://wiki.libvirt.org/page/Snapshots, we have to pause the domain before taking snapshot and resume after. Is there any way to do "live" snapshotting for running domain or reduce pause time?
Thanks,
Lei
------------------ Original ------------------
From: "Eric Blake"<eblake(a)redhat.com>;
Date: Wed, Jun 6, 2012 08:24 PM
To: "SimpleCloud"<simplecloud(a)qq.com>;
Cc: "libvirt-users"<libvirt-users(a)redhat.com>;
Subject: Re: [libvirt-users] The default location of vm snapshots
On 06/06/2012 03:20 AM, SimpleCloud wrote:
> Hi all,
>
>
> Where could I find the memory dump and disk snapshots for vm after command "virsh snapshot-create <some_running_vm>"? Thanks in advance.
This particular form of snapshot is called the 'system checkpoint'
snapshot, and the current qemu implementation is that the snapshot
creates internal snapshots in your qcow2 files. If you do 'qemu-img
info $path_to_img', you will see the disk snapshots listed as internal
snapshots for each image associated with the domain, as well as the
first qcow2 file also having memory associated with the internal snapshot.
>
>
> I found the xml files in /var/lib/libvirt/qemu/snapshot/, but hava no idea about the raw snapshot file.
Looking in /var/lib/libvirt is generally unsupported (that is an
internal libvirt detail, and subject to change in future releases). The
only way to safely look at the snapshot XML is via the API
(virDomainSnapshotGetXMLDesc, which is wrapped by 'virsh snapshot-dumpxml').
I am also hoping to submit a patch that will allow you the option to
create an external snapshot rather than using qcow2 internal snapshots,
but that's not in the code base yet.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
12 years, 6 months
[libvirt-users] qemu-img snapshots with backing stores?
by Sean Abbott
So, I was attempting to use qemu snapshots with backing stores. The
QEMU docs (http://wiki.qemu.org/Documentation/CreateSnapshot) make it
sound like you simply point your qemu at the snapshot after it's
creation, and you're golden.
When attempting this with libvirt, though, it fails.
I created a snapshot using the above tutorial. the resulting file is
disk.0, and a qmeu-img info on it returns:
image: disk.0
file format: qcow2
virtual size: 29G (31457280000 bytes)
disk size: 140K
cluster_size: 65536
backing file: /var/lib/one/public/lin_client_current.qcow2 (actual path:
/var/lib/one/public/lin_client_current.qcow2)
So that all looks groovy, right?
Then, I created (via opennebula) an xml deployment file like so:
http://paste.ubuntu.com/1027145/
When I attempt to do a virsh create, I get the following errors:
virsh # create deployment.0
error: Failed to create domain from deployment.0
error: internal error process exited while connecting to monitor:
file=/var/lib/one/vm/56/images/disk.0,if=none,id=drive-virtio-disk0,boot=on,format=qcow2,cache=none
qemu-kvm: boot=on|off is deprecated and will be ignored. Future versions
will reject this parameter. Please update your scripts.
qemu-system-x86_64: -drive
file=/var/lib/one/vm/56/images/disk.0,if=none,id=drive-virtio-disk0,boot=on,format=qcow2,cache=none,boot=on:
could not open disk image /var/lib/one/vm/56/images/disk.0: Invalid argument
So...something isn't working. Is it possible to do this, or should I
give up on this path?
Thanks!
sean
12 years, 6 months
[libvirt-users] The default location of vm snapshots
by SimpleCloud
Hi all,
Where could I find the memory dump and disk snapshots for vm after command "virsh snapshot-create <some_running_vm>"? Thanks in advance.
I found the xml files in /var/lib/libvirt/qemu/snapshot/, but hava no idea about the raw snapshot file.
Thanks,
Lei
12 years, 6 months
[libvirt-users] [Fwd: error: this function is not supported by the connection driver : virConnectNumOfStoragePool]
by Onkar
Hello All,
Any idea on this issue ?
Regards,
Onkar
-------- Forwarded Message --------
From: Onkar <kernzap(a)gmail.com>
To: libvir-list <libvir-list(a)redhat.com>
Subject: error: this function is not supported by the connection
driver : virConnectNumOfStoragePool
Date: Wed, 30 May 2012 21:29:42 +0530
Hello,
I configured libvirt like this
./configure --prefix=/ --exec-prefix=/usr/ --libdir=/usr/lib64/
--with-storage-dir --with-storage-dir --with-storage-dir
--with-storage-dir --with-storage-dir --with-storage-dir
--with-storage-dir --with-storage-dir --with-qemu --with-libvirtd
--with-selinux --with-network --with-libblkid
and then,
make -j4
make install
and then
# virsh list --all
Id Name State
----------------------------------------------------
- vm1 shut off
# virsh pool-list --all
error: Failed to list active pools
error: this function is not supported by the connection driver:
virConnectNumOfStoragePools
getting this error , any clues on why is this error ?
Regards,
Onkar
12 years, 6 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, 6 months
[libvirt-users] guest fails to start: Error initializing virtio-net-pci
by Ekkard Gerlach
Hi,
squeeze host, winxp guest. guest fails to start:
PCI: devfn 24 not available fpr virtio-net-pci, in use by virtio-blk-pci
Error initializing virtio-net-pci
xml-File:
========
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/winxp'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
this added:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/winxp-d'/>
<target dev='hdb' bus='virtio'/>
<address type='drive' controller='0' bus='0' unit='1'/>
</disk>
root@squeeze64:~# lsmod | grep virt
virtio_balloon 2961 0
virtio_net 10573 0
virtio_blk 4225 0
virtio_pci 5511 0
virtio_ring 3258 1 virtio_pci
virtio 3309 4 virtio_balloon,virtio_net,virtio_blk,virtio_pci
root@squeeze64:~# dpkg -l | egrep "kvm|qemu|virt"
ii etherboot-qemu 5.4.4-9 Bootstrapping for various network adapters (qemu)
ii gvfs 1.6.4-3 userspace virtual filesystem - server
ii kvm 1:0.12.5+dfsg-5+squeeze8 dummy transitional package from kvm to qemu-kvm
ii libvirt-bin 0.8.3-5+squeeze2 the programs for the libvirt library
ii libvirt0 0.8.3-5+squeeze2 library for interfacing with different virtualization
systems
ii python-libvirt 0.8.3-5+squeeze2 libvirt Python bindings
ii qemu 0.12.5+dfsg-3squeeze1 fast processor emulator
ii qemu-keymaps 0.12.5+dfsg-3squeeze1 QEMU keyboard maps
ii qemu-kvm 0.12.5+dfsg-5+squeeze8 Full virtualization on x86 hardware
ii qemu-system 0.12.5+dfsg-3squeeze1 QEMU full system emulation binaries
ii qemu-user 0.12.5+dfsg-3squeeze1 QEMU user mode emulation binaries
ii qemu-utils 0.12.5+dfsg-3squeeze1 QEMU utilities
ii virt-manager 0.8.4-8 desktop application for managing virtual machines
ii virt-viewer 0.2.1-1 Displaying the graphical console of a virtual machine
ii virtinst 0.500.3-2 Programs to create and clone virtual machines
I sucessfully added a virtio NIC:
<interface type='bridge'>
<mac address='52:54:00:a6:fb:ab'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
an I installed the driver from red hat "virtio-win-0.1-22.iso". But adding a virtio
disk fails.
any ideas?
Ekkard
12 years, 6 months
[libvirt-users] PCI Passthrough, AMD, fails to initialize
by Chris Sanders
I'm looking for assistance with pci-passthrough on CentOS 6.2.
I've installed libvirt version: 0.9.4, package: 23.el6_2.8 from yum.
I have a windows XP client setup via virt-manager which boots and runs fine
until I attempt to assign a PCI device to it.
The error log reads:
-----------------/var/log/libvirt/qemu/SageTv.log----------------
2012-06-02 22:55:07.801: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=spice
/usr/libexec/qemu-kvm -S -M rhel6.2.0 -cpu
Opteron_G3,+wdt,+skinit,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+pdpe1gb,+fxsr_opt,+mmxext,+aes,+sse4.2,+sse4.1,+ssse3,+ht,+vme
-enable-kvm -m 3048 -smp 2,sockets=2,cores=1,threads=1 -name SageTv -uuid
bf80f6a5-1471-9415-e502-88c4999319c7 -nodefconfig -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/SageTv.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc
base=localtime,driftfix=slew -no-shutdown -boot order=c,menu=on -device
virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive
file=/dev/vg_hdd/lv_sagetv,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0
-drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device
ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev
tap,fd=24,id=hostnet0,vhost=on,vhostfd=25 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:b9:bf:b0,bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -chardev
spicevmc,id=charchannel0,name=vdagent -device
virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0
-usb -device usb-tablet,id=input0 -spice
port=5900,addr=127.0.0.1,disable-ticketing -vga std -device
intel-hda,id=sound0,bus=pci.0,addr=0x4 -device
hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device
pci-assign,host=04:07.0,id=hostdev0,configfd=26,bus=pci.0,addr=0x8 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7
char device redirected to /dev/pts/1
do_spice_init: starting 0.8.3
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_PLAYBACK
spice_server_add_interface: SPICE_INTERFACE_RECORD
Failed to assign device "hostdev0" : Invalid argument
qemu-kvm: -device
pci-assign,host=04:07.0,id=hostdev0,configfd=26,bus=pci.0,addr=0x8: Device
'pci-assign' could not be initialized
2012-06-02 22:55:08.744: shutting down
-----------------/var/log/libvirt/qemu/SageTv.log----------------
After this I find the dmesg shows:
-----------------dmesg------------------
pci-stub 0000:04:07.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21
pci-stub 0000:04:07.0: restoring config space at offset 0x1 (was 0x2100000,
writing 0x2100002)
assign device 4:7.0 failed
-----------------dmesg------------------
In case this was an IRQ problem I checked my /proc/interrupts.
-----------------interrupts------------------
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5
CPU6 CPU7
0: 130 0 0 0 0 0
0 0 IO-APIC-edge timer
1: 0 0 1 1 0 0
0 0 IO-APIC-edge i8042
8: 0 1 0 0 0 0
0 0 IO-APIC-edge rtc0
9: 0 0 0 0 0 0
0 0 IO-APIC-fasteoi acpi
17: 0 0 0 0 0 0
0 0 IO-APIC-fasteoi ehci_hcd:usb1, ehci_hcd:usb2,
ehci_hcd:usb3
18: 0 0 0 0 0 0
0 0 IO-APIC-fasteoi ohci_hcd:usb4, ohci_hcd:usb5,
ohci_hcd:usb6, ohci_hcd:usb7
19: 587 2219 1807 588 602 600
687 607 IO-APIC-fasteoi ahci
21: 422 430 7316 402 410 405
429 412 IO-APIC-fasteoi
24: 0 0 0 0 0 0
0 0 PCI-MSI-edge AMD-Vi
25: 12 10 9 20 11 15
15 15 PCI-MSI-edge radeon
26: 7 8 7 10 9 8
10 9 PCI-MSI-edge hda_intel
27: 0 0 0 0 0 0
0 0 PCI-MSI-edge xhci_hcd
28: 7098 36221 19 24 19 20
28 20 PCI-MSI-edge eth0
NMI: 0 0 0 0 0 0
0 0 Non-maskable interrupts
LOC: 22088 22355 9472 12483 6371 11086
5211 7987 Local timer interrupts
SPU: 0 0 0 0 0 0
0 0 Spurious interrupts
PMI: 0 0 0 0 0 0
0 0 Performance monitoring interrupts
PND: 0 0 0 0 0 0
0 0 Performance pending work
RES: 61166 42503 6683 11920 2681 3534
4120 2460 Rescheduling interrupts
CAL: 197 302 301 303 290 300
314 318 Function call interrupts
TLB: 1406 1551 464 1749 350 897
485 563 TLB shootdowns
TRM: 0 0 0 0 0 0
0 0 Thermal event interrupts
THR: 0 0 0 0 0 0
0 0 Threshold APIC interrupts
MCE: 0 0 0 0 0 0
0 0 Machine check exceptions
MCP: 1 1 1 1 1 1
1 1 Machine check polls
ERR: 0
MIS: 0
-----------------interrupts------------------
To get to this point I've confirmed IOMMU is loading on boot. during boot
a grep for AMD-Vi returns:
-----------------AMD-Vi------------------
AMD-Vi: Enabling IOMMU at 0000:00:00.2 cap 0x40
AMD-Vi: Initialized for Passthrough Mode
AMD-Vi: Enabling IOMMU at 0000:00:00.2 cap 0x40
-----------------AMD-Vi------------------
I've set: allow_unsafe_assigned_interrupts.
I've set selinux to permissive
I've set user and group for qemu to 'root'
I've set clear_emulator_capabilites = 0
I've set relaxed_acs_check = 1
Finally, if there's a better forum to ask this question in please let me
know. I've already tried #kvm and #virt on IRC with no reply yet. I've
tried the CentOS 6.2 forums with no reply.
Thanks,
Chris
P.S. I didn't subscribe, just sent this email. If by some odd chance, I
can't see replies w/o subscribing someone please let me know.
(sanders.chris(a)gmail.com)
12 years, 6 months
[libvirt-users] Resize qcow2 disks
by Javi Legido
Good morning.
I already tried:
1. http://michael.orlitzky.com/articles/resizing_a_kvm_or_qemu_disk_image.php
Result: OS system can't see the disk space
sudo qemu-img resize /var/lib/libvirt/images/mysql-1.qcow2 +8G
ls -lath /var/lib/libvirt/images/mysql-1.qcow2
-rw------- 1 libvirt-qemu kvm 10G jun 1 15:35
/var/lib/libvirt/images/mysql-1.qcow2
# pvresize /dev/vda5
Physical volume "/dev/vda5" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
# lvextend -L8G /dev/template/root
Extending logical volume root to 8.00 GiB
Insufficient free space: 1630 extents needed, but only 0 available
2. http://blog.wpkg.org/2010/10/04/resizing-qcow2-images/
Result: OS system can't see the disk space
My 3rd option is to install libguestfs-tools package, but I would like
to avoid it since it's not part of Debian release.
Any good step by step guide to enlarge a qcow2 + LVM virtual disk?
Thanks
12 years, 6 months