ESXI 迁移至KVM (V2V迁移)

摘要:
--由virt-v2v1.36.3hel=7生成,版本=6.el7_4.3,libvirt--˃centos-dev-test01-v2v5242885242881hvm销毁重新启动重新启动崩溃˃˃˃devices˃1.1.4启动虚拟机以导入主机[root@clsn7dev-test01]#处女座

1.1.1 ESXI将虚拟机导出

 ESXI 迁移至KVM (V2V迁移)第1张

   导出ova模板

ESXI 迁移至KVM (V2V迁移)第2张

   将导出的ova模板导入到KVM环境中。

1.1.2 配置KVM环境

详情参考:http://www.cnblogs.com/clsn/p/8366251.html

安装所需要的组件

[root@clsn7 ~]# yum install libvirt* virt-* qemu-kvm* -y

配置桥接网卡

[root@clsn7 ~]# virsh iface-bridge eth1 br1 
使用附加设备 br1 生成桥接 eth1 失败
已启动桥接接口 br1

1.1.3 导入虚拟机

启动kvm管理程序,并设置开机自启动

[root@clsn7 ~]# systemctl start libvirtd.service
[root@clsn7 ~]# systemctl enable libvirtd.service

   创建虚拟机存放目录

[root@clsn7 ~]# virt-v2v -i ova centos-dev-test01-v2v.ova -o local -os /vmhost/dev/dev-test01  -of qcow2 
[   0.0] Opening the source -i ova centos-dev-test01-v2v.ova
virt-v2v: warning: making OVA directory public readable to work around 
libvirt bug https://bugzilla.redhat.com/1045069
[  23.1] Creating an overlay to protect the source from being modified
[  23.4] Initializing the target -o local -os /vmhost/dev/dev-test01
[  23.4] Opening the overlay
[  41.4] Inspecting the overlay
[  57.5] Checking for sufficient free disk space in the guest
[  57.5] Estimating space required on target for each disk
[  57.5] Converting CentOS release 6.9 (Final) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 178.6] Mapping filesystem data to avoid copying unused and blank areas
[ 178.9] Closing the overlay
[ 179.4] Checking if the guest needs BIOS or UEFI to boot
[ 179.4] Assigning disks to buses
[ 179.4] Copying disk 1/1 to /vmhost/dev/dev-test01/centos-dev-test01-v2v-sda (qcow2)
    (100.00/100%)
[ 216.1] Creating output metadata
[ 216.1] Finishing off

导入完成后在 /vmhost/dev/dev-test01 目录下会生成文件

[root@clsn7 dev-test01]# pwd
/vmhost/dev/dev-test01
[root@clsn7 dev-test01]# ls
centos-dev-test01-v2v-sda  centos-dev-test01-v2v.xml

修改网卡配置

  修改网卡source network 为桥接

  修改网卡使用virtio

[root@clsn7 dev-test01]# cat centos-dev-test01-v2v.xml 
<?xml version='1.0' encoding='utf-8'?>
<domain type='kvm'>
  <!-- generated by virt-v2v 1.36.3rhel=7,release=6.el7_4.3,libvirt -->
  <name>centos-dev-test01-v2v</name>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu>1</vcpu>
  <features>
    <acpi/>
    <apic/>
  </features>
  <os>
    <type arch='x86_64'>hvm</type>
  </os>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/vmhost/dev/dev-test01/centos-dev-test01-v2v-sda'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk device='cdrom' type='file'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk device='floppy' type='file'>
      <driver name='qemu' type='raw'/>
      <target dev='fda'/>
    </disk>
    <interface type='bridge'>
      <source bridge='br1'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <video>
      <model type='qxl' ram='65536' heads='1'/>
    </video>
    <graphics type='vnc' autoport='yes' port='-1'/>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <console type='pty'/>
  </devices>
</domain>

1.1.4 启动虚拟机

导入主机

