Add host specific VM list to inspector design guide line
[doctor.git] / docs / development / design / inspector-design-guideline.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 ==========================
5 Inspector Design Guideline
6 ==========================
7
8 .. NOTE::
9    This is spec draft of design guideline for inspector component.
10    JIRA ticket to track the update and collect comments: `DOCTOR-73`_.
11
12 This document summarize the best practise in designing a high performance
13 inspector to meet the requirements in `OPNFV Doctor project`_.
14
15 Problem Description
16 ===================
17
18 Some pitfalls has be detected during the development of sample inspector, e.g.
19 we suffered a significant `performance degrading in listing VMs in a host`_.
20
21 A `patch set for caching the list`_ has been committed to solve issue. When a
22 new inspector is integrated, it would be nice to have an evaluation of existing
23 design and give recommendations for improvements.
24
25 This document can be treated as a source of related blueprints in inspector
26 projects.
27
28 Guidelines
29 ==========
30
31 Host specific VMs list
32 ----------------------
33
34 While requirement in doctor project is to have alarm about fault to consumer in one second, it is just a limit we have
35 set in requirements. When talking about fault management in Telco, the implementation needs to be by all means optimal
36 and the one second is far from traditional Telco requirements.
37
38 One thing to be optimized in inspector is to eliminate the need to read list of host specific VMs from Nova API, when
39 it gets a host specific failure event. Optimal way of implementation would be to initialize this list when Inspector
40 start by reading from Nova API and after this list would be kept up-to-date by ``instance.update`` notifications
41 received from nova. Polling Nova API can be used as a complementary channel to make snapshot of hosts and VMs list in
42 order to keep the data consistent with reality.
43
44 This is enhancement and not perhaps something needed to keep under one second in a small system. Anyhow this would be
45 something needed in case of production use.
46
47 This guideline can be summarized as following:
48
49 - cache the host VMs mapping instead of reading it on request
50 - subscribe and handle update notifications to keep the list up to date
51 - make snapshot periodically to ensure data consistency
52
53 Parallel execution
54 ------------------
55
56 TBD, see `discussion in mailing list`_.
57
58 .. _DOCTOR-73: https://jira.opnfv.org/browse/DOCTOR-73
59 .. _OPNFV Doctor project: https://wiki.opnfv.org/doctor
60 .. _performance degrading in listing VMs in a host: https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2016-September/012591.html
61 .. _patch set for caching the list: https://gerrit.opnfv.org/gerrit/#/c/20877/
62 .. _DOCTOR-76: https://jira.opnfv.org/browse/DOCTOR-76
63 .. _discussion in mailing list: https://lists.opnfv.org/pipermail/opnfv-tech-discuss/2016-October/013036.html