[libvirt-users] First & long question
by Joaquim Barrera
Hello everybody!
/(First I need to apologize becase I mussunderstood the prupose of
libvirt-list and I sent this mail there instead of this list)/
I would like to introduce myself, as this is my first contact with
libvirt mailing list (although I've been reading quite a lot of
documentation).
My name is Joaquim Barrera, from Barcelona, Catalonia. I am a computer
engineer and recently I joined a research group here in the university.
My task is related to VM migration and management, and since then (a
couple of months) I've been trying to figure some things up.
Now I need to go one step forward, and I would like to set up a nice dev
environment to try some modifications we want to make to libvirt, such
as new API or migration-related-stuff.
Although I am familiar with linux environrment and programming, I am not
really quite familiar with this kind of, may I say, professional
development, and there are some issues I need to solve before start
writting code. Some of this issues you'll find not relevant or newbie
stuff, but I assure you I tried lots of times before coming here. :-)
Here is what I got following the instructions in
http://libvirt.org/compiling.html
$ ./autogen.sh --system
$ make
After make finishes I have compiled 1.2.0 libvirt in the source tree,
and if I execute 'sudo ./run tools/virsh version' I get a this answer:
/Compiled against library: libvirt 1.2.0//
//Using library: libvirt 1.2.0//
//Using API: QEMU 1.2.0//
//Running hypervisor: QEMU 1.5.0/
(/note that now I need to run virsh with sudo, I don't know exactly why/)
So far, so good. I guess that, with --system flag, 1.2.0 custom libvirt
uses config files from standard directories such as
/etc/libvirt/libvirtd.conf, and if I used a custom directory instead, I
would have to redefine my VMs, am I right?
Problems come when I want to use custom 1.2.0 daemon. If I execute "sudo
service libvirt-bin stop" followed by "./daemon/libvirtd -d", then
custom virsh gives me this error:
/error: failed to connect to the hypervisor//
//error: no valid connection//
//error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No
such file or directory/
And I need to kill custom daemon and restart 1.1.1 libvirtd to recover
from this. Any advice?
Finally (sorry about this large mail), there is one thing that does
bother me quite a lot.
Using custom virsh, command history seems to vanish, as I press Arrow-UP
and I get "^[[A" in the screen, instead of last command used. Tell me,
please, that this is just some silly config I need to adjust... :_(
The final comment is, am I following the right direction to be able to
develop something with libvirt? :_)
Ok, that's all for now, thank you A LOT for your time.
Joaquim.
10 years, 8 months
[libvirt-users] centos6 "system checkpoint"
by Ask Stack
Hello
###
http://www.redhat.com/archives/libvir-list/2012-July/msg00782.htm
"it almost sounds like you want the convenience of a
system checkpoint (the ability to revert to a guest with its RAM state
unchanged, which is much faster than booting from just disk state)."
###
I am trying to figure out if it is possible to take a snapshot or "system checkpoint" for a VM running on a centos 6 host. I am able to take a snapshot but unable to revert. Force revert will cause the VM to become unresponsive. Nothing would show in console after revert.
My host OS environment is
CentOS release 6.4 (Final)
libvirt-0.10.2-29
qemu-kvm-0.12.1.2-2.415
virsh # suspend combo01
Domain combo01 suspended
virsh # snapshot-create-as --domain combo01 combo01-snap1 "snap1-desc" --atomic
Domain snapshot combo01-snap1 created
virsh # snapshot-list combo01
Name Creation Time State
------------------------------------------------------------
combo01-snap1 2013-12-14 20:57:41 +0000 paused
virsh # snapshot-revert combo01 combo01-snap1
error: revert requires force: Target device address type none does not match source pci
virsh # snapshot-revert combo01 combo01-snap1 --force
virsh # list
Id Name State
----------------------------------------------------
8 combo01 paused
virsh # resume combo01
Domain combo01 resumed
virsh # console combo01
Connected to domain combo01
Escape character is ^]
The VM became unresponsive at this point.
10 years, 9 months
[libvirt-users] virsh attach makes qcow2 format disk to raw format
by lyz_pro@163.com
Hi all
I have a problem when I use `virsh attach` to attach a qcow2 disk to vm without argument --subdirver=qcow2
and this makes the qcow2 disk become a raw format disk, and the data in this disk is missing in guest os
and also I have used guestmout to confirm this, the same result.
Is there any way to let me find back the data in this disk ?
the version of libvirt and kvm is :
Compiled against library: libvir 0.9.8
Using library: libvir 0.9.8
Using API: QEMU 0.9.8
Running hypervisor: QEMU 1.0.0
Best Regards
Li Yuezhou
10 years, 9 months
[libvirt-users] SAS HBA address and SCSI passthrough
by Corinna Vinschen
Hi,
For some time now (starting with the 3.10 or 3.11 kernels, but I'm not
sure) I have the following problem:
I have a machine with 6 SATA slots and two SAS controllers, one onboard
HBA and one RAID controller in a PCIe slot. The problem is that the
order of the SAS controllers changes randomly after a reboot, so the
SCSI addresses of the devices change. One time lsscsi prints (empty
lines and ellipsis added for clarity):
$ lsscsi
[0:0:0:0] disk ATA INTEL SSDSC2BA20 5DV1 /dev/sda
[6:0:0:0] disk SmrtStor TXA2D20200GA6001 KT00 /dev/sdb
[...]
[6:0:7:0] tape TANDBERG LTO-4 HH U619 /dev/st0
[6:0:8:0] enclosu Intel RES2SV240 0d00 -
[7:0:0:0] disk LSI 9750-8i DISK 5.12 /dev/sdh
[7:0:2:0] disk LSI 9750-8i DISK 5.12 /dev/sdi
After the next reboot it looks like this:
$ lsscsi
[0:0:0:0] disk ATA INTEL SSDSC2BA20 5DV1 /dev/sda
[6:0:0:0] disk LSI 9750-8i DISK 5.12 /dev/sdb
[6:0:2:0] disk LSI 9750-8i DISK 5.12 /dev/sdc
[8:0:0:0] disk SmrtStor TXA2D20200GA6001 KT00 /dev/sdd
[...]
[8:0:7:0] tape TANDBERG LTO-4 HH U619 /dev/st0
[8:0:8:0] enclosu Intel RES2SV240 0d00 -
That's really a problem. One of them, not so much a libvirt problem, is
the fact that existing command line tools to maintain HBAs and RAID
controllers access controller and devices via the host address.
The other problem is with libvirt. If you want to access an arbitrary
SAS device from a VM, you have to specify the address of the device as
SCSI address. Consider this case in a VM xml file to attach to the
host's tape drive:
<hostdev mode='subsystem' type='scsi' managed='no' sgio='unfiltered'>
<source>
<adapter name='scsi_host6'/>
<address bus='0' target='7' unit='0'/>
</source>
</hostdev>
With the current behaviour of the kernel, this will be broken in all
setups with multiple controllers. If the host adapter address changes
arbitrarily after a reboot, the VM will have a broken link to the SCSI
device. In the worst case, it will access another device connected to
another controller and data on that other device may be destroyed.
I asked elsewhere how to fix the order of the SAS controllers, but the
only information I got was that it's apparently a deliberate choice to
initialize HW in parallel, because the OS doesn't care for the order,
and thus, the host address of the controllers.
Sure, I can create a wrapper script and systemd foo to workaround this
issue by creating the xml file content on the fly after a reboot, but,
honestly, that can't be a *solution* for this behaviour.
As far as I can see, it's kind of impossible to stick to the SCSI
address for SCSI devices in the VM XML description. If the VM setup
should survive a reboot in a multi-HBA environment, it's necessary to
use unambiguous OS device names, like the udev entries under /dev/disk
and /dev/tape(*).
Is that already possible, or is there some work in progress? Or *is*
there some way to make sure that the SAS controllers always have the
same host bus address after reboot so libvirt doesn't get into trouble?
Thanks,
Corinna
(*) But then again, assuming I want to import the enclosure at SCSI
address [X:0:8:0] into a VM? /dev/sg9? But, no, this isn't
unambiguous either. So... what?
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
10 years, 9 months
[libvirt-users] internal error: unexcepted domain type lxc, excepted one of these: qemu, kqemu, kvm, xen
by Florian Klink
Hi,
I'm not able to create lxc domains anymore with libvirt 1.2.0-1.
The current arch linux package is affected by this bug:
https://bugs.archlinux.org/task/38007).
vm.xml:
<domain type="lxc">
<name>test</name>
<memory unit="GiB">2</memory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<devices>
<filesystem type="mount">
<source dir="/var/lib/libvirt/filesysystems/test"/>
<target dir="/"/>
</filesystem>
<interface type="network">
<source network="default"/>
</interface>
<console type="pty"/>
</devices>
</domain>
# virsh create vm.xml
error: Failed to create domain from vm.xml
error: internal error: unexcepted domain type lxc, excepted one of
these: qemu, kqemu, kvm, xen
However, ./configure reports that LXC support is compiled in:
configure: Drivers
configure:
configure: Xen: no
configure: QEMU: yes
configure: UML: yes
configure: OpenVZ: yes
configure: VMware: yes
configure: VBox: yes
configure: XenAPI: no
configure: xenlight: no
configure: LXC: yes
configure: PHYP: yes
configure: ESX: yes
configure: Hyper-V: no
configure: Parallels: no
configure: Test: yes
configure: Remote: yes
configure: Network: yes
configure: Libvirtd: yes
configure: Interface: yes
configure: macvtap: yes
configure: virtport: yes
configure:
configure: Storage Drivers
configure:
configure: Dir: yes
configure: FS: yes
configure: NetFS: yes
configure: LVM: yes
configure: iSCSI: no
configure: SCSI: yes
configure: mpath: yes
configure: Disk: yes
configure: RBD: no
configure: Sheepdog: no
configure: Gluster: no
Do you have any idea why it does not work anymore? I don't see any new
changes in src/conf/domain_conf.c where the error is thrown (line 10960)
on current git HEAD...
Florian
10 years, 9 months
[libvirt-users] guest daemon reading kvmclock - is it not needed or bad idea ?
by Edoardo Comar
Hi
(apologies for the previous post in html - was scrubbed in the list
digest)
I've dug various posts and articles on host-guest time synchronization.
I could not conclude why it might be better to use ntpd in a guest rather
than a daemon that reads from kvmclock
and having NTP running on the host only
(assuming the guest OS is a recent linux and so the clock source is set to
the paravirtualized kvm PVclock).
any clarifications are welcome, thanks!
Edoardo Comar
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
10 years, 9 months
[libvirt-users] assign static public IP to container
by scar
hello i have a server colocated in a datacenter with several external IP
addresses available to use. the physical server is using one of these
IPs, and i want to assign another, unused IP to the virtual machine.
both the host and guest are running ubuntu server 12.04. i found
someone else asking the same thing[1] for CentOS, but i already have a
bridge setup so not sure if it pertains... either way the instructions
provided are for a different OS. i followed these instructions[2] for
setting up my bridge.
anyway, i thought i could just do this by editing the container's
/etc/network/interfaces, setting a static IP address for eth0 much like
i did for br0 on the host machine.... but doesn't seem to be working.
ifconfig shows eth0 has the public address but i can't resolve any
hostnames nor telnet to a direct IP address (no route to host). if i
change back to dhcp and let eth0 get a private address, i can at least
access the internet but cannot access the virtual machine from the
internet. what is the trick to giving a VM a routable, public IP
address? thanks
1. https://www.redhat.com/archives/libvirt-users/2011-December/msg00056.html
2.
https://help.ubuntu.com/12.04/serverguide/network-configuration.html#brid...
10 years, 9 months