Merge "Draft the enhancement of capacity_check API"
[multicloud/framework.git] / docs / specs / multicloud_resource_capacity_check.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (c) 2017-2018 VMware, Inc.
4
5 =======================================
6 MultiCloud Resources Capacity Check API
7 =======================================
8
9 To better expose VIM capabilities and available resources capacity to external
10 consumer, some extensions need to be done by MultiCloud.
11
12
13 Problem Description
14 ===================
15
16 Current MultiCloud didn't expose any standard API/methods to check/publish the
17 resources capacity for each VIM, which makes external project can not realize
18 the capacity information of VIM. When a VIM with shortage resources was chosen
19 to deploy a bunch of VNFs, it will fail eventually. Exposing these information
20 will could let external project to make a better decision on choosing which VIM
21 to deploy the VNFs.
22
23
24 Propose Change
25 ==============
26
27 Cloud Locations
28 ---------------
29
30 Cloud latitude and longitude information is needed by OOF to determine the
31 distance between vGMuxInfra and vG. The latitude and longitude information
32 are part of A&AI complex schema[A&AI Complex Schema]_, which related to
33 cloud-region schema.
34
35 There is no change needed to MultiCloud, but cloud administrator need to
36 input these information when register a new VIM. Currently ESR Portal don't
37 expose these input forms to cloud administrator, need ESR team to add related
38 workflow to create complex data in A&AI and create a relationship between
39 location information and cloud-region record.
40
41 ... [A&AI Complex Schema] https://gerrit.onap.org/r/gitweb?p=aai/aai-common.git;a=blob;f=aai-schema/src/main/resources/oxm/aai_oxm_v12.xml;h=e146c06ac675a1127ee11205c0ff2544e4d9a81d;hb=HEAD#l772
42
43
44 Available Resource Check
45 ------------------------
46
47 A new API will be used by OOF to check the available cloud resources, which
48 will help OOF to make a better placement decision. OOF will give a resrouces
49 requirement of a specific deployment and a list of VIMs which need to be
50 check whether have enough resources for this deployment. The ouput of
51 Multicloud will be a list of VIMs which have enough resources.
52
53 There will be two part of APIs for this requirement, an check_vim_capacity API
54 will be added to MultiCloud borker to return a list of VIMs, another API
55 <vim_id>/capacity_check will be added to each MultiCloud plugins, and return
56 true or false based on whether the VIM have enought resources. When MultiCloud
57 broker receive a POST request on check_vim_capacity, it will request to each
58 <vim_id>/capacity_check API, and return a list of VIMs with a true in response
59 data.
60
61 Format of "vim_id" complying to the functional requirement of
62 "Consistent ID of a Cloud Region"
63
64 ::
65   {cloud-owner}/{cloud-region-id}
66
67 Format of "VIM ID" complying to the functional requirement of
68 "Consistent ID of a Cloud Region"
69
70 ::
71
72   {
73     "cloud-owner": string, //cloud owner name/ID
74     "cloud-region-id": string, //cloud region ID
75   }
76
77   Example: array of "VIM ID" looks like:
78
79   [
80    {"cloud-owner": "owner1", "cloud-region-id": "regionid1"},
81    {"cloud-owner": "owner2", "cloud-region-id": "regionid2"}
82   ]
83
84 Format of "AZinfo"
85
86 ::
87
88   {
89     "availability-zone-name": string, //name of available zone
90     "vCPUTotal": int,  //number of total cores, optional field
91     "MemoryTotal": float,  //GB,total memory, optional field
92     "StorageTotal": int, //GB total storage, optional field
93     "vCPUAvail": int,  //number of available cores
94     "MemoryAvail": float,  //GB, availablesize of memory
95     "StorageAvail": int, //GB, available storage
96   }
97   }
98
99 Format of "VIMinfo" which extend the "VIM ID" as below
100
101 ::
102
103   {
104     "cloud-owner": string, //cloud owner name/ID
105     "cloud-region-id": string, //cloud region ID
106     "AZs": array,  // list of AZinfo
107   }
108
109 Input of check_vim_capacity will be
110
111 ::
112
113   {
114     "vCPU": int,  // number of cores
115     "Memory": float,  // size of memory, GB
116     "Storage": int, //GB
117     "VIMs": array, //list of "VIM ID" with which OOF wish to check
118   }
119
120 Output of check_vim_capacity will be
121
122 ::
123
124   {
125     "VIMs": array, //list of VIMinfo
126   }
127
128 Input of <vim_id>/capacity_check will be
129
130 ::
131
132   {
133     "vCPU": int,
134     "Memory": float,
135     "Storage": int,
136   }
137
138
139 Output of <vim_id>/capacity_check will be
140
141 ::
142
143   {
144     "result": bool,
145     "AZs": array, //list of AZinfo, optional field
146   }
147
148
149 Work Items
150 ==========
151
152 #. Work with ESR team for location inport form.
153 #. Add check_vim_capacity API to MultiCloud Broker.
154 #. Add check_vim_capacity API to each MultiCloud Plugins.
155
156 Tests
157 =====
158
159 #. Unit Tests with tox
160 #. CSIT Tests, the input/ouput of broker and each plugin see API design above.