[afnog] concatenate kvm raw images

Lomayani S. Laizer lomlaizer at gmail.com
Sun Aug 14 08:14:48 UTC 2016


Hello,
I managed to do this  but i think in hard way. I think sharing this will
help someone who want to join hard drives of virtual machines under lvm or
removing hard drive in lvm group

Lets say you have virtual machine having partition vda2,vdb1,vdc1 in lvm.
the trick is to increase first image  by normal qemu-img resize
virt-name(image of the first partition, in this case vda) new-big-space

then create  new partition table with fdisk( be careful with operating
system like centos use -u -c switches). Reboot the virtual machine and
increase volume of the first hard drive by normal pvresize vda2

dont expand volume group. then start to move other partitions to hard drive
with space (pvmove /dev/vdb1 /dev/vda2). Repeat for all partitions to be
removed. the problem with this pvmove is very slow. Remove migrated
partition in lvm. If you still have free space in vda2 then do volume
extend and resizing the file system. Migrating 500GB of partion took the
whole night(12hrs). This can be worse for slow hard drives

--
Lomayani

--
Lomayani


On Fri, Aug 12, 2016 at 6:30 PM, Lomayani S. Laizer <lomlaizer at gmail.com>
wrote:

> Hello,
>
> Am a having problem here. We have  virtual machines which are running
> under our old system. the virtual machine is having separate
> images(server1.img, server2.img, server3.img) which inside run lvm to
> combine all space.
>
> My problem is, we are migrating these virtual machines to ceph. I want
> combine this images of a single virtual machine to get one image and
> migrate it to ceph to easy backup issues on future. What is the best way to
> combine images  in lvm to get  one image with all data?
>
> Your help is highly appreciated.
>
> --
> Lomayani
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.afnog.org/pipermail/afnog/attachments/20160814/287b3859/attachment.html>


More information about the afnog mailing list