Merge "Add requirement doc"
[promise.git] / requirements / 05-impl.rst
1 Detailed architecture and message flows
2 =======================================
3
4 Detailed northbound interface specification
5 -------------------------------------------
6
7 .. Note::
8    Once the output of the work from ETSI NFV IFA has been made publicly
9    available, the UML diagrams and REST/JSON examples in this section will be
10    extended
11
12 Resource Capacity Management
13 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 Subscribe Capacity Change Event
16 _______________________________
17
18 **SubscribeRequest (Consumer -> VIM)**
19
20 .. uml::
21
22    @startuml
23    class SubscribeRequest {
24       + zone [0..N]: Identifier
25       + attributes [0..1]: String
26       + resourceItems [0..1]: String
27       + thresholds [0..N]: String
28       + notificationId [0..1]: Identifier
29    }
30    @enduml
31
32 Subscription from Consumer to VIM to be notified about capacity changes.
33 Input Parameters:
34
35 * Zone [0..N]: Identification of the zone(s) to notify regarding capacity
36   change events
37 * Attributes [0..1]: Attributes of resource items to be notified regarding
38   capacity change events
39 * ResourceItems [0..1]: Identifiers of existing resource items to be notified
40   regarding capacity change events (such as images, flavors, virtual
41   containers, networks, physical machines, etc.)
42 * Thresholds [0..N]: Lower/Upper limits for triggering change event for
43   used/reserved/total capacity change for specified resource items
44 * NotificationId [0..1]: Identification of existing capacity change event
45   notification issued by the VIM. When specified. The previously defined
46   conditions for change event notifications wil be re-used and notification
47   sent to the additional requestor.
48
49 Application/json::
50
51   {
52     "zone": ["opnfv-JP8", "opnfv-JP9"],
53     "resourceitems": "numvcinstances"
54   }
55
56 **SubscribeReply (VIM -> Consumer)**
57
58 .. uml::
59
60    @startuml
61    class SubscribeReply {
62       + subscriptionId [1]: Identifier
63       + created [1]: DateTime
64       + message [0..1]: String
65    }
66    @enduml
67
68 Reply Parameters:
69
70 * subscriptionId (Identifier): Identification of the capacity change event
71   notification issued by the VIM.
72 * created (DateTime): Timestamp when subscription has been created
73 * m     essage [0..1] (String): Output message that provides additional information
74   about the subscribe request
75
76 Application/json::
77
78   {
79     "created": "2015-03-23T00:00:01Z",
80     "notificationId": "abcdef-ghijkl-123456789"
81   }
82
83 Query Resource Capacity
84 _______________________
85
86 **QueryRequest (NFVO -> VIM)**
87
88 .. uml::
89
90    @startuml
91    class QueryCapacityRequest {
92       + capacityQueryFilter [0..1]: CapacityQueryFilterClass
93    }
94
95    class CapacityQueryFilter {
96       + zone [0..1]: Identifier
97       + resourceItems [0..1]: String
98       + flavorID [0..1]: Identifier
99       + timePeriod [0..1]: DateTime
100    }
101
102    QueryCapacityRequest "1" *- "0..1" CapacityQueryFilter : ""
103    @enduml
104
105 .. -*
106
107 Request to find out about used, reserved and total capacity.
108 A CapacityQueryFilter can be used to narrow down the capacity details returned
109 in the response message.
110
111 Input Parameters:
112
113 * capacityQueryFilter (CapacityQueryFilterClass): Optional information to
114   narrow down the QueryCapacityRequest, for example to limit the query to given
115   resource items, or a given resource zone. The capacityQueryFilter can also
116   include a FlavorId or template ID. In this case, the QueryCapacity is a
117   request to obtain information of the number of virtual resources that can be
118   instantiated according to this flavor with the actual available capacity.
119   A timePeriod can be specified to narrow down the query to a certain period of time.
120
121 Application/json::
122
123   {
124     "capacityqueryfilter": {
125       "resourceitems": "numvcinstances,virtualmemorysize",
126       "zone": "opnfv-JP7"
127     }
128   }
129
130 **QueryReply (VIM -> NFVO)**
131
132 .. uml::
133
134    @startuml
135    class QueryCapacityReply {
136       + capacityInformation [0..N]: CapacityInformationClass
137       + zone [0..1]: Identifier
138       + lastUpdate [0..1]: DateTime
139       + message [0..1]: String
140    }
141
142    QueryCapacityReply "1" *- "0..N" CapacityInformationClass : ""
143    @enduml
144
145 .. -*
146
147 Reply Parameters:
148
149 * capacityInformation [0..N] (CapacityInformationClass): Capacity information
150   matching the CapacityQueryFilter specified in the QueryCapacityRequest
151 * Zone [0..1] (Identifier): Identification of the resource zone
152 * lastUpdate [0..1] (DateTime): Timestamp of the capacity last update
153 * message [0..1] (String): Output message that provides additional information
154   about the query capacity request
155
156 Application/json::
157
158   {
159     "capacityInformation": {
160       "numvcinstances": {
161         "used": 5,
162         "reserved": 1,
163         "total": 10
164       },
165       "virtualmemorysize": {
166         "used": 4,
167         "reserved": 6,
168         "total": 16
169       }
170     },
171     "zone":"opnfv-JP7",
172     "lastUpdate":"2015-03-23T00:00:00Z"
173   }
174
175 Notify Capacity Change Event
176 ____________________________
177
178 **CapacityChangeNotification (VIM -> Consumer)**
179
180 .. uml::
181
182    @startuml
183    class CapacityChangeNotification {
184       + capacityInformation [0..1]: CapacityInformationClass
185       + zone [0..1]: Identifier
186       + notificationTime [1]: DateTime
187       + notificationId [1]: Identifier
188    }
189
190    CapacityChangeNotification "1" *- "0..1" CapacityInformationClass : ""
191    @enduml
192
193 .. -*
194
195 Notification about capacity changes
196
197 Notify Parameters:
198
199 * capacityInformation [0..1] (CapacityInformationClass): Capacity information
200   matching a given subscription request defined by the Consumer
201 * zone [0..1] (Identifier): Identification of the resource zone
202 * notificationTime [1] (DateTime): Timestamp when the capacity change is
203   detected
204 * notificationId [1]: Identification of the capacity change event notification
205   issued by the VIM.
206
207 Application/json::
208
209   {
210     "capacity": {
211       "numvcinstances": {
212         "used": 16,
213         "reserved": 2,
214         "total": 20
215       }
216     },
217     "zone": "opnfv-JP8",
218     "notificationTime":"2015-03-23T12:00:05Z",
219     "notificationId":"abcdef-ghijkl-123456789"
220   }
221
222 Resource Reservation
223 ^^^^^^^^^^^^^^^^^^^^
224
225 Create Resource Reservation
226 ___________________________
227
228 **CreateResourceReservationRequest (NFVO -> VIM)**
229
230 .. uml::
231
232    @startuml
233    class CreateResourceReservationRequest {
234       + start [0..1]: DateTime
235       + end [0..1]: DateTime
236       + expiry [0..1]: DateTime
237       + virtualizationContainerReservation [0..N]: VirtualizationContainerReservationClass
238       + computePoolReservation [0..1]: ComputePoolReservationClass
239       + storagePoolReservation [0..1]: StoragePoolReservationClass
240       + networkReservation [0..1]: NetworkReservationClass
241       + zone [0..1]: Identifier
242    }
243
244    class VirtualizationContainerReservationClass {
245       + containerId [1]: Identifier
246       + flavor [0..1]: FlavorClass
247    }
248
249    CreateResourceReservationRequest "1" *- "0..N" VirtualizationContainerReservationClass : ""
250    VirtualizationContainerReservationClass "1" *-- "0..1" FlavorClass
251    CreateResourceReservationRequest "1" *-- "0..1" ComputePoolReservationClass
252    CreateResourceReservationRequest "1" *-- "0..1" StoragePoolReservationClass
253    CreateResourceReservationRequest "1" *-- "0..1" NetworkReservationClass
254    @enduml
255
256 .. -*
257
258 **CreateResourceReservationReply (VIM -> NFVO)**
259
260 .. uml::
261
262    @startuml
263    class CreateResourceReservationReply {
264       + reservationId [1]: Identifier
265       + virtualizationContainerReserved [0..N]: VirtualizationContainerReservedClass
266       + computePoolReserved [0..1]: ComputePoolReservedClass
267       + storagePoolReserved [0..1]: StoragePoolReservedClass
268       + networkReserved [0..1]: NetworkReservedClass
269       + reservationStatus [1]: String
270       + startTime [0..1]: Time
271       + endTime [0..1]: Time
272       + message [0..1]: String
273    }
274
275    class VirtualizationContainerReservedClass {
276       + containerId [1]: Identifier
277       + flavor [0..1]: FlavorClass
278    }
279
280    CreateResourceReservationReply "1" *- "0..N" VirtualizationContainerReservedClass : ""
281    VirtualizationContainerReservedClass "1" *-- "0..1" FlavorClass
282    CreateResourceReservationReply "1" *-- "0..1" ComputePoolReservedClass
283    CreateResourceReservationReply "1" *-- "0..1" StoragePoolReservedClass
284    CreateResourceReservationReply "1" *-- "0..1" NetworkReservedClass
285    @enduml
286
287 .. -*
288
289 Subscribe / Notify Reservation Event
290 ____________________________________
291
292 **SubscribeRequest (Consumer -> VIM)**
293
294 .. uml::
295
296    @startuml
297    class SubscribeRequest {
298       + reservationId [1]: Identifier
299       + eventType [0..1]: String
300    }
301    @enduml
302
303 **SubscribeReply (VIM -> Consumer)**
304
305 .. uml::
306
307    @startuml
308    class SubscribeReply {
309       + notificationId [1]: Identifier
310       + created [1]: DateTime
311       + message [0..1]: String
312    }
313    @enduml
314
315 **NotifyReservationEvent (VIM -> Consumer)**
316
317 .. uml::
318
319    @startuml
320    class ReservationEventNotification {
321       + notificationId [1]: Identifier
322       + reservationId [1]: Identifier
323       + notificationTime [1]: DateTime
324       + vimId [1]: Identifier
325       + eventType [1]: String
326       + eventDetails [1]: String
327       + message [0..1]: String
328    }
329    @enduml
330
331 Query Resource Reservation
332 __________________________
333
334 **QueryResourceReservationRequest (Consumer -> VIM)**
335
336 .. uml::
337
338    @startuml
339    class QueryResourceReservationRequest {
340       + reservationQueryFilter [0..1]: ReservationQueryFilterClass
341    }
342
343    QueryResourceReservationRequest "1" *- "0..1" ReservationQueryFilterClass : ""
344    @enduml
345
346 .. -*
347
348 **QueryResourceReservationReply (VIM -> Consumer)**
349
350 .. uml::
351
352    @startuml
353    class CreateResourceReservationReply {
354       + reservationId [1]: Identifier
355       + virtualizationContainerReserved [0..N]: VirtualizationContainerReservedClass
356       + computePoolReserved [0..1]: ComputePoolReservedClass
357       + storagePoolReserved [0..1]: StoragePoolReservedClass
358       + networkReserved [0..1]: NetworkReservedClass
359       + reservationStatus [1]: String
360       + message [0..1]: String
361    }
362
363    class VirtualizationContainerReservedClass {
364       + containerId [1]: Identifier
365       + flavor [0..1]: FlavorClass
366    }
367
368    CreateResourceReservationReply "1" *- "0..N" VirtualizationContainerReservedClass : ""
369    VirtualizationContainerReservedClass "1" *-- "0..1" FlavorClass
370    CreateResourceReservationReply "1" *-- "0..1" ComputePoolReservedClass
371    CreateResourceReservationReply "1" *-- "0..1" StoragePoolReservedClass
372    CreateResourceReservationReply "1" *-- "0..1" NetworkReservedClass
373    @enduml
374
375 .. -*
376
377 Update Resource Reservation
378 ___________________________
379
380 **UpdateResourceReservationRequest (NFVO ->VIM)**
381
382 .. uml::
383
384    @startuml
385    class UpdateResourceReservationRequest {
386       + reservationId [1]: Identifier
387       + start [0..1]: DateTime
388       + end [0..1]: DateTime
389       + expiry [0..1]: DateTime
390       + virtualizationContainerReservation [0..N]: VirtualizationContainerReservationClass
391       + computePoolReservation [0..1]: ComputePoolReservationClass
392       + storagePoolReservation [0..1]: StoragePoolReservationClass
393       + networkReservation [0..1]: NetworkReservationClass
394       + zone [0..1]: Identifier
395    }
396
397    class VirtualizationContainerReservationClass {
398       + containerId [1]: Identifier
399       + flavor [0..1]: FlavorClass
400    }
401
402    UpdateResourceReservationRequest "1" *- "0..N" VirtualizationContainerReservationClass : ""
403    VirtualizationContainerReservationClass "1" *-- "0..1" FlavorClass
404    UpdateResourceReservationRequest "1" *-- "0..1" ComputePoolReservationClass
405    UpdateResourceReservationRequest "1" *-- "0..1" StoragePoolReservationClass
406    UpdateResourceReservationRequest "1" *-- "0..1" NetworkReservationClass
407    @enduml
408
409 .. -*
410
411 **UpdateResourceReservationReply (VIM -> NFVO)**
412
413 .. uml::
414
415    @startuml
416    class UpdateResourceReservationReply {
417       + reservationId [1]: Identifier
418       + virtualizationContainerReserved [0..N]: VirtualizationContainerReservedClass
419       + computePoolReserved [0..1]: ComputePoolReservedClass
420       + storagePoolReserved [0..1]: StoragePoolReservedClass
421       + networkReserved [0..1]: NetworkReservedClass
422       + reservationStatus [1]: String
423       + message [0..1]: String
424    }
425
426    class VirtualizationContainerReservedClass {
427       + containerId [1]: Identifier
428       + flavor [0..1]: FlavorClass
429    }
430
431    UpdateResourceReservationReply "1" *- "0..N" VirtualizationContainerReservedClass : ""
432    VirtualizationContainerReservedClass "1" *-- "0..1" FlavorClass
433    UpdateResourceReservationReply "1" *-- "0..1" ComputePoolReservedClass
434    UpdateResourceReservationReply "1" *-- "0..1" StoragePoolReservedClass
435    UpdateResourceReservationReply "1" *-- "0..1" NetworkReservedClass
436    @enduml
437
438 .. -*
439
440 Release Resource Reservation
441 ____________________________
442
443 **ReleaseResourceReservationRequest (NFVO -> VIM)**
444
445 .. uml::
446
447    @startuml
448    class ReleaseResourceReservationRequest {
449       + reservationId [1]: Identifier
450    }
451    @enduml
452
453 **ReleaseResourceReservationReply (VIM -> NFVO)**
454
455 .. uml::
456
457    @startuml
458    class ReleaseResourceReservationReply {
459       + reservationId [1]: Identifier
460       + message [0..1]: String
461    }
462    @enduml
463
464
465 Detailed Message Flows
466 ----------------------
467
468 Resource Capacity Management
469 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
470
471 .. figure:: images/figure5.png
472    :width: 90%
473
474    Capacity Management Scenario
475
476 Figure 5 shows a detailed message flow between the consumers and the
477 functionalblocks inside the VIM and has the following steps:
478
479 Step 1: The consumer subscribes to capacity change notifications
480
481 Step 2: The Capacity Manager monitors the capacity information for the various
482 types of resources by querying the various Controllers (e.g. Nova, Neutron,
483 Cinder), either periodically or on demand and updates capacity information in
484 the Capacity Map
485
486 Step 3: Capacity changes are notified to the consumer
487
488 Step 4: The consumer queries the Capacity Manager to retrieve capacity detailed
489 information
490
491 Resource Reservation
492 ^^^^^^^^^^^^^^^^^^^^
493
494 .. figure:: images/figure6.png
495    :width: 90%
496
497    Resource Reservation for Future Use Scenario
498
499 Figure 6 shows a detailed message flow between the consumers and the functional
500 blocks inside the VIM and has the following steps:
501
502 Step 1: The consumer creates a resource reservation request for future use by
503 setting a start and end time for the allocation
504
505 Step 2: The consumer gets an immediate reply with a reservation status message
506 "reservationStatus" and an identifier to be used with this reservation instance
507 "reservationID"
508
509 Step 3: The consumer subscribes to reservation notification events
510
511 Step 4: The Resource Reservation Manager checks the feasibility of the
512 reservation request by consulting the Capacity Manager
513
514 Step 5: The Resource Reservation Manager reserves the resources and stores the
515 list of reservations IDs generated by the Controllers (e.g. Nova, Neutron,
516 Cinder) in the Reservation Map
517
518 Step 6: Once the reservation process is completed, the VIM sends a notification
519 message to the consumer with information on the reserved resources
520
521 Step 7: When start time arrives, the consumer creates a resource allocation
522 request.
523
524 Step 8: The consumer gets an immediate reply with an allocation status message
525 "allocationStatus".
526
527 Step 9: The consumer subscribes to allocation notification events
528
529 Step 10: The Resource Allocation Manager allocates the reserved resources. If
530 not all reserved resources are allocated before expiry, the reserved resources
531 are released and a notification is sent to the consumer
532
533 Step 11: Once the allocation process is completed, the VIM sends a notification
534 message to the consumer with information on the allocated resources