Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
章 11. 遷移一個網域
遷移代表著一個執行中的虛擬網域由一台實體的主機轉移到另外一個。Red Hat 虛擬化支援兩種型式的遷移,那就是離線(offline)與即時(live)。offline 的遷移是以暫停一台虛擬主機來將它由一台主機移動至另外一個。暫停之後傳輸它的記憶體,之後再由主機目的地上回復它。live 的遷移所做的是相同的,但卻不會直接的影響到網域。當執行一項 live 遷移時,網域會持續著它的異常運作,不過以使用者的角度來看的話是不會注意到的。要啟動一項 live 遷移的話,兩台主機都一定得執行 Red Hat 虛擬化與 xend daemon。目的地主機一定要擁有足夠的資源(像是記憶體容量)來容納遷移以後的網域頻寬。來源與目的地的主機都必須要有相同的架構與虛擬化分機(像是i386-VT、x86-64-VT、x86-64-SVM、等等。)並且必須是在相同的 L2 子網上。
When a domain migrates its MAC and IP addresses move with it. Only virtual machines with the same layer-2 network and subnets will successfully migrate. If the destination node is on a different subnet, the administrator must manually configure a suitable EtherIP or IP tunnel in the remote node of domain0. The xend daemon stops the domain and copies the job over to the new node and restarts it. The Red Hat Virtualization RPM does not enable migration from any other host except the localhost (see the /etc/xend-config.sxp file for information). To allow the migration target to accept incoming migration requests from remote hosts, you must modify the target's xen-relocation-hosts-allow parameter. Be sure to carefully restrict which hosts are allowed to migrate, since there is no authentication.
因為這些網域擁有很大的檔案設定,所以這些程序可能會很花時間。假如您以開放式網路連結來遷移一個網域的話,它們將會被保留在主機的目的地上,並且 SSH 連結應該還會繼續運作。預設的 Red Hat 虛擬化 iptable 規則不允許新進的遷移連結。如要允許的話您必須明確的建立 iptables 的規則。
您能夠使用 xm 遷移指令來執行一項離線的遷移(offline migration):
xm migrate domain-id [destination domain]
您可以使用 xm 的遷移指令來執行一項即時的遷移(live migration):
xm migrate domain-id -l [destination domain]
You may need to reconnect to the domain's console on the new machine. You can use the xm console command to reconnect.