5.3 PSLA syntactic expression
5.3.3 Service Terms
ServiceTerm mainly contains functional descriptions. There are three kinds of ServiceTerm in WS-Ageement. They are ServiceDescriptionTerm, ServiceReference and ServiceProperties. ServiceDescriptionTerm and ServiceReference have the same syntax expression and they can be extended. ServiceDescriptionTerm is designed for domain specific description, and we have extended it to express "Metric Description". In PSLA, ServiceReference has been extended to describe a service provided by PaaS provider. One or more URIs are used to refer to the entry point of service. In WS-Agreement, ServiceProperties is used to packet all the QoS metrics as Variable which will be used in GuaranteeTerm. In this section, the syntactic expression of Service Term will be described in section 5.3.3. The syntactic expression of Service Description Term will be described in section 5.3.3. The syntactic expression of Service Reference will be described in section 5.3.3. The syntactic expression of Service Properties will be described in section 5.3.3.
<complexType name ="NamedElement" >
< a t t r i b u t e name ="Name" t y p e =" ID " u s e =" r e q u i r e d "/ > </ complexType >
68 CHAPTER 5. PSLA: SLADESCRIPTION LANGUAGE FORPAAS
NamedElement is a shared type defined in PSLA. As shown in LIST 5.5, an extension based on NamedElement must be tagged by a Name which is unique in the whole PSLA document. In PSLA, three types of elements are extended based on NamedElement, including InputdataType, ResourceType and MetricType.
Service Description Terms
< e l e m e n t name =" S e r v i c e D e s c r i p t i o n T e r m E x t e n s i o n " t y p e ="ocw : S e r v i c e D e s c r i p t i o n T e r m E x t e n s i o n T y p e "/ > <complexType name =" S e r v i c e D e s c r i p t i o n T e r m E x t e n s i o n T y p e " > < c h o i c e maxOccurs =" unbounded " > < e l e m e n t name ="M e t r i c" t y p e ="ocw : M e t r i c T y p e "/ > < e l e m e n t name ="I n p u t D a t a" t y p e ="ocw : I n p u t D a t a T y p e "/ > < e l e m e n t name ="R e s o u r c e" t y p e ="ocw : ResourceType "/ > </ c h o i c e >
</ complexType >
Listing 5.6. ServiceDescriptionTerm extension definition in PSLA.
In WS-Agreement, ServiceDescriptionTerms is designed to express domain specific service descriptions. ServiceDescriptionTerms can be extended for customer needs. In PSLA, Ser- viceDescriptionTerms, is extended as listing 5.6 to express Metric, InputData and Resource. They will be further used in Guarantee Terms to express QoS responsibilities and obligations unambiguously and clearly. Listing 5.7 is an example of ServiceDescriptionTerm in PSLA. The requests,"Atomic_Request_A" and "Atomic_Request_B", composing the workload are described as "InputData" of ServiceDescriptionTerm extension. computing resource, such as Jonas, Apache and MySQL, and storage resources, such as AppDiskID1, AppDiskID2 and Ap- pDiskID3, are described as "Resource" of ServiceDescriptionTerm extension. All the metrics which will be used in corresponding GuaranteeTerms 5.3.4 will be described here. For exam- ple, "RequestsThroughput", "Variation" and "Instructions" are the metircs which will be used to express the workload constraints in QualifyingCondition of GuaranteeTerms 5.3.4. "Mem- ory", "NetworkThroughput" and "Storage" are the metrics which will be used to express the scalability constraints in QualifyingCondition of GuaranteeTerms 5.3.4. "ResponseTime" and "Availability" are the metrics which will be used to express the scalability constraints in QoS requirements of GuaranteeTerms 5.3.4. It can also be the case that there is no Metric, no Input- Data or no Resource. < w s a g : S e r v i c e D e s c r i p t i o n T e r m Name=" S p r i n g o o D e s c r i p t i o n Terms " wsag:ServiceName =" e l a s t i c i t y "> < o c w : S e r v i c e D e s c r i p t i o n T e r m E x t e n s i o n > < o c w : M e t r i c Name=" R e q u e s t s T h r o u g h p u t "> . . . < / o c w : M e t r i c > < o c w : M e t r i c Name=" V a r i a t i o n "> . . . < / o c w : M e t r i c > < o c w : M e t r i c Name=" I n s t r u c t i o n s "> . . . < / o c w : M e t r i c > < o c w : M e t r i c Name=" Memory "> . . . < / o c w : M e t r i c > < o c w : M e t r i c Name=" NetworkThroughput "> . . . < / o c w : M e t r i c > < o c w : M e t r i c Name=" S t o r a g e "> . . . < / o c w : M e t r i c > < o c w : M e t r i c Name=" ResponseTime "> . . . < / o c w : M e t r i c > < o c w : M e t r i c Name=" A v a i l a b i l i t y "> . . . < / o c w : M e t r i c > < o c w : I n p u t D a t a Name=" Atomic_Request_A "> . . . < / o c w : I n p u t D a t a > < o c w : I n p u t D a t a Name=" Atomic_Request_B "> . . . < / o c w : I n p u t D a t a > < o c w : R e s o u r c e Name=" J o n a s "> . . . < / o c w : R e s o u r c e > < o c w : R e s o u r c e Name=" Apache "> . . . < / o c w : R e s o u r c e >
5.3. PSLASYNTACTIC EXPRESSION 69 < o c w : R e s o u r c e Name="MySQL"> . . . < / o c w : R e s o u r c e > < o c w : R e s o u r c e Name=" a p p D i s k I d 1 "> . . . < / o c w : R e s o u r c e > < o c w : R e s o u r c e Name=" a p p D i s k I d 2 "> . . . < / o c w : R e s o u r c e > < o c w : R e s o u r c e Name=" a p p D i s k I d 3 "> . . . < / o c w : R e s o u r c e > < / o c w : S e r v i c e D e s c r i p t i o n T e r m E x t e n s i o n > < / w s a g : S e r v i c e D e s c r i p t i o n T e r m >
Listing 5.7. ServiceDescriptionTerm PSLA extension example.
1. wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:InputData
InputData is the place to define the basic element of workload which will be suffered by the virtualized application deployed under current PSLA contract. As shown in list- ing 5.8, in the definition of the InputData, the detailed description of the basic element of workloads will be given, including Scenario, Description and a unique name. It can also be extended. <complexType name =" I n p u t D a t a T y p e " > < complexContent > < e x t e n s i o n b a s e ="ocw :NamedElement" > < se qu en ce > < e l e m e n t name ="S c e n a r i o" t y p e =" anyURI "/ > < e l e m e n t name ="D e s c r i p t i o n" minOccurs ="0" t y p e =" s t r i n g "/ > <any minOccurs ="0" namespace ="#any" p r o c e s s C o n t e n t s =" s t r i c t "/ > </ se qu en ce >
</ e x t e n s i o n > </ complexContent > </ complexType >
Listing 5.8. InputData definition in ServiceDescriptionTerms extension of PSLA. < o c w : I n p u t D a t a Name=" Atomic_Request_A "> < o c w : S c e n a r i o > h t t p : / / www. p o l y t e c h . univ −s a v o i e . f r / o p e n c l o u d w a r e / v2 / models / s p r i n g o o . x i s < / o c w : S c e n a r i o > < / o c w : I n p u t D a t a >
Listing 5.9. One InputData example in PSLA.
(a) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:InputData/@ocw:Name
Attribute "Name" is an unique name based on NamedElement. The "NamedEle- ment" based "Name" of InputData should be unique in the whole agreement. For example, in listing 5.9, "Atomic_Request_A" could be adopted as the name of an element only once in the whole PSLA document.
(b) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:InputData/ocw:Scenario
Scenario is a URI based external description. For example, in listing 5.9, Scenario can be a CLIF scenario file in the context of OpenCloudware.
70 CHAPTER 5. PSLA: SLADESCRIPTION LANGUAGE FORPAAS
(c) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:InputData/ocw:Description
The string based Description is a human readable text description of the input data. This description is optional.
(d) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:InputData/{any}
To make PSLA adaptable to a variety of application workloads, InputData is de- signed to be extendable.
2. wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:Resource
<complexType name =" ResourceType " > < complexContent >
< e x t e n s i o n b a s e ="ocw :NamedElement" > < se qu en ce >
< e l e m e n t name ="XPath" t y p e =" s t r i n g "/ >
<any minOccurs ="0" namespace = " \ #any" p r o c e s s C o n t e n t s =" s t r i c t "/ >
</ se qu en ce > </ e x t e n s i o n > </ complexContent > </ complexType >
Listing 5.10. Resource definition IN ServiceDescriptionTerm of PSLA. <ocw :R e s o u r c e Name=" J o n a s " >
<ocw :XPath>
/ o v f : En v el o pe / o v f : R e f e r e n c e s / pm : DynamicImage [ o v f : i d =" appDisk1 " ] </ ocw :XPath>
</ ocw :Resource>
Listing 5.11. One Resource example in PSLA.
"Resource" of ServiceDescriptionTerms is the place to define referred virtualized re- sources provided by IaaS providers. Resources can be VMs, network resources, data storage and so on. As shown in listing 5.10, each Resource should have following infor- mations:
(a) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:Resource/@ocw:Name
Similar as the "Name" of "InputData" defined in ServiceDescriptionTerms extension of PSLA, attribute "Name" is based on NamedElement which is a shared type de- fined in PSLA. For example, in listing 5.11, "Jonas" should be unique in the whole agreement.
(b) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:Resource/ocw:XPath
As mentioned before, OVF++ file is adopted by OpenCloudware project to describe the VCAA of the application which is managed under corresponding PSLA contract. "XPath" gives the location of the resource description, for example the XPath of a specific tag in an OVF++ file.
5.3. PSLASYNTACTIC EXPRESSION 71
(c) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:Resource/{any}
Similar as "InputData" definition, "Resource" is also designed to be extendable to express all kinds of resource.
3. wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:Metric
As defined in listing 5.12, each Metric should have the informations about metric unit, metric value type and metric value generation mode tagged as Unit, Type and ValueGen- erateBy correspondingly. Detailed description of each element will be specified below.
<complexType name =" M e t r i c T y p e " > < complexContent >
< e x t e n s i o n b a s e ="ocw :NamedElement" > < se qu en ce >
< e l e m e n t name ="U n i t" t y p e ="ocw : UnitType "/ > < e l e m e n t name ="Type" t y p e ="ocw :Type"/ >
< e l e m e n t name ="V a l u e G e n e r a t e B y" t y p e ="ocw : ValueGenerateByType "/ >
</ se qu en ce > </ e x t e n s i o n > </ complexContent > </ complexType >
Listing 5.12. Metric definition of ServiceDescriptionTerms extension in PSLA. <ocw :M e t r i c Name="V a r i a t i o n" >
<ocw :Unit > . . . < / ocw :Unit> <ocw :Type>i n t e g e r < / ocw :Type>
<ocw :ValueGenerateBy> . . . < / ocw :ValueGenerateBy> </ ocw :M e t r i c>
Listing 5.13. Metric example of PSLA.
(a) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:Metric/@ocw:Name
Similarly as the "Name" of "InputData" and "Resource", Metrics defined in ServiceDescrip- tionTerm will be later used in GuaranteeTerms 5.3.4 by referring the unique name based on NamedElement which is a shared type defined in PSLA.
(b) wsag:ServiceDescriptionTerm
/ocw:ServiceDescriptionTermExtension/ocw:Metric/ocw:Unit
<complexType name =" UnitType " > < c h o i c e > < e l e m e n t name ="B u i l t I n U n i t" > < simpleType > < r e s t r i c t i o n b a s e =" s t r i n g " > < e n u m e r a t i o n v a l u e ="s e c o n d"/ > < e n u m e r a t i o n v a l u e ="m i n u t e"/ > < e n u m e r a t i o n v a l u e ="hou r"/ > < e n u m e r a t i o n v a l u e ="p e r c e n t"/ >
72 CHAPTER 5. PSLA: SLADESCRIPTION LANGUAGE FORPAAS < e n u m e r a t i o n v a l u e ="number"/ > < e n u m e r a t i o n v a l u e ="Euro"/ > < e n u m e r a t i o n v a l u e ="USD"/ > < e n u m e r a t i o n v a l u e ="Pound"/ > < e n u m e r a t i o n v a l u e =" r e q u e s t s / s "/ > < e n u m e r a t i o n v a l u e ="MIPS"/ > < e n u m e r a t i o n v a l u e ="Mo"/ > < e n u m e r a t i o n v a l u e ="Go"/ > < e n u m e r a t i o n v a l u e ="To"/ > < e n u m e r a t i o n v a l u e ="Mb/ s "/ > < e n u m e r a t i o n v a l u e ="Gb / s "/ > </ r e s t r i c t i o n > </ simpleType > </ e l e m e n t > < e l e m e n t name ="U s e r D e f i n e d U n i t" t y p e =" U s e r D e f i n e d U n i t T y p e "/ > </ c h o i c e > </ complexType >
Listing 5.14. Unit definition in Metric definition of ServiceDescriptionTerms extension in PSLA.
"Unit" describes the unit of measurement of the metric value. "Unit" is the place to define how to understand the string based metric value, for example with the same metric value "3", "3 USD" related to money and "3 Mb/s" may related to data transforming speed. "Unit" can either be created according to customers’ needs, which is named as UserDefinedUnit, or directly adopt the predefined units which is defined in BuiltinUnit.