update link to upper-constraints.txt
[multicloud/framework.git] / docs / specs / multicloud_event_federation.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 Event/Alert/Metrics Federation
7 ==============================
8
9 As a cloud mediation layer, Multicloud could be invoked by many projects,
10 through this feature, Multicloud will provide VM status/events check and also
11 can customize the type of event which user would like to receive. There are
12 some kinds of VM status can be chosen: DELETE, PAUSE, POWER_OFF, REBUILD
13 SHUT_DOWN, SOFT_DELETE, etc.. In VMware VIO Plugin, once any change of VM
14 status is detected of a given type, Multicloud will catch the event and throw
15 it to DMaaP. Other projects can try this way of getting VM status messages in
16 the future. Also, for other Multicloud plugin providers, due to some issues,
17 there will be rest apis for them to grab the VM status messages.
18
19 The APP-C won't be impacted since APP-C can still call the existing API which
20 implemented in Amsterdam Release and the API is an existing API
21
22 Use Cases
23 ===================
24
25 In VIO, one typical use case is to allow VIO users to fetch messages from
26 DMaaP, this will provide a easier way for fetching status of
27 VMs, it may drastically reduce the time of close loop, for other Multicloud
28 plugin providers, Multicloud will provide a set of
29 rest apis to get them
30
31
32 Proposed change
33 ===================
34
35 In VIO plugin:
36
37 The proposed change will include two parts: * listener: to listen the events
38 of the status change of VM, for others it
39 will have rest apis to get the messages * publisher: to throw the event to
40 DMaaP.The message we try to send is something like this::
41
42   {
43       "state_description": "powering-off",
44       "availability_zone": "nova",
45       "terminated_at": "",
46       "ephemeral_gb": 0,
47       "instance_type_id": 5,
48       "deleted_at": "",
49       "reservation_id": "r-pvx3l6s2",
50       "memory_mb": 2048,
51       "display_name": "VM1",
52       "hostname": "vm1",
53       "state": "active",
54       "progress": "",
55       "launched_at": "2018-03-07T05:59:46.000000",
56       "metadata": {},
57       "node": "domain-c202.22bfc05c-da55-4ba6-ba93-08d9a067138e",
58       "ramdisk_id": "",
59       "access_ip_v6": null,
60       "disk_gb": 20,
61       "access_ip_v4": null,
62       "kernel_id": "",
63       "host": "compute01",
64       "user_id": "aa90efa5c84c4084b39094da952e0bd1",
65       "image_ref_url": "http://10.154.9.172:9292/images/207b9b7c-9450-4a95-852b-0d6d41f35d24",
66       "cell_name": "",
67       "root_gb": 20,
68       "tenant_id": "943ecb804cdf4103976b8a02cea12fdb",
69       "created_at": "2018-03-07 05:58:01+00:00",
70       "instance_id": "4f398943-7d39-4119-8058-74768d6dfa52",
71       "instance_type": "m1.small",
72       "vcpus": 1,
73       "image_meta": {
74           "is_copying": "1",
75           "container_format": "bare",
76           "min_ram": "0",
77           "vmware_disktype": "streamOptimized",
78           "disk_format": "vmdk",
79           "source_type": "url",
80           "image_url": "https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img",
81           "vmware_adaptertype": "lsiLogic",
82           "min_disk": "20",
83           "base_image_ref": "207b9b7c-9450-4a95-852b-0d6d41f35d24"
84       },
85       "architecture": null,
86       "os_type": null,
87       "instance_flavor_id": "2"
88   }
89
90 The eventual work flow looks like as follows::
91
92               +------------------+
93               |                  |
94               |   Multicloud     |
95               |     Broker       |
96               |                  |
97               +---------+--------+
98                         |
99                         |
100                         V
101             +-----------------------+            +------------------+
102             | Multicloud VIO Plugin |----------->| Dmaap            |
103             |                       |   Event    |                  |
104             +--------|-----^--------+            +------------------+
105             Oslo     |     |
106           Listener   |     |
107                      V     |
108             +----------------------+
109             | VIO                  |
110             +----------------------+
111
112
113 In Other Plugins:
114
115 Since the security rules of VIMs and network connectivity issues, other
116 multicloud plugins won't be suitable for the
117 oslo notification listener, so we will provide rest apis for them, the
118 specific implementation will be dicided by them
119
120 Input of <vim_id>/check_vim_status will be
121
122 ::
123
124   {
125     "states": array  // the set of VIM status which user wants to get
126   }
127
128 Output of check_vim_status will be
129
130 ::
131
132   {
133     "state_description": string  // VIM's state
134     "launched_at": string // time of state change
135   }
136
137 The work flow looks like as follows::
138
139               +------------------+
140               |                  |
141               |     Multicloud   |
142               |       Broker     |
143               |                  |
144               +---------+--------+
145                         |
146                         |
147                         V
148             +-----------------------+
149             | Multicloud Plugins    |
150             |                       |
151             +--------|-----^--------+
152             polling  |     |
153         or other way |     |
154                      V     |
155             +----------------------+
156             | Openstack            |
157             +----------------------+