Description 1:vmware Workstation image is a VMDK format
Description 2:cloudstack configuration file directory:/RUN/LIBVIRT/QEMU/KVM profile directory:/etc/libvirt/qemu
Description 3:windows Format Conversion method
C:\Program Files (x86) \VMware\VMware workstation>vmware-vdiskmanager.exe-r d:\centos7.4\CentOS.vmdk-t 0 TEMP.VMDK
First, installing the centos7.4 system in VMware Workstation
Second, find the VMDK file in the system installation directory, upload to the Linux system
Third, KVM file conversion
1, convert VMDK to Qcow2
Qemu-img convert-f vmdk-o qcow2 temp.vmdk centos72.qcow2
2, download wget https://launchpadlibrarian.net/40519715/virt-goodies_0.4.tar.gz
3, config file conversion, convert VMX to XML,
./vmware2libvirt-f/OPT/IMAGE/CENTOS.VMX >/opt/image/centos.xml
12345678910111213141516171819202122232425262728293031 |
<domain
type
=
‘kvm‘
>
<name>CentOS<
/
name>
<uuid>c2fbe7d6
-
d8c5
-
44df
-
9001
-
1632ebde8e58
<
/
uuid>
<memory>
1048576
<
/
memory>
<currentMemory>
1048576
<
/
currentMemory>
<vcpu>
1
<
/
vcpu>
<os>
<
type
arch
=
‘i686‘
machine
=
‘pc‘
>hvm<
/
type
>
#改为<type arch=‘x86_64‘ machine=‘pc‘>hvm</type>
<boot dev
=
‘hd‘
/
>
<
/
os>
<features>
<acpi
/
>
<
/
features>
<clock offset
=
‘utc‘
/
>
<on_poweroff>destroy<
/
on_poweroff>
<on_reboot>restart<
/
on_reboot>
<on_crash>destroy<
/
on_crash>
<devices>
<emulator>
/
usr
/
bin
/
kvm<
/
emulator>
<disk
type
=
‘file‘
device
=
‘disk‘
>
<source
file
=
‘/opt/image/CentOS.vmdk‘
/
>
#改为<source file=‘/opt/image/CentOS.qcow2‘/>
<target dev
=
‘hda‘
/
>
<
/
disk>
<interface
type
=
‘network‘
>
<mac address
=
‘00:0c:29:2e:f9:2c‘
/
>
<source network
=
‘default‘
/
>
<
/
interface>
<
input
type
=
‘mouse‘
bus
=
‘ps2‘
/
>
<graphics
type
=
‘vnc‘
port
=
‘-1‘
listen
=
‘127.0.0.1‘
/
>
<
/
devices>
<
/
domain>
|
4. Install the required package and connect to the/usr/bin directory
Yum Install libvirt-devel.x86_64 libvirt.x86_64
Ln-s/USR/LIBEXEC/QEMU-KVM/USR/BIN/KVM
5, Start KVM
Virsh Define Ubuntu.xml
6, start Virt-manager:applications->system tools->virtual Machine Manager
7. Change the configuration file
Storage Format:qcow2
Four, direct conversion using cloudstack4.11
You can upload a vmdk or vmdk converted Qcow2 image directly with the disk controller to select the IDE
2, launch the instance, select the template you just uploaded
3. View the instance
Create Cloudstack (KVM) mirroring and problem resolution with VMware Workstation