[root@clsn7 dev-test01]# virsh  define centos-dev-test01-v2v.xml  
定义域 centos-dev-test01-v2v(从 centos-dev-test01-v2v.xml)

查看主机列表

[root@clsn7 dev-test01]#  virsh list --all 
 Id    名称                         状态
----------------------------------------------------
 -     centos-dev-test01-v2v          关闭

启动主机

[root@clsn7 dev-test01]#  virsh start centos-dev-test01-v2v 
域 centos-dev-test01-v2v 已开始

1.1.5 测试可用性

登陆迁移后的虚拟机测试

[root@clsn7 ~]# ssh root@192.168.19.123
The authenticity of host '192.168.19.123 (192.168.19.123)' can't be established.
RSA key fingerprint is SHA256:iRmghFzgRIJy5+v8p4lqi8DyUG8F0hXR/qNdDZ2J6RY.
RSA key fingerprint is MD5:37:b8:56:3b:b7:85:fa:cb:d9:55:a7:44:d5:de:f8:d9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.19.123' (RSA) to the list of known hosts.
root@192.168.19.123's password: 
Last login: Mon Mar  5 10:30:02 2018 from 192.168.19.9
[root@dev-test01 ~]# hostname  -I
192.168.19.123

  设置虚拟机开机自启动。

[root@clsn7 ~]# virsh autostart centos-dev-test01-v2v 
域 centos-dev-test01-v2v标记为自动开始

   至此一台机器的迁移完成,后续按照相同的方式将其他的虚拟机进行迁移即可。

免责声明:文章转载自《ESXI 迁移至KVM (V2V迁移)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇slua 中使用 lua5.3第五章·Kibana入门-安装,索引添加及界面功能下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

linux 系统centos新添加一个硬盘,分区格式化挂载操作

给服务器买一个硬盘,要使用一般要经过下面几部 ---------分区--》格式化--》挂载--------- 一。先熟悉几个命令和linux硬盘命名规则 1.lsblk ,查看挂载的所有磁盘 2.blkid ,查看磁盘分区的文件系统格式命令示例:blkid /dev/vdb1“TYPE”为“ext4”:表示为/dev/vdb1的文件系统是ext4。 3....

Linux(CentOS)用户修改密码有效期

1、 先查看密码过期时间: [root@01 ~]# chage -l testuser Last password change : Jul 10, 2017 Password expires : Oct 08, 2018 Password inactive : never Account expires : never...

Linux centos 7下搭建mosquitto

Centos7安装 1.网卡名改为enth0  A:  vim /etc/sysconfig/grub  B:  第三行添加“net.ifnames=0 biosdevname=0”  C: 执行指令:grub2-mkconfig -o /boot/grub2/grub.cfg 2.修改自动获取IP   A:更改 etc/sysconfig/network...

安装pysqlite2

1. 从https://github.com/msabramo/pysqlite2 下载源码。 2.安装python-dev:sudo apt-get install python-dev否则在 编译或安装过程中,可能会出现 错误:error:Python.h No such file or directory 。注意,不同的Linux发行版的安装命令可...

CentOS设置密码复杂度及过期时间等

我们在使用linux系统设置密码的时候,经常遇到这样的问题,系统提示:您的密码太简单,或者您的密码是字典的一部分。那么系统是如何实现对用户的密码的复杂度的检查的呢?  系统对密码的控制是有两部分(我知道的)组成:  1 cracklib  2 login.defs  声明:login.defs主要是控制密码的有效期。对密码进行时间管理。此处不细谈。  lo...

Ubuntu系统字体安装

  用惯了Windows,刚转到Ubuntu时总感觉字体显示没那么亲切,尤其是中文字体,在网页上显示特别怪。有些软件对中文字体的支持也不好,WebStorm中的Git logs中文也显示乱码。把系统语言设置成中文,Git logs无法显示中文的问题解决了,但英文的菜单字体又显示怪怪的。简直无法忍受!   怎么办?在百度上搜到这篇文章,说是可以把Window...