[[PageOutline]] {{{ #!html

Unattended Simulated Mode

}}} ---- = 【0.架構】 = [[Image(mode_unattended_simulation.png,width=600px)]] * Haizea Configuration File - 一個文字檔包含一些選項 * Request Tracefile - 一個文字檔包含了租約的需求 ---- = 【1.配置】 = == 【1.1 Haizea Configuration File】 == || 從上圖架構知道,要使用 Haiea 的第一步便是要撰寫一篇好的 Haizea Configuration File,官方文件說可以參考範例檔 /usr/share/haizea/etc/sample_trace.conf 和 sample_trace_barebones (兩個文件內容一樣,只差再第2份沒註解),文檔中要注意的地方是 option 的設定和配置 || * 以下面範例來解說 option,便是'''『模擬』''' '''2006-11-25 下午1點'''開始執行任務在 '''4台有1顆CPU 和1G Ram 的機器'''上執行 ([simulation]->屬性名稱,startime、resources->屬性細部設定) {{{ #!sh [simulation] starttime: 2006-11-25 13:00:00 resources: 4 CPU:100 Memory:1024 }}} * [[Image(quickstart_leasegraph2.png,width=300px)]] * [http://haizea.cs.uchicago.edu/manual/node63.html#app:conffile 參考的屬性值] [[BR]] == 【1.2 Tracefile File】 == || 而 Tracefile 便是在 Haizea Configuration File 中的 [tracefile] 屬性指定|| {{{ #!sh [tracefile] tracefile: /usr/share/haizea/traces/sample.lwf }}} * 此 Tracefile 範例檔的格式為 LWF/Lease Workload Format (類似 XML 的格式) {{{ #!sh A simple trace where an AR lease preempts a best-effort lease that is already running. }}} * [http://haizea.cs.uchicago.edu/manual/node71.html#app:lwf XML 格式參考] ---- = 【2.開始模擬】 = ||現在我們使用已寫好的範例 configuration(sample_trace.conf) 和 tracefile(sample.lwf),便可透過haizea 指令開始執行模擬 (參數 -c 為指定設定檔)|| == 【2.1 範例一】 == {{{ # haizea -c /usr/share/haizea/etc/sample_trace.conf [2006-11-25 13:00:00.00] RM Starting resource manager [2006-11-25 13:00:00.00] TFILE Loading tracefile /usr/share/haizea/traces/sample.lwf [2006-11-25 13:00:00.00] TFILE Loaded workload with 0 requests () [2006-11-25 13:00:00.00] CLOCK Starting simulated clock [2006-11-25 13:00:00.00] CLOCK Simulated clock has stopped [2006-11-25 13:00:00.00] RM Stopping resource manager gracefully... [2006-11-25 13:00:00.00] RM --- Haizea status summary --- [2006-11-25 13:00:00.00] RM Number of leases (not including completed): 0 [2006-11-25 13:00:00.00] RM Completed leases: 0 [2006-11-25 13:00:00.00] RM ---- End summary ---- }}} * 此結果輸出主要有三類:'''RM'''(Resource Manager)、'''TFILE'''(!TraceFile)、'''CLOCK''' * RM Starting resource manager:啟動資源管理者 * TFILE Loading tracefile /usr/share/haizea/traces/sample.lwf:載入 tracefile * TFILE Loaded workload with 0 requests ():此範例檔並無租約要求 * CLOCK Starting simulated clock:開始模擬的 clock * CLOCK Simulated clock has stopped:停止模擬的 clock == 【2.2 範例一之版本1】 == * 現在我們修改 !TraceFile (將註解的第18行和第34行打開) {{{ #!sh 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 }}} * 再執行它 {{{ # haizea -c /usr/share/haizea/etc/sample_trace.conf [2006-11-25 13:00:00.00] RM Starting resource manager [2006-11-25 13:00:00.00] TFILE Loading tracefile /usr/share/haizea/traces/sample.lwf [2006-11-25 13:00:00.00] TFILE Loaded workload with 1 requests (1 Best-effort) [2006-11-25 13:00:00.00] CLOCK Starting simulated clock [2006-11-25 13:00:00.00] LSCHED Lease #1 has been requested. [2006-11-25 13:00:00.00] LSCHED Lease #1 has been marked as pending. [2006-11-25 13:00:00.00] LSCHED Queued best-effort lease request #1, 1 nodes for 01:00:00.00. [2006-11-25 13:00:00.00] LSCHED Next request in the queue is lease 1. Attempting to schedule... [2006-11-25 13:00:00.00] VMSCHED Lease #1 has been scheduled on nodes [1] from 2006-11-25 13:00:00.00 to 2006-11-25 14:00:00.00 [2006-11-25 13:00:00.00] VMSCHED Started VMs for lease 1 on nodes [1] [2006-11-25 14:00:00.00] VMSCHED Stopped VMs for lease 1 on nodes [1] [2006-11-25 14:00:00.00] VMSCHED Lease 1's VMs have shutdown. [2006-11-25 14:00:00.00] CLOCK Simulated clock has stopped [2006-11-25 14:00:00.00] RM Stopping resource manager gracefully... [2006-11-25 14:00:00.00] RM --- Haizea status summary --- [2006-11-25 14:00:00.00] RM Number of leases (not including completed): 0 [2006-11-25 14:00:00.00] RM Completed leases: 1 [2006-11-25 14:00:00.00] RM ---- End summary ---- }}} * 兩個 CLOCK 之間多了LSCHED(租約排程) 和 VMSCHED(VM排程) * LSCHED Lease !#1 has been requested. * LSCHED Lease !#1 has been marked as pending. * LSCHED Queued best-effort lease request !#1, 1 nodes for 01:00:00.00. * LSCHED Next request in the queue is lease 1. Attempting to schedule... * VMSCHED Lease !#1 has been scheduled on nodes ![1] from 2006-11-25 13:00:00.00 to 2006-11-25 14:00:00.00 * VMSCHED Started VMs for lease 1 on nodes ![1] * VMSCHED Stopped VMs for lease 1 on nodes ![1] * VMSCHED Lease 1's VMs have shutdown. * [[Image(http://haizea.cs.uchicago.edu/manual/quickstart_leasegraph2.png,width=350px)]]<- 流程圖解:此 Best-effort 租約要求一台 node 在 13:00時,並持續擁有資源此 1小時 == 【2.2 範例一之版本2】 == * 繼續修改 !TraceFile (再把註解的第37行和第55行打開) {{{ #!sh 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 }}} * 執行它 {{{ # haizea -c /usr/share/haizea/etc/sample_trace.conf [2006-11-25 13:00:00.00] RM Starting resource manager [2006-11-25 13:00:00.00] TFILE Loading tracefile /usr/share/haizea/traces/sample.lwf [2006-11-25 13:00:00.00] TFILE Loaded workload with 2 requests (1 Best-effort + 1 AR) [2006-11-25 13:00:00.00] CLOCK Starting simulated clock [2006-11-25 13:00:00.00] LSCHED Lease #1 has been requested. [2006-11-25 13:00:00.00] LSCHED Lease #1 has been marked as pending. [2006-11-25 13:00:00.00] LSCHED Queued best-effort lease request #1, 1 nodes for 01:00:00.00. [2006-11-25 13:00:00.00] LSCHED Next request in the queue is lease 1. Attempting to schedule... [2006-11-25 13:00:00.00] VMSCHED Lease #1 has been scheduled on nodes [1] from 2006-11-25 13:00:00.00 to 2006-11-25 14:00:00.00 [2006-11-25 13:00:00.00] VMSCHED Started VMs for lease 1 on nodes [1] [2006-11-25 13:15:00.00] LSCHED Lease #2 has been requested. [2006-11-25 13:15:00.00] LSCHED Lease #2 has been marked as pending. [2006-11-25 13:15:00.00] LSCHED Scheduling AR lease #2, 4 nodes from 2006-11-25 13:30:00.00 to 2006-11-25 14:00:00.00. [2006-11-25 13:15:00.00] LSCHED Must preempt leases [1] to make room for lease #2 [2006-11-25 13:15:00.00] LSCHED Preempting lease #1... [2006-11-25 13:15:00.00] LSCHED ... lease #1 will be suspended at 2006-11-25 13:30:00.00. [2006-11-25 13:15:00.00] LSCHED AR lease #2 has been scheduled. [2006-11-25 13:29:28.00] VMSCHED Stopped VMs for lease 1 on nodes [1] [2006-11-25 13:29:28.00] VMSCHED Suspending lease 1... [2006-11-25 13:30:00.00] VMSCHED Lease 1 suspended. [2006-11-25 13:30:00.00] VMSCHED Started VMs for lease 2 on nodes [2, 3, 4, 1] [2006-11-25 13:30:00.00] LSCHED Next request in the queue is lease 1. Attempting to schedule... [2006-11-25 13:30:00.00] VMSCHED Lease #1 has been scheduled on nodes [1] from 2006-11-25 14:00:00.00 (resuming) to 2006-11-25 14:31:04.00 [2006-11-25 14:00:00.00] VMSCHED Stopped VMs for lease 2 on nodes [2, 3, 4, 1] [2006-11-25 14:00:00.00] VMSCHED Resuming lease 1... [2006-11-25 14:00:00.00] VMSCHED Lease 2's VMs have shutdown. [2006-11-25 14:00:32.00] VMSCHED Resumed lease 1 [2006-11-25 14:00:32.00] VMSCHED Started VMs for lease 1 on nodes [1] [2006-11-25 14:31:04.00] VMSCHED Stopped VMs for lease 1 on nodes [1] [2006-11-25 14:31:04.00] VMSCHED Lease 1's VMs have shutdown. [2006-11-25 14:31:04.00] CLOCK Simulated clock has stopped [2006-11-25 14:31:04.00] RM Stopping resource manager gracefully... [2006-11-25 14:31:04.00] RM --- Haizea status summary --- [2006-11-25 14:31:04.00] RM Number of leases (not including completed): 0 [2006-11-25 14:31:04.00] RM Completed leases: 2 [2006-11-25 14:31:04.00] RM ---- End summary ---- }}} * [[Image(http://haizea.cs.uchicago.edu/manual/quickstart_leasegraph3.png,width=350px)]] <- 流程圖解:第1個租約(Best-effort lease)要求一台 node 在 13:00時,並持續擁有資源此 1 小時,到了13:15分時,第2個租約(AR lease)要求出現,他需要 4 台 node 再 13:30開始執行,並持續擁有資源 30 分鐘 (因為AR lease 優先權高於 Best-effort lease,所以到了13:30時,將第1個租約先 suspend起來,等到13:30 第2個資約完成後,才resume回來繼續執行租約1)