Subject: Re: [Fedora-xen] How to backup a Domu filesystem (on LVM) from Dom0 on Fedora 8 ?
by Henok Mikre
This helped me a great deal. Thanks. I just have a few questions...
1) is it best to unmount the /mnt/lvfoo/ before or after kpartx -d?
because you have it in your procedure list both before and after
kpartx -d.
2) is it possible to explore this dump file by either mounting it or
some other method?
3) what is the best procedure to replace this dump file in case of a
disk failure? i.e. just install xen and use virt-install?
4) is this the best possible method of backing up a domU?
Thanks.
Gerd Hoffmann wrote:
Anne Facq wrote:
Because in Dom0 the device for a paravirt Domu (/dev/vg00/lvfoo in my
case) is mapped to a virtual disk /dev/xvda (I created the Domu with
virt-install), and the only way I found to mount this Domu filesystem,
is to :
- get the size of the boot sector of /dev/vg00/lvfoo
(with fdisk -ul /dev/vg00/lvfoo)
= 63
- compute the offset (multiply by block size)
- specify this offset to the mount command :
mount -o offset=32256 /dev/vg00/lvfoo /mnt/
Uh, oh, quite complicated and error prone. Can be done much easier.
Option (1): Use kpartx, it will create device mapper mappings for your
partitions. Try "kpartx -v -a /dev/vg00/lvfoo", should give you
/dev/vg00/lvfoop[1234]. "kpartx -d ... " removes the mappings.
Option (2): (works only with xen kernel): Configure the device as
virtual disk *in Domain-0*: "xm block-attach 0 phy:/dev/vg00/lvfoo xvda
w". Gives you /dev/xvda[1234]. "xm block-detach ..." removes it.
Many thanks for this solution, it helps me a lot.
If this can help someone, here are the steps to backup a Domu (filesystem on
LVM in backend and on xvda in frontend) with the dump command from Dom0
(Fedora 8), using one of the 2 solutions you advised, kpartx :
----------------------------------------------------------------
# The DomU named "foo" must be stopped before dump
xm shutdown -w foo
# Creates device mapper mappings /dev/mapper/lvfoop[1234] for /dev/vg00/lvfoo
kpartx -v -a /dev/vg00/lvfoo
# Mounts temporarly the filesystem to backup
mount /dev/mapper/lvfoop1 /mnt/lvfoo/
# Launches the dump
/sbin/dump 0 -L FULL_foo -f /BACKUP-XEN/foo.colddump /mnt/lvfoo/
# Umount the filesystem
umount /mnt/lvfoo/
# Removes the mappings
kpartx -d /dev/vg00/lvfoo
# Unmount the filesystem
umount /mnt/lvfoo
# The DomU can now be restarted
xm create --config /var/lib/xend/....
----------------------------------------------------------------
Regards,
Anne Facq
15 years, 11 months
Compiling xen from source: mkinitrd error: No module ehci-hcd
by Henok Mikre
Hi,
I was trying to compile a xen kernel from source and I am having the
following errors:
[root@machine xen-3.0.4-testing.hg]# mkinitrd -v -f --with=sd_mod
--with=scsi_mod /boot/initrd-2.6.16.38-xen0.img 2.6.16.38-xen0
Creating initramfs
Looking for deps of module ehci-hcd
No module ehci-hcd found for kernel 2.6.16.38-xen0, aborting.
Any thoughts?
15 years, 11 months
Unable to install domU on Fedora 8
by Pete Kay
Hi,
When trying to install Cent domU on fedora 8 dom0, I am getting the
following error. I have tried both graphics support Yes and No
[root@bogon pete]# virt-install
What is the name of your virtual machine? serverA
How much RAM should be allocated (in megabytes)? 256
What would you like to use as the disk (file path)? /dev/serverA
Would you like to enable graphics support? (yes or no) no
What is the install location?
http://mirror.centos.org/centos-5/5/os/x86_64/
Starting install...
libvir: Xen Daemon error : GET operation failed:
Retrieving file CentOS... 590 kB 00:26
Retrieving file vmlinuz.. 100% |=========================| 1.8 MB
01:10
Retrieving file initrd.im 100% |=========================| 5.2 MB
03:17
libvir: Xen Daemon error : GET operation failed:
libvir: Xen Daemon error : POST operation failed: (xend.err 'Device 51712
(vbd) could not be connected. losetup /dev/loop0 /dev/serverA failed')
virDomainCreateLinux() failed POST operation failed: (xend.err 'Device 51712
(vbd) could not be connected. losetup /dev/loop0 /dev/serverA failed')
Domain installation may not have been
successful. If it was, you can restart your domain
by running 'virsh start serverA'; otherwise, please
restart your installation.
Thu, 05 Jun 2008 03:09:50 ERROR virDomainCreateLinux() failed POST
operation failed: (xend.err 'Device 51712 (vbd) could not be connected.
losetup /dev/loop0 /dev/serverA failed')
Traceback (most recent call last):
File "/usr/bin/virt-install", line 502, in <module>
main()
File "/usr/bin/virt-install", line 462, in main
dom = guest.start_install(conscb,progresscb)
File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 813, in
start_install
return self._do_install(consolecb, meter)
File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 834, in
_do_install
self.domain = self.conn.createLinux(install_xml, 0)
File "/usr/lib64/python2.5/site-packages/libvirt.py", line 573, in
createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed',
conn=self)
libvirtError: virDomainCreateLinux() failed POST operation failed: (xend.err
'Device 51712 (vbd) could not be connected. losetup /dev/loop0 /dev/serverA
failed')
[root@bogon pete]#
I would appreciate any help on getting xen to work.
Thanks,
Pete
15 years, 11 months
ANNOUNCE: virt-mem: tools for monitoring virtual machines
by Richard W.M. Jones
I'm pleased to announce this very early pre-alpha release of a further
set of tools for monitoring virtual machines.
The idea is to provide simple commands which can be run outside the
virtual machine to monitor its status. These commands don't require
you to log in to the virtual machine, or to install any software,
since they work entirely by snooping. So they could be very useful
for analyzing guests which are stuck / unresponsive / heavily loaded.
Done so far:
virt-uname like uname(1), print guest's system information
virt-dmesg like dmesg(1), print guest's kernel messages
Coming soon:
virt-ps like ps(1), lists processes
virt-free like free(1), lists free memory and swap
If virt-ps works out, I might do a 'top'-like command, although of
course I can't call it virt-top. I'm open to other suggestions too.
Home page: http://et.redhat.com/~rjones/virt-mem/
Source: http://hg.et.redhat.com/virt/applications/virt-mem--devel
****NOTE****
These require a (forthcoming) patch to libvirt to snoop on virtual
machines' memory. At the moment you can run them by using the QEMU
memsave command to snapshot kernel memory to a file, and then run the
program on the file. The snapshot process is described here:
http://felinemenace.org/~andrewg/MikroTik_Router_Security_Analysis_Part2/
Support for Xen is still under investigation, but we believe it should
be possible.
Example:
(qemu) memsave 3222274048 15728640 snap.mem
$ virt-uname -A i386 -T i386 -t ~/snap.mem
/home/rjones/snap.mem: Linux localhost.localdomain 2.6.24-0.155.rc7.git6.fc9 #1 SMP Tue Jan 15 17:52:31 EST 2008 i686 (none)
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
15 years, 11 months