§ 瀏覽學位論文書目資料
  
系統識別號 U0002-1209201610492000
DOI 10.6846/TKU.2016.00323
論文名稱(中文) 改善Xen虛擬機器狀態備份機制
論文名稱(英文) Improving the State Snapshot Mechanism for Virtual Machines in Xen
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 電機工程學系碩士班
系所名稱(英文) Department of Electrical and Computer Engineering
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 104
學期 2
出版年 105
研究生(中文) 黃彥嘉
研究生(英文) YEN-CHIA HUANG
學號 602450032
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2016-06-17
論文頁數 55頁
口試委員 指導教授 - 莊博任
委員 - 陳省隆
委員 - 許獻聰
關鍵字(中) 虛擬化
Snapshot
Xen
關鍵字(英) Virtualization
Snapshot
Xen
第三語言關鍵字
學科別分類
中文摘要
雲端運算服務,其服務環境通常是由許多的虛擬機器所組成,然而在一台電腦,多個虛擬機器的情況下,電腦軟硬體難免會發生錯誤,而造成系統的損毀,因此雲端服務供應商必須隨時做好虛擬系統的備份,但一般的系統備份必須在系統停機的狀況下才能進行,這對雲端服務來說是不能被忍受的,為了讓虛擬化系統能隨時備份,且不影響其服務,因此有了許多的snapshot技術被提出來,讓虛擬化系統能在不停機的狀況下進行備份。
虛擬化系統的snapshot,主要有硬碟跟狀態的備份,當系統故障或其他原因,就能靠snapshot產生的備份檔來還原系統到備份時的時間點。在Xen,硬碟的snapshot最基本的就是靠Linux系統裡的Logical Volume Manager,而狀態的snapshot靠的就是Xen的指令save。save指令會讓虛擬機器停機,並產生該虛擬機器的狀態映像檔,此映像檔生成的時間根據虛擬機器的記憶體大小,大約是幾十秒不等,對雲端服務來說,這樣的停機時間是不被允許的。
在許多分散式系統snapshot研究中,VNsnap發現了Xen虛擬機器狀態的snapshot造成了很長的停機時間,因此他們提出了自己的虛擬機器狀態的snapshot機制,透過修改Xen的migration功能,由一台主機扮演目標主機,接收並存放虛擬機器狀態的snapshot檔,來達成降低停機時間的目的。因為此方法修改自live migration,我們稱這個方法為live-migrated save。
本論文提出了另外的虛擬機器狀態的snapshot機制,透過修改Xen的save功能,讓其能夠即時備份虛擬機器狀態到本地主機,因此不用像live-migrated save,需要額外的守護行程去接收資料,也不會因為透過網路持續傳送許多記憶體資料,因而浪費了網路頻寬資源。
本論文比較了Xen的save、live-migrated save跟本論文提出的方案,並將live-migrated save比對Xen的migration,指出其差異性。在snapshot過程中,domU持續地寫入資料到其記憶體,使其記憶體dirty,並透過Credit Scheduler設定domU的CPU cap程度,使其產生不同程度的記憶體dirty頻率,再藉由指令參數-vvv,讓系統顯示更加詳細的訊息,來取得停機時間、執行時間跟傳輸的資料量的數據。最後透過實驗數據證明,本論文所提出的方案能夠在停機時間、執行時間與live-migrated save相似的情況下,節省了傳輸的開銷。
英文摘要
The environment of cloud service often consists of many virtual machines, however, in the case of a computer which is composed of multiple virtual machines, some inevitable errors of computer hardware or software would occur, resulting in damage to the system. Accordingly, the providers of cloud service must make a backup of virtual systems. The general system backup must be run under the condition of system down, which cannot be allowed in the cloud service. In order to let the virtualization system to backup at any time without affecting its service, a lot of snapshot techniques have been proposed to allow the virtualization system to backup without downtime.
The snapshot of virtualization system contains backup of hard disk and backup of state of system, when a system failure or other situations, it can restore the system to checkpoint by backup file which was generated by snapshot. In Xen, the snapshot of hard disk is depending on the Linux system’s Logical Volume Manager, and the state snapshot is depending Xen’s “save” command. Save command will shut the virtual machine down and generate the image file of state of the virtual machine, and the generation time of image file is based on memory size of the virtual machine, which is approximately several tens of seconds. For cloud services, such a downtime is not allowed.
In the research of snapshots in distributed systems, VNsnap finds that the snapshot of Xen virtual machine state causes a long downtime, so they propose a state snapshot mechanism of the virtual machine by modifying Xen’s migration function, and a host plays the target host to receive and store the state snapshot files of the virtual machine to achieve the purpose of reducing downtime. Because this method is modified from live migration, we call this method of “live-migrated save”.
This paper proposes another snapshot mechanism of state of virtual machine. By modifying Xen’s “save” function, it could make the real time backup of virtual machine state to the local host. Unlike “live-migrated save”, it does not demand daemon to receive data, so wasting of the resources of network bandwidth due to continuous transfer of memory data through the Internet will not occur.
This paper compares three methods, Xen’s “save”, “live-migrated save”, and the method which is proposed in this paper, and also compares the “live-migrated save” with the Xen’s migration, to point out their differences. During the snapshot, domU continuously writes data to its memory to make memory dirty, and we set the domU’s CPU cap by Credit Scheduler to produce different degrees of dirty frequency. Then, the command line parameter “-vvv” allows the system to display more detailed message to get the data of downtime, the execution time, and the amount of data transferred. Finally, experimental and simulation results prove that our method can save the cost of transmission under the condition that our downtime and execution time are similar to live-migrated save’s.
第三語言摘要
論文目次
目錄
第一章、緒論	1
1.1、研究動機	1
1.2、問題描述與解決方案	2
1.3、論文架構	3
第二章、相關研究背景	4
2.1、虛擬化(Virtualization)[6]	4
2.1.1、Xen[7]	6
2.1.2、KVM[9]	8
2.2、Snapshot	9
2.2.1、LVM[11]	9
2.2.2、Xen的Save指令	10
2.3、機器遷移	10
2.3.1、遷移型式	12
2.3.2、Xen’s Live Migration疊代機制	20
2.4、VNsnap提出的狀態snapshot	22
2.4.1、Xen的Save、Migrate指令與Live-migrated Save的差異	23
第三章、提出之新方法	25
3.1、Live Save	25
3.1.1、Live-migrated Save問題	25
3.1.2、新方法	25
3.2、Improved Live Save	26
3.2.1、Dirty頻率過高	26
3.2.2、改良方案	28
第四章、模擬評估	30
4.1、實驗環境	30
4.1.1、Dirty頻率與CPU cap關係	31
4.1.2、每次疊代產生的dirty page數與CPU cap關係	32
4.1.3、平均每次疊代的時間與CPU cap關係	35
4.1.4、疊代次數與CPU cap關係	37
4.2、停機時間評估	39
4.3、總執行時間評估	42
4.4、總傳輸page數評估	44
4.5、評估彙整與討論	46
4.5.1、透過設定CPU cap對snapshot的效果探討	49
第五章、結論	50
參考文獻	53

