VMDK镜像迁移到KVM(二)
KVM has the ability to use VMware's .vmdk disk files directly, as long as the disk is wholly contained in a single vmdk file. However, VMware also allows splitting a disk into multiple smaller vmdk files, usually 2 GB each. KVM can't use these. You can convert these files into a single virtual disk file using vmware-vdiskmanager, included in the freely available VMware Server.
$ vmware-vdiskmanager -r <Name of split vmdk base file> -t 0 <Name of new single vmdk file>
IMPORTANT: before converting the disk files into a single disk file, you must first remove all snapshots (through the web interface if you were using VMware Server 2.0). Otherwise your merged disk will not be in the latest known state. Removing these snapshots can take quite some time, after which *-000001.vmdk - type of files may have disappeared from the file system.
To create a new virtual machine from an existing file, call virt-install with the --import argument (see the virt-install manpage for details).
To use a .vmdk disk in an existing virtual machine, modify the VM's XML file in /etc/libvirt/qemu:
...
<disk type='file' device='disk'>
<driver name='qemu' type='vmdk'/>
<source file='/var/lib/libvirt/images/diskname.vmdk'/>
<target dev='hda' bus='ide'/>
</disk>
...
and redefine it:
$ virsh -c qemu:///system define NameOfMachine.xml
IMPORTANT: keep in mind that while the .vmx file is converted to .xml, the disks are used as-is. Please make backups, especially if you want to use the virtual machine in VMware later.
KVM is not able to make snapshots when using vmdk disk files, so converting the virtual disk file in qemu's qcow2 format is advisable. The qemu package contains a utility named qemu-img to do this:
qemu-img convert diskname.vmdk -O qcow2 diskname.qcow2
OR for raw
qemu-img convert diskname.vmdk -O raw diskname.raw
The converted image can be used as part of the definition of a new VM, or incorporated into an existing VM (see above). Adding the disk through virt-manager will always add it as a raw disk, so you will need to edit the xml as follows below to make sure it works with qcow2. The important bit is type='qcow2' instead of type='raw'!
...
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/.../diskname.qcow2'/>
<target dev='hdb' bus='ide'/>
</disk>
...
Should VMware Tools be kept after conversion?
If converting from vmware to libvirt, be sure to remove vmware-tools if you have it installed (otherwise it will overwrite xorg.conf on reboot)
VMDK镜像迁移到KVM(二)的更多相关文章
- VMDK镜像迁移到KVM
The vmware system consists of two disks in raw format: the old boot disk and the second one. It is W ...
- 笔记:Xen虚拟机如何迁移到KVM上?
众所周知如果是在Linux上使用虚拟化技术的话,就会有基于Xen Hypervisor部署一个系统的机会.因为基于内核的虚拟机(KVM:Kernel-Based Virtual Machine)已经逐 ...
- 阿里云开源 image-syncer 工具,容器镜像迁移同步的终极利器
为什么要做这个工具? 由于阿里云上的容器服务 ACK 在使用成本.运维成本.方便性.长期稳定性上大大超过公司自建自维护 Kubernets 集群,有不少公司纷纷想把之前自己维护 Kubernetes ...
- 【电子取证:镜像仿真篇】Windows Server镜像仿真、vmdk镜像仿真
Windows Server镜像仿真.vmdk镜像仿真 时间过得真快呀!--[suy999] Windows Server镜像仿真.vmdk镜像仿真 一.qemu-img镜像转换工具 (一)raw.q ...
- SQL Server 2008 数据库镜像部署实例之二 配置镜像,实施手动故障转移
SQL Server 2008 数据库镜像部署实例之二 配置镜像,实施手动故障转移 上一篇文章已经为配置镜像数据库做好了准备,接下来就要进入真正的配置阶段 一.在镜像数据库服务器上设置安全性并启动数据 ...
- 如何把Composer镜像迁移到Laravel China 维护的镜像?
今天在更新Laravel-admin:1.6.0提示没有对应的包,后面才发现需要使用官方或者 Laravel-China 的 composer 镜像,phpcomposer 镜像已经停止维护了.怎么从 ...
- Mac环境下扩容 .vmdk 镜像容量
参考: Resizing a VirtualBox Disk Image (.vmdk) on a Mac Mac环境下扩容 .vmdk 镜像容量 在安装虚拟机时,原有的vmdk镜像容量只有20G,在 ...
- vmware磁盘文件(vmdk)迁移
原因:由于虚拟机安装时硬盘分配20G,随着虚拟机数据增多,磁盘占用也增多.磁盘总可用空间不能满足虚拟机数据增多.虽然虚拟机数据还没到20G,但磁盘总可用空间小,导致虚拟机继续运行时报空间不足. 解决办 ...
- 使用nodejs+ harbor rest api 进行容器镜像迁移
最近因为基础设施调整,需要进行harbor 镜像仓库的迁移,主要是旧版本很老了,不想使用,直接 打算部署新的,原以为直接使用复制功能就可以,但是发现版本差异太大,直接失败,本打算使用中间 版本过度进行 ...
随机推荐
- 600万用户数据导入MYSQL、MSSQL、Oracle数据库方法【转】
1.导入MySql数据库 参考文献:http://zhuaxia.org/blog/post/145 1.1.LOAD DATA INFILE语法 因为获得的数据库文件是一个文本文件www.csd ...
- 智能手机Web开发笔记
智能手机版(简称M版)前端开发终于告一段落,第一次做移动端开发,没有想象中那么难搞,但是期间也遇到了各种这样那样的问题,虽然从小日记都不是自己写的,但是开发笔记还是要自己写的,不敢说让别人学习,只是仅 ...
- js中Array自定义contains, indexOf, delete方法.
Array.prototype.contains = function (elem) { for (var i = 0; i < this.length; i++) { if (this[i] ...
- FZU 2216 The Longest Straight 模拟
题目链接:The Longest Straight 就是一个模拟就是这样,T_T然而当时恶心的敲了好久,敲完就WA了,竟然有这么简单的方法,真是感动哭了.......xintengziji...zhi ...
- 菜鸟开始学习SSDT HOOK((附带源码)
看了梦无极的ssdt_hook教程,虽然大牛讲得很细,但是很多细节还是要自己去体会,才会更加深入.在这里我总结一下我的分析过程,若有不对的地方,希望大家指出来.首先我们应该认识 ssdt是什么?从梦无 ...
- 北邮新生排位赛1解题报告a-c
<div class="page-header" style="padding-bottom: 9px; margin: 20px 0px 30px; border ...
- PictureWebHandler
using System; using System.Configuration; using System.Drawing; using System.Drawing.Imaging; using ...
- Java并发编程(二)线程任务的中断(interrupt)
使用interrupt()中断线程 当一个线程运行时,另一个线程可以调用对应的Thread对象的interrupt()方法来中断它,该方法只是在目标线程中设置一个标志,表示它已经被中断,并立即返回. ...
- struts中的数据校验
1.struts中如何进行数据校验 在每一个Action类中,数据校验一般都写在业务方法中,比如login().register()等.struts提供了数据校验功能.每个继承自ActionSuppo ...
- 'NSInteger' (aka 'long') to 'int32
怎么去掉Xcode工程中的某种类型的警告 Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int32 ...