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 镜像仓库的迁移,主要是旧版本很老了,不想使用,直接 打算部署新的,原以为直接使用复制功能就可以,但是发现版本差异太大,直接失败,本打算使用中间 版本过度进行 ...
随机推荐
- MongoDB replicaSet
MongoDB 的replication机制除了最普通的Master/Slave模式之外,更强大的就是其支持自动故障转移的Replica Sets模式了.相对于其问题多多的auto-sharding机 ...
- 使用Lucene.Net管理索引实现搜索
之前使用一直是没有问题的,只到今天发现删除的时候无法删除,增加的时候却一直在增加,导致搜索的时候可以搜出来很多相同的结果. 小猪决定趁今天这个机会好好的把这个问题给解决了. private void ...
- [Js]布局转换
为什么要布局转换? 要这样的效果,单写css,只要给每个li浮动就行,不需要绝对定位.但是比如做一些效果(如鼠标移入图片变大),就需要改变位置了.直接给每个li在css上定好位置不方便,也不知道有几个 ...
- BindingNavigator操作DatagridView的数据
参考 http://wenku.baidu.com/link?url=NWfEfArPZvDO_aI-xEKBHVGoZY9wQO_Oty_GCsGLiPspheCzFYLf_dytuWAqN2_0A ...
- zatree第三方插件
Zabbix安装第三方插件zatree2.4.5 1.下载zatree第三方插件https://github.com/spide4k/zatree.git 2.检查PHP环境需要支持php-xml.p ...
- 【HDU2087】KMP
KMP算法其实很好理解,就是在匹配串中找最近的相同的串. 下面是HDU的2087: #include<iostream> #include<cstdio> #include&l ...
- 数据结构-AVL树的旋转
http://blog.csdn.net/GabrieL1026/article/details/6311339 平衡二叉树在进行插入操作的时候可能出现不平衡的情况,AVL树即是一种自平衡的二叉树,它 ...
- WP8.1 Study5:Data binding数据绑定
一.数据绑定 最简单的编程UI控件的方法是写自己的数据来获取和设置控件的属性,e.g. , textBox1.Text = "Hello, world"; 但在复杂的应用程序,这样 ...
- Highcharts导出gb2312乱码问题
Highcharts是utf-8编码的,其本地的.net导出环境也是utf-8格式的,导致网页如果采用gb2312编码,显示正常,导出就乱码了.这种现象也同样经常出现在ajax的使用过程中. ajax ...
- Spring学习笔记之模块简介
1.Core Container(Application context) module 这个是Spring最基本的模块,它提供了spring框架最基本的功能.BeanFactory 是任何基于Spr ...