圖目錄
圖2.1、虛擬化前後示意圖	5
圖2.2、Native與Hosted虛擬化架構比較	6
圖2.3、Xen半虛擬化與全虛擬化基本架構	7
圖2.4、簡單複製遷移流程圖	14
圖2.5、後複製遷移流程圖	16
圖2.6、預複製遷移流程圖	18
圖2.7、Xen’s Live Migration流程圖	20
圖3.1、Improved Live Save虛擬碼	29
圖4.1、遷移環境	30
圖4.2、dirty頻率與CPU cap關係	32
圖4.3、VM記憶體1GB,每次疊代產生的dirty page數與CPU cap關係	33
圖4.4、VM記憶體2GB,每次疊代產生的dirty page數與CPU cap關係	33
圖4.5、dirty頻率(pages/s)與CPU cap關係	34
圖4.6、VM記憶體1GB,平均每次疊代的時間與CPU cap關係	36
圖4.7、VM記憶體2GB,平均每次疊代的時間與CPU cap關係	36
圖4.8、VM記憶體1GB,疊代次數與CPU cap關係	37
圖4.9、VM記憶體2GB,疊代次數與CPU cap關係	38
圖4.10、VM記憶體1GB時的停機時間	40
圖4.11、VM記憶體2GB時的停機時間	40
圖4.12、VM記憶體1GB時的總執行時間	43
圖4.13、VM記憶體2GB時的總執行時間	43
圖4.14、VM記憶體1GB時的總傳輸page數	45
圖4.15、VM記憶體2GB時的總傳輸page數	45
 

