p2v之 virt-p2v

关于p2v的文章由于同事已经完成,因此直接附上博文链接:
http://guwenwu285.iteye.com/blog/1633748

对于上文中的几点做一个解释:
virt-p2v的流程:
1、制作一个virt-p2v的启动U盘
2、找一台机器当做p2v的中转机器,用于第三步中,将物理机传输过来的数据进行转化(此转换机器启动了virt-p2v-server服务)。
3、将上述启动U盘插入将要进行p2v的机器(是指物理机)
4、启动插入启动U盘的物理机,开机启动选择U盘启动,通过网络,将物理机上面的数据传送给第二步的 virt-p2v-server服务
5、virt-p2v-server服务接收到数据,根据配置转换为相应的虚拟机文件

注:在使用virt-p2v中,一般物理机硬盘比较大,然而virt-p2v的libvirt配置选项,只能进行全盘拷贝,因此很多情况下不是很实用。
p2v之 virt-p2v_第1张图片


以下附上,本人在实验virt-p2v中查找的文档资料,及一些问题的解决办法。

1、virt-p2v redhat官方文档:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/V2V_Guide/chap-V2V_Guide-P2V_Migration_Converting_Physical_Machines_to_Virtual_Machines.html

libguestfs官方文档:
http://libguestfs.org/virt-p2v.1.html

Virt-p2v converts a physical machine to run virtualized on KVM, managed by libvirt, OpenStack, oVirt, Red Hat Enterprise Virtualisation (RHEV), or one of the other targets supported by virt-v2v(1).

Normally you don't run the virt-p2v program directly. Instead you have to boot the physical machine using the bootable CD-ROM, ISO or PXE image. This bootable image contains the virt-p2v binary and runs it automatically. Booting from a CD-ROM/etc is required because the disks which are being converted must be quiescent. It is not safe to try to convert a running physical machine where other programs may be modifying the disk content at the same time.

This manual page documents running the virt-p2v program. To create the bootable image you should look at virt-p2v-make-disk(1) or virt-p2v-make-kickstart(1).



The reverse port forwarding feature of ssh (ie.  ssh -R ) is required by virt-p2v, and it will not work if this is disabled on the conversion server. ( AllowTcpForwarding  must be  yes  in the sshd_config(5)  file on the conversion server).




vim /etc/ssh/sshd_config 

/etc/init.d/sshd restart


物理机:

在物理机上面生成一个test-p2v文件:
p2v之 virt-p2v_第2张图片

未插U盘之前:
p2v之 virt-p2v_第3张图片


插入U盘之后:
p2v之 virt-p2v_第4张图片

挂在U盘,格式化:
mkfs.ext4 /dev/sdb

yum install virt-p2v  virt-v2v

p2v之 virt-p2v_第5张图片



virt-p2v-server 

sudo mount -o loop /usr/share/virt-p2v/virt-p2v-0.9.1-2.20130730.1.el6.centos.iso /mnt/
cd /mnt/LiveOS/
./livecd-iso-to-disk /usr/share/virt-p2v/virt-p2v-0.9.1-2.20130730.1.el6.centos.iso /dev/sdb
yum install isomd5sum*

p2v之 virt-p2v_第6张图片

格式化u盘:
mkfs.ext3 /dev/sdb
p2v之 virt-p2v_第7张图片

yum install syslinux

yum install syslinux-extlinux

mkdir /home/p2v_dir
virsh pool-create-as kvm-storage-pool dir --target=/home/p2v_dir
p2v之 virt-p2v_第8张图片
至此p2vU盘制作完成。


Server closed connection unexpertedly: EOF on channel in channel_read"




你可能感兴趣的:(p2v之 virt-p2v)