Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Virt-v2v tools automatically migrate vmware to kvm

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Virt-v2v tools automatically migrate vmware to kvm

If the virtual machine is a virtual machine of ESXi, then we can use virt-v2v 's tools to migrate automatically.

The virt-v2v tool can migrate virtual machines from other hypervisor platforms to KVM.

It can read virtual machines on the Xen,Hyper-v,VMware platform and migrate them to KVM,openstack or RHEV environments managed by libvirt.

This section only focuses on how to migrate virtual machines to KVM on ESCi, and you only need to convert images and import to openstack and RHEV without going into detail.

KVM storage pool configuration proc

Mkdir-p / data/vmfs

Virsh pool-define-as vmdisk-type dir-target / data/vmfs

Virsh pool-build vmdisk

Virsh pool-autostart vmdisk

Virsh pool-start vmdisk

Create an ESXi certification file

(this step is not a necessary step. If you do not configure it, you need to change the command slightly when using virt-v2v.)

Vim / root/.netrc

Machine YourESXiServerIPAddress login root password YourESXiServerIPAddress

Chmod 0600 ~ / .netrc

[root@amckvm2 ~] # cat / root/.netrc

Machine 192.168.24.13 login root password password 192.168.24.13

[root@amckvm2 ~] #

Start the migration

Test to see if you can connect to the ESXi host before starting the migration

Virsh-c esx://192.168.24.13/?no_verify=1 list-- all

If you can see the host running on this ESXi, there is no problem with the connection.

[root@amckvm2] # virsh-c esx://192.168.24.13/?no_verify=1 list-- all

Enter username for 192.168.24.13 [root]:

Enter root's password for 192.168.24.13:

Id Name State

1 Vcenter_192.168.24.100 running

8 amcctrix1_192.168.24.103 running

9 amcctrix2_192.168.24.104 running

10 amczhtest_192.168.24.105 running

11 amcjrjh_192.168.24.106 running

13 windowsclustertest_192.168.24.108 running

-rhel6.5_db_model_192.168.24.231 shut off

-windows2008_model shut off

Start the migration

Virt-v2v-ic esx://192.168.24.13/?no_verify=1-os vmdisk-of qcow2-b br0 rhel6.5_db_model_192.168.24.231

Note:

1. If you encounter an error like "Peer certificate cannot be authenticated with given CA certificates", ignore the certificate check by setting the no_verify=1 parameter after url.

two。 The whole url is made up of user@esxi. If the authentication file is not created in 3.2, you need to change the command to the following

Virt-v2v-ic esx://root@192.168.24.13/no_verify=1-os vmdisk-of qcow2-b br0 rhel6.5_db_model_192.168.24.231

3. If the user name is a domain account (domain\ name) or the virtual machine name contains a backslash, the backslash needs to be transcoded and "% 5c" is used instead of "\".

4.-os represents the storage pool specified in KVM,-of represents the virtual disk format transferred out of the migration, and the thing I specify here, qcow2,-b, represents the virtual bridge in the specified KVM.

The output is as follows

[root@amckvm2] # virt-v2v-ic esx://192.168.24.13/?no_verify=1-os vmdisk-of qcow2-b br0 rhel6.5_db_model_192.168.24.231

Rhel6.5_db_model_rhel6.5_db_model: 100% [=] D 1h32m16s

Virt-v2v: rhel6.5_db_model_192.168.24.231 configured with virtio drivers

Virt-v2v: inner-db configured without virtio drivers.

View the converted xml configuration file

[root@amckvm2 qemu] # pwd

/ etc/libvirt/qemu

[root@amckvm2 qemu] # cat rhel6.5_db_model_192.168.24.231.xml

Rhel6.5_db_model_192.168.24.231

C97c0167-fde4-e309-e477-4e5592e8507e

8388608

8388608

eight

Hvm

Destroy

Restart

Restart

/ usr/libexec/qemu-kvm

[root@amckvm2 qemu] #

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report