Hi guys, I need to move an lvm based domU from one dom0 to another dom0. How do you guys do ths? xm save/restore doesnt have the option to specify lvm target as the storage. Thanks Chris _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Nov-10 08:22 UTC
Re: [Xen-users] Move domU lvm based to another dom0
On Mon, Nov 9, 2009 at 11:56 PM, Cristian Rojas <intipu@googlemail.com> wrote:> Hi guys, I need to move an lvm based domU from one dom0 to another dom0. > > How do you guys do ths?- shutdown domU - copy xen config file - copy LVM storage - startup domU on new dom0 -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks Fajar, how do you normally copy the LVM storage to another dom0? Chris -------------------------------------------------- From: "Fajar A. Nugraha" <fajar@fajar.net> Sent: Tuesday, November 10, 2009 5:22 AM To: "Cristian Rojas" <intipu@googlemail.com> Cc: "xen" <xen-users@lists.xensource.com> Subject: Re: [Xen-users] Move domU lvm based to another dom0> On Mon, Nov 9, 2009 at 11:56 PM, Cristian Rojas <intipu@googlemail.com> > wrote: >> Hi guys, I need to move an lvm based domU from one dom0 to another dom0. >> >> How do you guys do ths? > > - shutdown domU > - copy xen config file > - copy LVM storage > - startup domU on new dom0 > > -- > Fajar >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hello, I was running some xen servers and when I had to move a VM from another server i use "dd + gzip, sftp, gzip + dd" to copy the LVM partition to the other machine. Move the VM configuration file on the new server and "xm new xxx" + "xm start xxx", then delete the machine on the old server. I used the same method to clone VMs. Later we do acquire a SAN and the "migration" was straightforward. Regards Le lundi 09 novembre 2009 à 13:56 -0300, Cristian Rojas a écrit :> Hi guys, I need to move an lvm based domU from one dom0 to another > dom0. > > > > How do you guys do ths? > > > > xm save/restore doesnt have the option to specify lvm target as the > storage. > > > > Thanks > > Chris > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Dnia wtorek, 10 listopada 2009 o 12:19:15 Cristian Rojas napisał(a):> Thanks Fajar, how do you normally copy the LVM storage to another dom0? > > Chris >Hi, First you have to stop domU. Sorry for reminding obvious things, but the next steps will be disastrous if done while domU is running. You can mount each volume of your domU in some directory of your dom0. On the target host you have to create analogous volumes as on source host, format and mount them too. Now, from your workstation, you can do: [you@workstation]$ ssh -A root@source.host [root@source]# tar -jcC /source/mount/point . | \ ssh root@target.host ''tar --numeric-owner -jxpC /target/mount/point'' or [root@source]# dump ... | gzip | ssh root@target.host ''gunzip | restore ...'' or similar things with rsync. If your domU is not unix and you have created target volumes with exactly same size, do not mount volumes but run: [root@source]# dd if=/dev/VG_source/LV_source | gzip | \ ssh root@target.host ''gunzip | dd of=/dev/VG_target/LV_target'' If your workstation is not unix but windows learn about puttyagent. Now, my favorite: If you have empty disk with USB or external SATA interface, you can connect it to the source host. Hardcore players hotplug common SATA disks to internal SATA connectors on the motherboard, but read the following warning. When lsscsi shows the connected disk do pvcreate on that disk, then vgextend, pvmove, vgsplit, vgexport, then move the disk to the target host and do vgimport, vgmerge, pvmove, vgreduce. Now you can run domU and disconnect the auxiliary disk, but remember to wipe -k that disk if your domU contains sensitive data (and usually root password and ssh server keys are such data). This way is a very risky way! Don''t blame me if YOU LOOSE ALL YOUR DATA on your source or target hosts or even BURN SOME HARDWARE. In case your system crashes and boots only in single mode try to run pvmove wthout arguments. You are warned, but no risk, no fun. If you have Fibre Channel or iSCSI, talk to your SAN administrator. Regards, -- Bartosz Lis _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Nov-11 02:12 UTC
Re: [Xen-users] Move domU lvm based to another dom0
On Tue, Nov 10, 2009 at 6:19 PM, Cristian Rojas <intipu@googlemail.com> wrote:> Thanks Fajar, how do you normally copy the LVM storage to another dom0?The most common way is with "dd". You could also add compression with gzip (quite standard), lzma/bzip2 (high compression, but REALY slow), or lzop (fastest). Something like dd if=/dev/VG/your-lv bs=4M | gzip -c | ssh your.other.dom0 "gunzip -c | dd of=/dev/VG/your-new-lv bs=4M" another option is to use FS-specific method. tar or rsync should work on common Linux filesystem (ext3, reiserfs, etc.) while for Windows domU you can use ntfsclone. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Cristian Rojas wrote:>Thanks Fajar, how do you normally copy the LVM storage to another dom0?Personally I mount the volumes in each Dom0 and use Rsync. Eg : On server2, make filesystems etc, and mount them on /mnt. On server1, mount filesystems on /mnt then : rsync -avH --numeric-ids /mnt/ root@server2:/mnt/ There isn''t really a right or wrong way - they all have their pros and cons. I''m just used to rsync and using it allows me to easily alter filesystem sizes and/or mountpoint layouts if required. Eg, if you''ve decided to put /var/spool/mail on it''s own volume, you can just do the extra mount on the destination and everything gets sorted in the copy (apart from tweaking fstab that is). -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users