Project

General

Profile

root / trunk / doc / manual / appendix_lwf.tex @ 705

1
Haizea uses XML to encode certain information, most notably in the LWF (Lease Workload File) files. This chapter describes three XML elements that are used in various Haizea components, and also describes the LWF format.
2

    
3
\section{Nodes element}
4

    
5
A \texttt{<nodes>} element is used to describe a collection of machines (``nodes''), such as those required by a lease or those in a simulated site. Instead of describing each node individually, the \texttt{<nodes>} stores information on each distinct node capacity along with the number of nodes with that capacity. For example, if a lease required 5 nodes with 1024MB of memory and 10 nodes with 2048GB of memory, the \texttt{<nodes>} will have two ``sets of nodes'', instead of 15 individual entries.
6

    
7
The root \texttt{<nodes>} element has no attributes:
8

    
9
\begin{wideshellverbatim} 
10
<nodes>
11
  ...
12
</nodes>
13
\end{wideshellverbatim}
14

    
15
And must contain one or more \texttt{node-set} element:
16

    
17
\begin{wideshellverbatim} 
18
<node-set numnodes="...">
19
  ...
20
</node-set>
21
\end{wideshellverbatim}
22

    
23
Each \texttt{<node-set>} element represents a ``set of nodes''. The \texttt{numnodes} attribute is used to denote the number of nodes with the same capacity. This capacity is described with one or more \texttt{<res>} elements:
24

    
25
\begin{wideshellverbatim} 
26
<res type="..." amount="..."/>
27
\end{wideshellverbatim}
28

    
29
The \texttt{type} attribute specifies the type of resource (\texttt{CPU}, \texttt{Memory}, etc.), and \texttt{amount} specifies the amount of that resource in each node (the amount must be a positive integer). There resource type must be a string and, although the \texttt{<res>} element places no restrictions on this string (i.e., you can use any arbitrary resource you want), the \texttt{<lease>} and \texttt{<site>} elements (described below) do place some restrictions on it.
30

    
31
\subsection{Example}
32

    
33
The following specifies a collection of 12 nodes, all with one CPU, four with 1024MB of memory and eight with 2048MB of memory.
34

    
35
\begin{wideshellverbatim} 
36
<nodes>
37
  <node-set numnodes="4">
38
    <res type="CPU" amount="100"/>
39
    <res type="Memory" amount="1024"/>
40
  </node-set>
41
  <node-set numnodes="8">
42
    <res type="CPU" amount="100"/>
43
    <res type="Memory" amount="2048"/>
44
  </node-set>
45
</nodes>
46
\end{wideshellverbatim}
47

    
48

    
49
\section{Lease element}
50

    
51
The \texttt{<lease>} element is used by Haizea's XML-RPC API to send lease requests to Haizea, and to return lease information to the client. It is also used in the LWF format to describe lease requests.
52

    
53
The \texttt{<lease>} element has two attributes: \texttt{id}, a unique integer identifier (assigned by Haizea), and \texttt{preemptible}, indicating whether the lease can be safely preempted (\texttt{yes} or \texttt{no})
54

    
55
\begin{wideshellverbatim} 
56
<lease id="..." preemptible="...">
57
  ...
58
</lease>
59
\end{wideshellverbatim}
60

    
61
The \texttt{<lease>} element has four child elements:
62

    
63
\begin{itemize}
64
 \item \texttt{<nodes>} (as described above): Specifies the nodes requested by the lease, and the capacity required in these nodes.
65
 \item \texttt{<duration>}: The requested duration of the lease. This element has a single attribute \texttt{time} which is used to specify a duration with format \texttt{DD:HH:MM.SS} (DD: days; HH: hours; MM: minutes; SS: seconds)
66
 \item \texttt{<start>}: The requested started time of the lease. If the element is empty, this means the requested starting time is unspecified, and it is up to Haizea to determine the starting time on a best-effort basis:
67
\begin{wideshellverbatim} 
68
<start/>
69
\end{wideshellverbatim}
70

    
71
If an exact starting time is specified, then this element has an \texttt{<exact>} child element with a \texttt{time} attribute specifying the starting time using an ISO timestamp (\texttt{YYYY-MM-DD HH:MM:SS}) or a relative starting time (\texttt{+DD:HH:MM:SS}), which is interpreted as being relative to the time the lease is submitted to Haizea.
72

    
73
\begin{wideshellverbatim} 
74
<start>
75
  <exact time="..."/>
76
</exact>
77
\end{wideshellverbatim}
78

    
79
If the lease is requested to start immediately, then this element has an empty \texttt{<now>} child element:
80

    
81
\begin{wideshellverbatim} 
82
<start>
83
  <now/>
84
</exact>
85
\end{wideshellverbatim}
86

    
87
 \item \texttt{<software>}: The software environment required by the lease. Currently, Haizea only supports specifying a lease's software environment as being contained inside a disk image:
88

    
89
\begin{wideshellverbatim} 
90
<software>
91
  <disk-image id="..." size="..."/>
92
</software>
93
\end{wideshellverbatim}
94

    
95
The \texttt{disk-image} child element specifies information about the disk image: \texttt{id}, a unique identifier, and \texttt{size}, its size in megabytes.
96

    
97
Additionally, the software environment can be left unspecified, which means that Haizea can assume that setting up the software environment will be handled by another entity:
98

    
99
\begin{wideshellverbatim} 
100
<software>
101
  <none/>
