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