[[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.
== 【2.2 範例一之版本2】 ==
* 繼續修改 !TraceFile (再把註解的第37行和第55行打開)
{{{
#!sh
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
}}}
[[BR]]