[libvirt-users] Custom Live Migration Query
by Aaron Clausen
I'm using KVM, libvirt and DRBD to come up with a custom mirroring and
live migration setup.
I have two servers, each running KVM and libvirt, and both using DRBD
to mirror guests (which are stored on raw DRBD partitions). If I shut
down a guest on one, I can easily get it up and running on the other
without issue.
I have run into some file system corruption trouble if I try to do a
live migration. I have a test script just to test out the bare
functionality I'm looking for (this script would run on the second KVM
server; kvmserv02):
#!/bin/sh
if virsh -c qemu+ssh://kvmserv01/system list | grep -q " guest "; then
echo "Saving state on remote server..."
if ! virsh -c qemu+ssh://kvmserv01/system save guest --running
~/guest.save; then
echo "Could not save state of guest"
exit 1
fi
echo "Setting remote drbd node to secondary..."
if ! ssh root@kvmserv01 "drbdadm secondary guest"; then
echo "Could not change remote host to secondary for guest's DRBD partition"
exit 1
fi
sleep 5
echo "Setting local drbd node to primary..."
if ! drbdadm primary guest; then
echo "Could not change this host to primary for guest's DRBD partition"
exit 1
fi
sleep 5
echo "Restoring state on local server..."
if ! virsh restore ~/guest.save --running; then
echo "Could not restore guest state"
exit 1
fi
echo "Deleting state file on local server..."
rm -f ~/guest.save
else
echo 'guest not running on this host'
fi
# End of script
While the state is restored and the guest comes up on the second
server, I end up with filesystem corruptions. My first test guest had
its file system pretty heavily damaged after a few moves back and
forth.
What am I missing here? Or is this just simply a really horrible way to do it?
--
Aaron Clausen
mightymartianca(a)gmail.com
11 years, 4 months
[libvirt-users] Libvirt and Glusterfs
by Olivier Mauras
Hi,
I'm trying to use qemu native glusterfs integration with
libvirt. It's all working well from the qemu side, but libvirt fails to
start a domain with a gluster drive or attach a drive.
I have exactly
the same error as this person:
https://www.redhat.com/archives/libvirt-users/2013-April/msg00204.html
[1]
I use qemu 1.5.1 with glusterfs 3.4 beta 4 and libvirt
1.0.6.
[root@bbox ~]# virsh start test
error: Failed to start domain
test
error: internal error process exited while connecting to monitor:
char device redirected to /dev/pts/3 (label
charserial0)
qemu-system-x86_64: -drive
file=gluster://127.0.0.1/vol0/test0.img,if=none,id=drive-virtio-disk1,format=raw:
Gluster connection failed for server=127.0.0.1 port=0 volume=vol0
image=test0.img transport=tcp
qemu-system-x86_64: -drive
file=gluster://127.0.0.1/vol0/test0.img,if=none,id=drive-virtio-disk1,format=raw:
could not open disk image gluster://127.0.0.1/vol0/test0.img: No data
available
Using this command to run qemu directly works like a
charm:
[root@bbox ~]# qemu-system-x86_64 -name test -machine
pc-i440fx-1.5,accel=kvm,usb=off -m 8G -smp 1,maxcpus=4 -drive
file=/pool/st01/test_1.img,if=none,id=drive-virtio-disk0,format=raw
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-drive
file=gluster://127.0.0.1/vol0/test0.img,if=none,id=drive-virtio-disk1,format=raw
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
-vnc 127.0.0.1:0 -vga cirrus -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -monitor stdio -qmp
unix:/tmp/qmp-sock,server,nowait
Image has been created using
qemu-img.
[root@bbox ~]# qemu-img info
gluster://127.0.0.1/vol0/test0.img
image:
gluster://127.0.0.1/vol0/test0.img
file format: raw
virtual size: 10G
(10737418240 bytes)
disk size: 341K
Everything is run as root, libvirtd
daemon as well. Running libvirtd in debug mode doesn't seem to log more
relevant informations than the virsh error.
Has anyone been able to use
glusterfs disks with livbirt ??
Any help appreciated,
-O.
Links:
------
[1]
https://www.redhat.com/archives/libvirt-users/2013-April/msg00204.html
11 years, 4 months
[libvirt-users] libvirt & virtio_net - host.freeze@reset.domain
by poma
Hello people,
libvirtd (libvirt) 1.0.5.2
virsh 1.0.5.2
virt-manager 0.10.0
Host:
Linux localhost 3.9.8-300.fc19.x86_64 #1 SMP Thu Jun 27 19:24:23 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux
Guest1:
Linux localhost 3.9.8-300.fc19.i686.PAE #1 SMP Thu Jun 27 19:29:30 UTC
2013 i686 (none)
Guest2:
Linux localhost 3.9.8-300.fc19.x86_64 #1 SMP Thu Jun 27 19:24:23 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux
Virtual NIC - source & model:
macvtap/NAT/bridge & virtio(virtio_net)
Host freeze at "virsh reset <domain>" or "virt-manager - Force Reset"
Need kernel.sysrq or power reset.
poma
11 years, 4 months
[libvirt-users] Libvirt, virtmanager & Windows 7 installation partition
by Roland Giesler
I need to use an existing windows 7 installation in a virtual machine
form a libvirt host running Ubuntu 12.10.
Windows 7 installs on two partitions. There a 100MB boot partitiona
and then the main partition for the installation.
If I boot the laptop (which dual boots), I can select Windows 7 and
boot it just fine, or alternative Ubuntu.
If I select /dev/sda1 in the virtmanager as the source path I can see
dis activity, but in the VM window the "booting from hard disk..."
text never does away.
If I select /dev/sda2 (where the windows installation resides (and
which is not marked as bootable), I get a boot failure right away.
Here is what /var/log/syslog has:
Jul 4 22:11:02 Matt-HP ntfs-3g[8385]: Version 2012.1.15AR.5 external FUSE 29
Jul 4 22:11:02 Matt-HP ntfs-3g[8385]: Mounted /dev/sda2 (Read-Write,
label "", NTFS 3.1)
Jul 4 22:11:02 Matt-HP ntfs-3g[8385]: Cmdline options:
rw,nosuid,nodev,uhelper=udisks2,uid=1001,gid=1001,dmask=0077,fmask=0177
Jul 4 22:11:02 Matt-HP ntfs-3g[8385]: Mount options:
rw,nosuid,nodev,uhelper=udisks2,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sda2,blkdev,blksize=4096
Jul 4 22:11:02 Matt-HP ntfs-3g[8385]: Global ownership and
permissions enforced, configuration type 7
Jul 4 22:11:02 Matt-HP udisksd[2569]: Mounted /dev/sda2 at
/media/roland/BE26AE8326AE3C71 on behalf of uid 1001
Jul 4 22:12:31 Matt-HP kernel: [15366.356259] audit_printk_skb: 48
callbacks suppressed
Jul 4 22:12:31 Matt-HP kernel: [15366.356265] type=1400
audit(1372968751.291:34): apparmor="STATUS" operation="profile_load"
name="libvirt-c6a90ff5-9849-2ec5-fc8e-a331b144ceff" pid=8540
comm="apparmor_parser"
Jul 4 22:12:31 Matt-HP kernel: [15366.584252] device vnet0 entered
promiscuous mode
Jul 4 22:12:31 Matt-HP kernel: [15366.588663] virbr0: topology change
detected, propagating
Jul 4 22:12:31 Matt-HP kernel: [15366.588669] virbr0: port 1(vnet0)
entered forwarding state
Jul 4 22:12:31 Matt-HP kernel: [15366.588685] virbr0: port 1(vnet0)
entered forwarding state
Jul 4 22:12:31 Matt-HP kernel: [15366.588963] IPv6:
ADDRCONF(NETDEV_CHANGE): virbr0: link becomes ready
Jul 4 22:12:31 Matt-HP NetworkManager[986]: SCPlugin-Ifupdown:
devices added (path: /sys/devices/virtual/net/vnet0, iface: vnet0)
Jul 4 22:12:31 Matt-HP NetworkManager[986]: SCPlugin-Ifupdown:
device added (path: /sys/devices/virtual/net/vnet0, iface: vnet0): no
ifupdown configuration found.
Jul 4 22:12:32 Matt-HP NetworkManager[986]: <warn>
/sys/devices/virtual/net/vnet0: couldn't determine device driver;
ignoring...
Jul 4 22:12:33 Matt-HP avahi-daemon[935]: Joining mDNS multicast
group on interface vnet0.IPv6 with address fe80::fc54:ff:fe8a:8f93.
Jul 4 22:12:33 Matt-HP avahi-daemon[935]: New relevant interface
vnet0.IPv6 for mDNS.
Jul 4 22:12:33 Matt-HP avahi-daemon[935]: Registering new address
record for fe80::fc54:ff:fe8a:8f93 on vnet0.*.
Is there anything that I can learn from this log? What could I do to
make this work. Dual booting it not an option in this case.
regards
Roland Giesler
+27 (0)72-450-2817
http://www.giesler.za.net
Disclaimer: The sender invokes the rule of "exemptus responsibilitus"
pertaining to caffeine soluted inductions and/or decantations thereof
into tactile communication interfaces and alternative apparatuses with
respect to personal computation devices or otherwise implementations
of electronic and/or bionic devices. This impartation is intended for
the addressed party, unless conditions contrary to the aforementioned
exist, in which case it is pertinent. Reduce without further ado to
nothingness said impartation; alternatively "refrain from traversing
the point of origination, be not enriched by 200 Randus and proceed
without delay to enjailment".
11 years, 4 months
[libvirt-users] access remote libvirtd fail
by yd c
I want to manage remote libvirt , have run libvirtd in the dest host :
[root@dest_host ~]# ps aux | grep libvirtd
root 3293 0.0 0.1 923796 5856 ? Sl 12:59 0:00 libvirtd
--daemon
then I use the command in source host :
1. [root@source_host ~]# ssh -l root 211.87.***.97 ## login
the dest host
2. [root@dest_host ~]# virsh -c qemu+ssh://127.0.0.1/system list --all
# query vm status
output:
Id Name State
----------------------------------------------------
- ubuntu shut off
- vdisk shut off
also I use the command in source host
1. [root@source_host ~]# ssh -l root 211.87.***.97 ## login the dest
host
2. [root@dest_host ~]# virsh -c qemu+ssh://211.87.***.97/system list
--all ### query vm status
output:
Id Name State
----------------------------------------------------
- ubuntu shut off
- vdisk shut off
however , in the source host , execute the command :
1. [root@source_host ~]# virsh -c qemu+ssh://211.87.228.97/system list
--all ### query vm status
output:
error: failed to connect to the hypervisor
error: no valid connection
error: End of file while reading data: : Input/output error
I have referred to
http://wiki.libvirt.org/page/Failed_to_connect_to_the_hypervisor#Other_er... ,
http://wiki.libvirt.org/page/SSHSetup and
http://wiki.libvirt.org/page/SSHPolicyKitSetup .
All of them don't work.
how should I do ? Help .
11 years, 4 months
[libvirt-users] best way to provide disk storage for vm without shared storage system
by Vasiliy Tolstov
Hello. I'm very happy with libvirt and qemu, that great software!
(after some playing i want to create golang bindings to libvirt)..
Now i provide ext4 fs for qcow2 images (raid1 with two sata disks).
Now i don't need live migration (but may need it in feature).
What is the best way to provide disks to vm in case of performance,
ability to create backups (i don't want lvm snapshots)?
As i search from google more speed can take physical storage - lvm.
But may be QED or FVD can provide near lvm performance to me?
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
jabber: vase(a)selfip.ru
11 years, 4 months
[libvirt-users] F19 and virt-install
by Jay Vyas
Hi libvirt:
--------
My "short" question is - is there a recipe for installing F19 100%
automatically with static IPs? I'm using a combination of url based
install with a kickstart script pasted to a gist in order to bootstrap the
entire thing.
It **used** to work (fedora16), but recently stopped.
-------
Note : Right now Im not using the os-variant switch because fedora17+ arent
listed as OS variant's in my version of virt-install. That in and of
itself could be the problem -- any way to update virt-install's os-variant
list?
------
With Fedora 16, I found that the url based install failed due to a corrupt
rpm. I assume this is just because f16 isn't supported anymore so errors
on the web site for it are not being fixed.
With Fedora 18/19/... Im finding other types of errors related to missing
downloaded components when the bootstrapping virt-install starts. In
particular, a 404 (not found) error when fetching " product.img " from the
OS url. Details below.
<note, any insights into things I may be missing due to ignorance would
also be appreciated here>
--------
With Fedora 18:
I've noticed that libvirt gives me some errors with the new generation of
fedora formatted os's source directories. It looks for a file
"product.img", which (I beleive) doesnt exist in fedora17+.
In particular, it is looking for the "product.img" file, under
http://redhat.download.fedoraproject.org/pub/fedora/linux/releases/19/Fed...
.
virt-install --hvm --name f18x86_64a --ram 1024 --file
/var/lib/libvirt/images/f18x86_64a.img,size=20 --location
http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/...
20 -x "ks=<url_to_kickstart_file>"
-------
Running "virt-install list", it seems that the only fedoras known to
virt-install are up to fedora16:
fedora16 : Fedora 16
fedora15 : Fedora 15
fedora14 : Fedora 14
fedora13 : Fedora 13
fedora12 : Fedora 12
fedora11 : Fedora 11
fedora10 : Fedora 10
fedora9 : Fedora 9
fedora8 : Fedora 8
fedora7 : Fedora 7
fedora6 : Fedora Core 6
fedora5 : Fedora Core 5
-------
Do I need to update virt-install in order to install F17+ from source? How
is the os-variant used? Im assuming maybe os-variant needs to be updated
somehow in order for the virt-install command to behave correctly.
--
Jay Vyas
http://jayunit100.blogspot.com
11 years, 4 months
[libvirt-users] VM destroy faiing in 1.0.1
by Chandrashekhar Jamadarkhani (cjamadar)
Hi,
Virsh destroy is always failing with below error.
[host:~]$ virsh destroy XYZ--2
error: Failed to destroy domain XYZ--2
error: Requested operation is not valid: domain is not running
[host:~]$ virsh list --all
Id Name State
----------------------------------------------------
- XYZ--2 shut off
[host:~]$
host:~]$ libvirtd --version
libvirtd (libvirt) 1.0.1
[host:~]$
host:~]$ virsh version
Compiled against library: libvirt 1.0.1
Using library: libvirt 1.0.1
Using API: QEMU 1.0.1
Running hypervisor: QEMU 0.13.0
[host:~]$
same VM was working with older libvirt vrsion:
[host:~]$ virsh version
Compiled against library: libvir 0.8.7
Using library: libvir 0.8.7
Using API: QEMU 0.8.7
Running hypervisor: QEMU 0.13.0
[host:~]$
when we upgrade to latest libvirt version:1.0.1, VM destroy is failing.
Appreciate your help on this.
Thanks,
Chandrashekhar
11 years, 4 months
[libvirt-users] fsck and guest images
by Jamie Fargen
Hey!
I have some RHEL6 hypervisors and the VMs are in raw qemu image files in a
local raid array linux raid + lvm + ext3. When a kernel update is installed
a reboot is necessary, usually it has been more than 180 days since the
last reboot and the file system is fsck'd and this takes 2-3 hours.
I am curious to know if there is any documentation that addresses the pro's
and con's of fsck'ing the volume containing /var/lib/libvirt/images.
Could fsck make a change to the underlying file system that the guest
images are stored on, which the guest operating system may not be able to
handle when it runs its own file system maintenance, i.e. fsck or chkdsk.
Is file system maintenance on the hypervisor volume storing the VM images
redundant to the VM's own file system consistancy utilities.
Regards,
Jamie Ian Fargen
11 years, 4 months
Re: [libvirt-users] backup procedure using blockcopy
by Thomas Stein
> virsh dumpxml --security-info dom > dom.xml
> virsh undefine dom
Hello.
Someone was talking about this (undefining the VM) would not be
neccessary anymore when qemu-1.5 has been released. Is that true?
> virsh blockcopy dom vda /path/to/backup-vda
> polling loop - check periodically until 'virsh blockjob dom vda'
> shows 100% completion
> virsh suspend dom
> virsh save dom /path/to/memory-backup --running
This does not work for me.
hn ~ # virsh blockjob gentoo-template vda
Block Copy: [100 %]
hn ~ # virsh save gentoo-template
/opt/virt-backup-blockcopy/gentoo-template/gentoo-template-memory-backup
--running
error: Failed to save domain gentoo-template to
/opt/virt-backup-blockcopy/gentoo-template/gentoo-template-memory-backup
error: Requested operation is not valid: domain has an active block job
Obviously i can not save while the blockjob is running.
cheers
t.
11 years, 4 months