本文所记录的报错,是笔者操作中遇到的,如果没有在本文中没有你操作中的错误,还是查看日志/var/log/    会有virt-p2v8897877989.log  等这样的日志。

P2v 报错

virsh pool-define-as kvm_final --type dir --target /kvm/ pool kvm_final defined

error: Failed to reconnect to the hypervisor

error: no valid connection

error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

 

[root@vcmy-p2v opt]# virsh pool-define-as kvm_final --type dir --target /kvm/ pool kvm_final defined

error: Failed to reconnect to the hypervisor

error: no valid connection

error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

 

问题:

error: Failed to reconnect to the hypervisor

error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
Further investigation found avahi was needed for this to work. The final fix was running
解决方法:

yum -y install avahi

/etc/init.d/messagebus restart
/etc/init.d/avahi-daemon restart
/etc/init.d/libvirtd restart
/sbin/chkconfig messagebus on
/sbin/chkconfig avahi-daemon on

 问题:

virt-v2v: virt-v2v: Failed to launch guestfs appliance. Try running again with LIBGUESTFS_DEBUG=1 for more information

解决方法:

[root@vcmy-p2v etc]# /etc/init.d/libvirtd restart

Stopping libvirtd daemon: [  OK  ]

Starting libvirtd daemon: 2016-07-05 16:30:28.714+0000: 19398: info : libvirt version: 0.10.2, package: 60.el6 (CentOS BuildSystem <http://bugs.centos.org>, 2016-05-11-04:19:11, worker1.bsys.centos.org)

2016-07-05 16:30:28.714+0000: 19398: warning : virGetHostname:2279 : getaddrinfo failed for 'vcmy-p2v': No address associated with hostname

[  OK  ]

[root@vcmy-p2v etc]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.31.207 vcmy-p2v

解决方法:运行 

1、libguestfs-test-tool 

2、ln -s /usr/bin/qemu-kvm /usr/libexec/qemu-kvm

3、给/etc/virt-v2v.conf  权限 chmod 777 /etc/virt-v2v.confi

virt-v2v: virt-v2v: Unable to parse config file /etc/virt-v2v.conf:

mismatched tag at line 95, column 2, byte 2421 at /usr/lib64/perl5/XML/Parser.pm line 187