表目錄
表2.1、記憶體頁面傳送增值表	21
表2.2、Save、Migrate、Live-migrated Save比較	23
表4.1、VM記憶體1GB的平均每輪疊代所產生的dirty page數量CPU cap1到cap34及idle的數據	35
表4.2、VM記憶體1GB的平均每輪疊代時間乘上dirty頻率CPU cap1到cap34及idle的數據	35
表4.3、VM記憶體1GB的停機時間CPU cap1到cap25及idle的數據	41
表4.4、VM記憶體2GB的停機時間CPU cap1到cap25及idle的數據	41
表4.5、Save、Live-migrated Save、Live Save比較	47
表4.6、Save、Live-migrated Save、Live Save、Improved Live Save評估比較	49
參考文獻
[1]	A. Kangarlou, D. Xu, P. Ruth, and P. Eugster, “Taking snapshots of virtual networked environments,” Proc. 3rd Int. Work. Virtualization Technol. Distrib. Comput. - VTDC ’07, pp. 1–8, 2007.
[2]	A. Kangarlou, P. Eugster, and D. Xu, “VNsnap: Taking snapshots of virtual networked environments with minimal downtime,” in 2009 IEEE/IFIP International Conference on Dependable Systems & Networks, 2009, pp. 524–533.
[3]	A. Kangarlou, P. Eugster, and D. Xu, “VNsnap: Taking snapshots of virtual networked infrastructures in the cloud,” IEEE Trans. Serv. Comput., vol. 5, no. 4, pp. 484–496, 2012.
[4] 	Migration, http://wiki.xen.org/wiki/Migration
[5]	C. Clark, K. Fraser, S. Hand, J. G. Hansen, E. Jul, C. Limpach, I. Pratt, and A. Warfield, “Live migration of virtual machines,” NSDI’05 Proc. 2nd Conf. Symp. Networked Syst. Des. Implement., no. Vmm, pp. 273–286, 2005.
[6]	Virtualization, https://en.wikipedia.org/wiki/Virtualization
[7]	Xen project, http://www.xenproject.org/
[8]	Paravirtualization (PV), http://wiki.xen.org/wiki/Paravirtualization_(PV)
[9]	Kernel Based Virtual Machine, http://www.linux-kvm.org
[10]	QEMU, http://wiki.qemu.org/Main_Page
[11]	Red Hat, Inc., "LVM Architectural Overview" , https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/LVM_definition.html
[12]	Network File System, https://en.wikipedia.org/wiki/Network_File_System
[13]	Credit Scheduler, http://wiki.xensource.com/wiki/Credit_Scheduler
[14]	Y. Wu and M. Zhao, “Performance Modeling of Virtual Machine Live Migration,” Cloud Comput. (CLOUD), 2011 IEEE Int. Conf., pp. 492–499, 2011.
[15]	H. C. Architecture, “以混合式複製遷移技術 提高虛擬機器即時遷移之效能 Improving the Live migration of Virtual Machines with Hybrid Copy Architecture,” no. January, 2012.
[16]	林逸偉 T A - Yi-Wei Lin, “雲端運算即時轉移記憶體預測機率之改善研究 TT  - The Improvement of Predicted Probability with Cloud Computing Memory Live Migration,” 電機工程學系碩士在職專班, vol. 碩士, p. 38 NI  – 臺灣博碩士論文知識加值系統 LG  – 中文, 2013.
[17]	褚祸勇, 肖 侬, 蔡志平, 等."虚拟机备份机制研究". 计算机工程与科学, 2009, 31(9): 131-134.
論文全文使用權限
校內
紙本論文於授權書繳交後1年公開
同意電子論文全文授權校園內公開
校內電子論文於授權書繳交後1年公開
校外
同意授權
校外電子論文於授權書繳交後1年公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信