virtualization--storage migration

原文網址:http://www.server-world.info/en/note?os=CentOS_6&p=kvm&f=14

This is the example to use Storage Migration function for virtual machines.
本節演示了虛擬機存儲遷移功能。

The different point of Storage Migration from Live Migration is that Storage Migration does not need a Storage server which has virtual machine images, when executing

存儲遷移與在線遷移的不同點是:當執行遷移時,存儲遷移不需要有一個存有虛擬機鏡像的存儲服務器。


Storage Migration, virtual machine image on a KVM host is migrated on another KVM host like follows.

存儲遷移,將一臺KVM主機上的虛擬機鏡像遷移到另一臺KVM主機上,如下圖示:

         Storage Migration
                        <------------------->
                        
+----------------------+                     +----------------------+
|  [   KVM Host #1  ]  |10.0.0.21   10.0.0.22|  [  KVM Host #2   ]  |
|                      +---------------------+                      |
|  kvm01.server.world  |                     |  kvm02.server.world  |
+----------------------+                     +----------------------+

1、Create a virtual machine on a KVM host.

在一個KVM主機上創建一個虛擬機鏡像。


2、Show the file size of a virtual machine image like follows on a KVM host and move to another KVM host, create a empty disk space like follows.

按如下方式,在一個KVM主機上顯示要遷移到另一個KVM主機上的虛擬機鏡像文件的大小,按如下方式創建一個空磁盤空間。

# show the size of Virtual machine

[root@kvm01 ~]#ll /var/kvm/images
total 846468
-rwxr-xr-x 1 root root 32212254720 Aug  6 22:00 centos.img

### on another KVM host ###
# create a disk space which is the same size of a virtula machine
[root@kvm02 ~]#fallocate -l 32212254720 /var/kvm/images/centos.img
[root@kvm02 ~]#ll /var/kvm/images
total 31457284
-rw-r--r-- 1 root root 32212254720 Aug  6 22:10 centos.img 

3、It's OK all, execute Storage Migration like follows.

一切正常運行後,按如下方式執行存儲器遷移:

[root@kvm01 ~]#virsh list

 Id    Name             State
--------------------------------------
 2     centos           running

[root@kvm01 ~]#virsh migrate --live --copy-storage-all centos qemu+ssh://10.0.0.22/system
[email protected]'s password:
[root@kvm01 ~]#virsh list
 Id    Name             State
--------------------------------------
 
# just migrated
### on another KVM host ###

[root@kvm02 ~]#virsh list
 Id    Name              State
---------------------------------------
 1     centos            running

# back to another host, it's OK to execute normal Live Migration

[root@kvm02 ~]#virsh migrate --live centos qemu+ssh://10.0.0.21/system
[email protected]'s password:
[root@kvm02 ~]#virsh list
 Id    Name             State
--------------------------------------


發佈了3 篇原創文章 · 獲贊 0 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章