1. virtual storage pool 1.1 create a virtual storage pool
1 [[email protected] ~]# mkdir -p /data/vmfs
1.2 define storage pools and directories
1 [[email protected] ~]# virsh pool-define-as vmdisk --type dir --target /data/vmfs/
1.3 create a storage pool
1 [[email protected] ~]# virsh pool-build vmdisk
1.4 view the defined storage pool
1 [[email protected] ~]# virsh pool-list --all
1.5 activate the storage pool
1 [[email protected] ~] # Virsh pool-autostart vmdisk # Set the storage pool to automatically start 2 [email protected] ~] # Virsh pool-start vmdisk
1.6 create a storage volume in the storage pool
1 [[email protected] ~]# virsh vol-create-as vmdisk test.qcow2 1G --format qcow2
1.6 other related commands
1 [[email protected] ~] # Virsh vol-delete -- pool vmdisk test. qcow2 # Delete Storage Volume 2 [[email protected] ~] # Virsh pool-destroy vmdisk # cancel the activated storage pool 3 [[email protected] ~] # Virsh pool-delete vmdisk # Delete the directory defined by the storage pool 4 [[email protected] ~] # Virsh pool-undefine vmdisk # cancel the definition of the storage pool
2 V2V migration 2.1 preparation source host: vm01-centos6.8 source VM name: KVM-host 172.24.8.32 destination host: kvm-host-2 172.24.8.41 Virtual Machine name after migration: vm01-cloud-centos6.8 source + Destination hosts all need to refer to creating the same virtualized storage pool. View the VM status of the target host.
Note: The virt-v2v only supports static migration, you must stop the VM to be migrated first. 2.2 move the VM disk to the storage pool
1 [[email protected] ~]# mv /data/images/vm01-centos6.8.img /data/vmfs/
2.3 formal migration method 1: migrate the source to the target
1 [[email protected] ~]# virt-v2v -oc qemu+ssh://172.24.8.41/system -os vmdisk -b br0 vm01-centos6.8
2.4 formal migration method 2: migration from the source
1 [[email protected] ~]# virt-v2v -ic qemu+ssh://172.24.8.32/system -os vmdisk -b br0 vm01-centos6.8
Note: If you do not have the virt-v2v command, you can install it using the Yum-y install virt-v2v.2.4 verification and adjustment attachment-Internal Migration
1 [[email protected] ~] # Virt-v2v-OC qemu + SSH: // 172.24.8.32/system-OS vmdisk-on vm01-clone-centos6.8-B br0 vm01-centos6.8 # self Migration Operations
- -OS: Specifies the storage pool in KVM;
- -Of: the format of the migrated VM Disk
011. Migration of KVM-V2V