102
</software>
103
\end{wideshellverbatim}
104

    
105
\end{itemize}
106

    
107

    
108
\subsection{Example}
109

    
110
The following specifies a best-effort lease, requesting one node with one CPU and 1024 MB of memory, for one hour, and a software environment contained in diskimage \texttt{foobar1.img} (a 1GB image).
111

    
112
\begin{wideshellverbatim} 
113
<lease id="1" preemptible="true">
114
  <nodes>
115
    <node-set numnodes="1">
116
      <res amount="100" type="CPU"/>
117
      <res amount="1024" type="Memory"/>
118
    </node-set>
119
  </nodes>
120
  <start/>
121
  <duration time="01:00:00"/>
122
  <software>
123
    <disk-image id="foobar1.img" size="1024"/>
124
  </software>
125
</lease>
126
\end{wideshellverbatim}
127

    
128
\section{Site element}
129

    
130
The \texttt{<site>} element is used in LWF files to describe the site the lease workload is meant to be run on. In future versions of Haizea, it will also be used to specify simulated sites from the configuration file.
131

    
132
The \texttt{<site>} has two child elements: \texttt{<resource-types>}, used to specify the valid resource types in the site (separated by spaces), and a \texttt{<nodes>} element specifying the nodes in the site:
133

    
134
\begin{wideshellverbatim} 
135
<site>
136
  <resource-types names="..."/>
137
  <nodes>
138
    ...
139
  </nodes>
140
</site>
141
\end{wideshellverbatim} 
142

    
143
The nodes can only have resources specified in \texttt{<resource-types>}. For example, if \texttt{"CPU Memory"} is specified, then the \texttt{type} attribute of the \texttt{<res>} elements in \texttt{<nodes>} can only be \texttt{CPU} or \texttt{Memory}. Note that Haizea doesn't ``understand'' what these types are, and treats them all as consumable capacities, so you can specify any resource types you want. However, Haizea does require that, at the very least, all sites specify at least a \texttt{CPU} and a \texttt{Memory} resource.
144

    
145
\subsection{Example}
146
The following specifies a site supporting three types of resources: \texttt{CPU}, \texttt{Memory}, and \texttt{Ponies}. Again, Haizea does not interpret the resource type names (other than \texttt{CPU} and \texttt{Memory}), so it is up to you to interpret what the \texttt{Ponies} resource type means, and what it means for a lease to request ponies. 
147

    
148
The site has eight nodes, all with one CPU and 1024MB of memory. Four of them have four ponies, and the other four have none (if no amount is specified for a resource type, it defaults to zero).
149

    
150
\begin{wideshellverbatim} 
151
<site>
152
  <resource-types names="CPU Memory Ponies"/>
153
  <nodes>
154
    <node-set numnodes="4">
155
      <res type="CPU" amount="100"/>
156
      <res type="Memory" amount="1024"/>
157
      <res type="Ponies" amount="4"/>
158
    </node-set>
159
    <node-set numnodes="4">
160
      <res type="CPU" amount="100"/>
161
      <res type="Memory" amount="1024"/>
162
    </node-set>
163
  </nodes>
164
</site>
165
\end{wideshellverbatim} 
166

    
167
\section{LWF file format}
168

    
169
The LWF (Lease Workload Format) describes a workload of leases that can be used by Haizea when running in simulation mode. In this workload, the starting time is \texttt{00:00:00:00}, and all times are specified relative to that starting time. For example, an AR lease requested to start at \texttt{00:01:00:00} starts one hour after the start of the workload. Each lease also has an \texttt{arrival time}, the time at which the lease is submitted to Haizea.
170

    
171
The root element of an LWF file is the \texttt{<lease-workload>} element:
172

    
173
\begin{wideshellverbatim} 
174
<lease-workload name="...">
175
  <description>
176
	...
177
  </description>
178
  
179
  <site>
180
    ...
181
  </site>
182
  
183
  <lease-requests>
184
    ...
185
  </lease-requests>
186
</lease-workload>
187
\end{wideshellverbatim} 
188

    
189
This element has a single attribute \texttt{name}, with the name of this workload. The \texttt{<description>} child element can be used to provide a longer description of the workload. The \texttt{<site>} element is used to specify the site the workload is meant to be run on, and the \texttt{<lease-request>} element contains the actual lease requests. Each \texttt{<lease>} element is wrapped inside a \texttt{<lease-request>} element:
190

    
191
\begin{wideshellverbatim} 
192
<lease-request arrival="...">
193
  <realduration time="..."/>
194
  <lease ...>
195
      ...
196
  </lease>
197
</lease-request>
198
\end{wideshellverbatim} 
199

    
200
This element has an attribute \texttt{arrival} indicating when the lease is submitted to Haizea. It can also have an \emph{optional} \texttt{<realduration>} child element specifying the real duration of the lease. In many systems, users request resources for a period of time, but relinquish the resources earlier. When simulating workloads, it is important to take this information into account, since the simulator must stop the lease at the end of that ``real duration'', not at the end of the full requested duration. Note that, if a \texttt{<realduration>}, Haizea will still schedule the lease assuming it is going to use its full requested duration (since, like a non-simulated scheduler, it can't assume to have a priori knowledge of when the lease will really end), but the simulator will generate an event indicating the lease has ended prematurely when its ``real duration'' has elapsed.