Slightly change the hypervisor parameter example.
[ganeti-local] / doc / design-2.0-cluster-parameters.rst
1 Ganeti 2.0 cluster parameters
2 =============================
3
4 .. contents::
5
6 Objective
7 ---------
8
9 With the introduction of the HVM hypervisor in Ganeti 1.2 and the
10 implementation of multiple hypervisor support in Ganeti 2.0, the way
11 the cluster parameters are handled needs to be reorganized accordingly.
12
13 Background
14 ----------
15
16 When the HVM hypervisor was introduced in Ganeti 1.2, the additional
17 instance parameters needed for it were simply added to the instance
18 namespace, as were additional parameters for the PVM hypervisor.
19
20 As a result of this, wether a particular parameter is valid for the
21 actual hypervisor could either be guessed from the name but only
22 really checked by following the code using it.
23
24 This design doc aims to provide an approach to solve this.
25
26 Overview
27 --------
28
29 The instance level hypervisor parameters will be moved into a separate
30 sub-tree of the instance name space. Also, a mechanismum to allow for
31 automatic checking and possibly validation of hypervisor parameters
32 will be outlined.
33
34
35 Detailed Design
36 ---------------
37
38 Hypervisor Parameter
39 ~~~~~~~~~~~~~~~~~~~~
40
41 A hypervisor parameter (or hypervisor specific parameter) is defined
42 as a parameter that is interpreted by the hypervisor support code in
43 Ganeti and usually is specific to a particular hypervisor (like the
44 kernel path for PVM which makes no sense for HVM).
45
46 Cluster parameters
47 ~~~~~~~~~~~~~~~~~~
48
49 The cluster parameter namespace will be extended with cluster level
50 hypervisor specific parameters. The typical expected use case for this
51 is to store default values for instance level hypervisor parameters.
52
53
54 Instance parameters
55 ~~~~~~~~~~~~~~~~~~~
56
57 The only hypervisor parameter to remain at the top level of the
58 instance namespace will be instance.hypervisor_type, specifying not
59 only the hypervisor type to be used for that instance, but also
60 implicitly the hypervisor type to use for parameter checks.
61
62 All other instance level hypervisor parameters will be moved into the
63 instance.hypervisor_params namespace subtree.
64
65 The names for hypervisor parameters in the instance.hypervisor_params
66 subtree should be choosen as generic as possible, especially if
67 specific parameters could conceivably be useful for more than one
68 hypervisor, e.g.
69 instance.hypervisor_params.vnc_console_port instead of using both
70 instance.hypervisor_params.hvm_vnc_console_port and
71 instance.hypervisor_params.kvm_vnc_console_port.
72
73 The instance.hypervisor_params subtree will be implemented as a dict.
74
75 Examples for instance level hypervisor parameters:
76
77 :boot_order: boot device order
78 :vnc_bind_address: bind address for VNC console
79 :vnc_bind_port: bind port for VNC console
80 :kernel_path: path to the kernel binary
81 :disk_type: type of the virtual disk interface
82
83 With this design, hypervisor specific parameters for disk and NIC
84 devices are defined globally for all devices of that type in the instance.
85 It may become necessary later to allow setting these parameters on a
86 per device basis, which will require design changes to the cluster
87 parameters.
88
89 All other, non hypervisor related parameters of the instance remain at
90 the top level of the instance namespace. This includes:
91
92 - disks
93 - nics
94 - mem
95 - vcpu
96 - status
97 - OS
98
99
100
101 Hypervisor support requirements
102 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103
104 To support the new cluster parameter design, additional features will
105 be required from the hypervisor support implementations in Ganeti.
106
107 The hypervisor support  implementation API will be extended with the
108 following features:
109
110 :GetValidClusterParameters(): returns a list of valid cluster level
111   parameters for this hypervisor,
112 :GetValidInstanceParameters(): provide a list of valid instance level
113   parameters for this hypervisor,
114 :VerifyParameter(parameter_name, parameter_value): verifies the
115   provided parameter against this hypervisor:
116
117   - if the provided parameter name is valid for this hypervisor
118   - if applicable, if the provided value is valid for this hypervisor
119
120 The VerifyParameter(..) function will return True or False.
121
122
123 The parameter validation will be used for every addition or change of
124 hypervisor parameters.