p2v之 virt-p2v

关于p2v的文章由于同事已经完成,因此直接附上博文链接:

对于上文中的几点做一个解释:
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配置选项,只能进行全盘拷贝,因此很多情况下不是很实用。


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

1、virt-p2v redhat官方文档:

libguestfs官方文档:

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文件:

未插U盘之前:


插入U盘之后:

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

yum install virt-p2v  virt-v2v




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*


格式化u盘:
mkfs.ext3 /dev/sdb

yum install syslinux

yum install syslinux-extlinux

mkdir /home/p2v_dir
virsh pool-create-as kvm-storage-pool dir --target=/home/p2v_dir
至此p2vU盘制作完成。


Server closed connection unexpertedly: EOF on channel in channel_read"




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值