update link to upper-constraints.txt
[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 Multi-Tenant Support
45 --------------------
46
47 Request Headers:
48 >>>>>>>>>>>>>>>>
49
50 To support multi-tenants over the same cloud region, all APIs defined below
51 should support to accept the following optional headers which are used to
52 specify a tenant other than the default one associated with the cloud region.
53
54 ::
55
56   "Project"   : Tenant/Project ID or Name specified by API consumer, Optional
57
58
59 Example 1:
60 ::
61
62   "Project: tenant1"
63
64 Example 2:
65 ::
66
67   "Project: fcca3cc49d5e42caae15459e27103efc"
68
69 Available Resource Check
70 ------------------------
71
72 A new API will be used by OOF to check the available cloud resources, which
73 will help OOF to make a better placement decision. OOF will give a resrouces
74 requirement of a specific deployment and a list of VIMs which need to be
75 check whether have enough resources for this deployment. The ouput of
76 Multicloud will be a list of VIMs which have enough resources.
77
78 There will be two part of APIs for this requirement, an check_vim_capacity API
79 will be added to MultiCloud borker to return a list of VIMs, another API
80 <vim_id>/capacity_check will be added to each MultiCloud plugins, and return
81 true or false based on whether the VIM have enought resources. When MultiCloud
82 broker receive a POST request on check_vim_capacity, it will request to each
83 <vim_id>/capacity_check API, and return a list of VIMs with a true in response
84 data.
85
86 Format of "vim_id" complying to the functional requirement of
87 "Consistent ID of a Cloud Region"
88
89 ::
90   {cloud-owner}/{cloud-region-id}
91
92 Format of "VIM ID" complying to the functional requirement of
93 "Consistent ID of a Cloud Region"
94
95 ::
96
97   {
98     "cloud-owner": string, //cloud owner name/ID
99     "cloud-region-id": string, //cloud region ID
100   }
101
102   Example: array of "VIM ID" looks like:
103
104   [
105    {"cloud-owner": "owner1", "cloud-region-id": "regionid1"},
106    {"cloud-owner": "owner2", "cloud-region-id": "regionid2"}
107   ]
108
109 Format of "AZinfo"
110
111 ::
112
113   {
114     "availability-zone-name": string, //name of available zone
115     "vCPUTotal": int,  //number of total cores, optional field
116     "MemoryTotal": float,  //GB,total memory, optional field
117     "StorageTotal": int, //GB total storage, optional field
118     "vCPUAvail": int,  //number of available cores
119     "MemoryAvail": float,  //GB, availablesize of memory
120     "StorageAvail": int, //GB, available storage
121   }
122   }
123
124 Format of "VIMinfo" which extend the "VIM ID" as below
125
126 ::
127
128   {
129     "cloud-owner": string, //cloud owner name/ID
130     "cloud-region-id": string, //cloud region ID
131     "AZs": array,  // list of AZinfo
132   }
133
134 Input of check_vim_capacity will be
135
136 ::
137
138   {
139     "vCPU": int,  // number of cores
140     "Memory": float,  // size of memory, GB
141     "Storage": int, //GB
142     "VIMs": array, //list of "VIM ID" with which OOF wish to check
143   }
144
145 Output of check_vim_capacity will be
146
147 ::
148
149   {
150     "VIMs": array, //list of VIMinfo
151   }
152
153 Input of <vim_id>/capacity_check will be
154
155 ::
156
157   {
158     "vCPU": int,
159     "Memory": float,
160     "Storage": int,
161   }
162
163
164 Output of <vim_id>/capacity_check will be
165
166 ::
167
168   {
169     "result": bool,
170     "AZs": array, //list of AZinfo, optional field
171   }
172
173
174 Work Items
175 ==========
176
177 #. Work with ESR team for location inport form.
178 #. Add check_vim_capacity API to MultiCloud Broker.
179 #. Add check_vim_capacity API to each MultiCloud Plugins.
180
181 Tests
182 =====
183
184 #. Unit Tests with tox
185 #. CSIT Tests, the input/ouput of broker and each plugin see API design above.