Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2395261
  • 博文数量: 328
  • 博客积分: 4302
  • 博客等级: 上校
  • 技术积分: 5486
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-01 11:14
个人简介

悲剧,绝对的悲剧,悲剧中的悲剧。

文章分类

全部博文(328)

文章存档

2017年(6)

2016年(18)

2015年(28)

2014年(73)

2013年(62)

2012年(58)

2011年(55)

2010年(28)

分类: 虚拟化

2012-08-22 18:32:50

首先用 vShpere Client 登陆到 VMware ESXi 5.0 上打开防火墙设置,允许 ESXi 上的 ssh server 和 ssh client 可用,否则不能 ssh 登陆到 ESXi 也不能从 ESXi 上 scp 镜像到 KVM 服务器,设置具体在 Configuration > Software > Security Profile > Firewall > Properties … > SSH Client 里:

vmware esxi 5.0 enable ssh client

然后 ssh 登陆 VMware ESXi 5.0 服务器(172.16.39.100)后,scp 所需要的镜像文件(后缀名为 .vmdk)到 KVM 服务器(172.16.39.101)上

$ ssh root@172.16.39.100
Password:
The time and date of this login have been sent to the system logs.

VMware offers supported, powerful system administration tools.  Please
see for details.

The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.

~ # scp /vmfs/volumes/localstore/vcenter/vcenter-flat.vmdk root@172.16.39.101:/root

把 VMware 的 vmdk 格式转化成 KVM 的格式,因为从 v0.12 开始 qemu-kvm 已经支持 VMware 的硬盘格式 v6 和 v7,所以这一步其实是可以省略的,换句话说 kvm 可以直接启动 vmdk 格式的虚拟机。

$ ssh root@172.16.39.101
# qemu-img convert vcenter-flat.vmdk vcenter.img

最后用 virsh create vcenter.xml 的时候记得 vcenter.xml 文件里面关于硬盘的部分是如下设置,还有记得打开 vnc 设置(别忘了 Windows 是图形界面的):

# vi vcenter.xml
...
 
     
     
     
     

   
   
     

   
...
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
...

# virsh create vcenter.xml

Troubleshooting

如果启动 Windows 后用 vnc 客户端连接 KVM 服务器,Windows 启动过程中可能出现蓝屏 Stop 0x0000007B 错误,这是因为硬盘控制器驱动变了:

解决办法是在迁移前下载 MergeIDE.zip 后解压,双击运行 MergeIDE.bat 文件,然后关闭 Windows 重新按照上面的步骤走一遍。

转载自:
阅读(3314) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~