1.1.1 ESXI将虚拟机导出

导出ova模板

将导出的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迁移)的更多相关文章

  1. ESXi到KVM之v2v迁移

    1.ESXi到KVM之v2v情况说明 (1).配置任务列表: 1)VMwareESXi虚拟平台下linux系统迁移到KVM虚拟平台.2)VMwareESXi虚拟平台下windows系统迁移到KVM虚拟 ...

  2. KVM到KVM之v2v迁移

    1.源KVM虚拟主机node1 (1).查看源KVM虚拟主机上的虚拟机列表,本文计划将oeltest01虚拟机迁移到其它KVM虚拟主机中. (2).查看oeltest01虚拟机磁盘文件位置/data/ ...

  3. kvm虚拟机迁移

    一.迁移简介 迁移: 系统的迁移是指把源主机上的操作系统和应用程序移动到目的主机,并且能够在目的主机上正常运行.在没有虚拟机的时代,物理机之间的迁移依靠的是系统备份和恢复技术.在源主机上实时备份操作系 ...

  4. kvm虚拟迁移

    1. 虚拟迁移 迁移: 系统的迁移是指把源主机上的操作系统和应用程序移动到目的主机,并且能够在目的主机上正常运行.在没有虚拟机的时代,物理机之间的迁移依靠的是系统备份和恢复技术.在源主机上实时备份操作 ...

  5. kvm热迁移(4)

    一.迁移简介 迁移分为热迁移和冷迁移,冷迁移是在机器关机的状态下进行迁移,具体操作在之前的博客有体现.热迁移是在机器处于开机状态进行迁移,本次博客主要讲解热迁移. 系统的迁移是指把源主机上的操作系统和 ...

  6. KVM虚拟迁移(5)

    一.迁移简介 迁移:      系统的迁移是指把源主机上的操作系统和应用程序移动到目的主机,并且能够在目的主机上正常运行.在没有虚拟机的时代,物理机之间的迁移依靠的是系统备份和恢复技术.在源主机上实时 ...

  7. kvm虚拟机迁移(6)

    一.迁移简介 迁移:      系统的迁移是指把源主机上的操作系统和应用程序移动到目的主机,并且能够在目的主机上正常运行. 在没有虚拟机的时代,物理机之间的迁移依靠的是系统备份和恢复技术.在源主机上实 ...

  8. KVM 介绍(8):使用 libvirt 迁移 QEMU/KVM 虚机和 Nova 虚机 [Nova Libvirt QEMU/KVM Live Migration]

    学习 KVM 的系列文章: (1)介绍和安装 (2)CPU 和 内存虚拟化 (3)I/O QEMU 全虚拟化和准虚拟化(Para-virtulizaiton) (4)I/O PCI/PCIe设备直接分 ...

  9. 笔记:Xen虚拟机如何迁移到KVM上?

    众所周知如果是在Linux上使用虚拟化技术的话,就会有基于Xen Hypervisor部署一个系统的机会.因为基于内核的虚拟机(KVM:Kernel-Based Virtual Machine)已经逐 ...

随机推荐

  1. python 全栈开发,Day81(博客系统个人主页,文章详情页)

    一.个人主页 随笔分类 需求:查询当前站点每一个分类的名称以及对应的文章数 完成这个需求,就可以展示左侧的分类 它需要利用分组查询,那么必须要会基于双下划线的查询. 基于双下划线的查询,简单来讲,就是 ...

  2. python 全栈开发,Day6(is,小数据池,编码转换)

    一.is a = 100 b = 100 print(a == b) print(a is b) 执行输出: TrueTrue 查看内存地址,使用id函数 print(id(a)) print(id( ...

  3. MVC开发中的常见错误-05-无法将类型“System.Data.Entity.Infrastructure.DbQuery<BBFJ.OA.Model.RoleInfo>”转换为“System.Collections.Generic.List<BBFJ.OA.Model.RoleInfo>”

    List<RoleInfo> roleInfoList = (List<RoleInfo>)ViewBag.AllRoles; 错误原因很明确了 ViewBag.AllRole ...

  4. python全栈开发day24-__new__、__del__、item系列、异常处理

    一.昨日内容回顾 1.反射 用字符串类型的名字,操作命名空间的变量. 反射使用场景:明显的简化代码,能拿到的变量名本来就是一个字符串类型的时候, 用户输入的,文件读入的,网上传输的 2.__call_ ...

  5. Docker 记一次容器内部修改宿主机挂载目录用户权限后宿主机目录变化

    一.需求: 因公司需求,需制作mysql5.7.22 docker基础镜像,每个项目以此镜像启动一个数据库容器,并且每个项目挂载一个宿主机目录到镜像中数据存储下面用于数据持久化保存以便后期迁移至阿里云 ...

  6. Java jvm 内存参数限制

    nohup java -jar -Xms3g -Xmx3g jenkins.war > jenkins.log 2>&1 &

  7. 011 处理模型数据时@ModelAttribute的使用

    一:说明 1.使用场景 在下面的场景中: 使用new对象时,最后的效果是两个被赋值了,但是还有一个值是空值的,这个不符合只更新两个值,另一个值不变的情况. 正确的做法: 三个值得数据不是new出来的, ...

  8. 017 在SecureCRT中安装rz小工具

    1.安装yum 2.上传本地的文件进虚拟机 3.注意点 只是属于SecureCRT的命令,同时,在上传的位置是现在所在的位置 4.测试

  9. js算法初窥05(算法模式02-动态规划与贪心算法)

    在前面的文章中(js算法初窥02(排序算法02-归并.快速以及堆排)我们学习了如何用分治法来实现归并排序,那么动态规划跟分治法有点类似,但是分治法是把问题分解成互相独立的子问题,最后组合它们的结果,而 ...

  10. Python3练习题系列(08)——代码阅读方法及字典跳转表理解

    问题:分析下面代码 cities['_find'] = find_city city_found = cities['_find'](cities, state) 分析过程: 一个函数也可以作为一个变 ...