.. admonition:: FIXME
- Need to rework instance console vs. instance replace disks. I don't
- think we need exclusive locks for console and neither for replace
- disk: it is safe to stop/start the instance while it's doing a replace
- disks. Only modify would need exclusive, and only for transitioning
- into/out of offline state.
+ Need to rework instance replace disks. I don't think we need exclusive
+ locks for replacing disks: it is safe to stop/start the instance while
+ it's doing a replace disks. Only modify would need exclusive, and only
+ for transitioning into/out of offline state.
Instance memory model
---------------------
request
Ganeti will by default reject non-standard instance sizes (lower than
-``min_ispec`` or greater than ``max_ispec``), but as usual a ``--force``
-option on the command line or in the RAPI request will override these
-constraints. The ``std_spec`` structure will be used to fill in missing
-instance specifications on create.
+``min_ispec`` or greater than ``max_ispec``), but as usual a
+``--ignore-ipolicy`` option on the command line or in the RAPI request
+will override these constraints. The ``std_spec`` structure will be used
+to fill in missing instance specifications on create.
Each of the ispec structures will be a dictionary, since the contents
can change over time. Initially, we will define the following variables
+---------------+----------------------------------+--------------+
|Name |Description |Type |
+===============+==================================+==============+
-|mem_min |Minimum memory size allowed |int |
-+---------------+----------------------------------+--------------+
-|mem_max |Maximum allowed memory size |int |
+|mem_size |Allowed memory size |int |
+---------------+----------------------------------+--------------+
|cpu_count |Allowed vCPU count |int |
+---------------+----------------------------------+--------------+
Disk parameters
~~~~~~~~~~~~~~~
-The propose model for new disk parameters is a simple free-form one
-based on dictionaries, indexed per disk level (template or logical disk)
-and type (which depends on the level). At JSON level, since the object
-key has to be a string, we can encode the keys via a separator
-(e.g. slash), or by having two dict levels.
-
-+--------+-------------+-------------------------+---------------------+------+
-|Disk |Name |Description |Current status |Type |
-|template| | | | |
-+========+=============+=========================+=====================+======+
-|dt/plain|stripes |How many stripes to use |Configured at |int |
-| | |for newly created (plain)|./configure time, not| |
-| | |logical voumes |overridable at | |
-| | | |runtime | |
-+--------+-------------+-------------------------+---------------------+------+
-|dt/drdb |stripes |How many stripes to use |Same as for lvm |int |
-| | |for data volumes | | |
-+--------+-------------+-------------------------+---------------------+------+
-|dt/drbd |metavg |Default volume group for |Same as the main |string|
-| | |the metadata LVs |volume group, | |
-| | | |overridable via | |
-| | | |'metavg' key | |
-| | | | | |
-+--------+-------------+-------------------------+---------------------+------+
-|dt/drbd |metastripes |How many stripes to use |Same as for lvm |int |
-| | |for meta volumes |'stripes', suboptimal| |
-| | | |as the meta LVs are | |
-| | | |small | |
-+--------+-------------+-------------------------+---------------------+------+
-|ld/drbd8|disk_barriers|What kind of barriers to |Either all enabled or|string|
-| | |*disable* for disks; |all disabled, per | |
-| | |either "n" or a string |./configure time | |
-| | |containing a subset of |option | |
-| | |"bfd" | | |
-+--------+-------------+-------------------------+---------------------+------+
-|ld/drbd8|meta_barriers|Whether barriers are |Handled together with|bool |
-| | |enabled or not for the |disk_barriers | |
-| | |meta volume | | |
-| | | | | |
-+--------+-------------+-------------------------+---------------------+------+
-|ld/drbd8|resync_rate |The (static) resync rate |Hardcoded in |int |
-| | |for drbd, when using the |constants.py, not | |
-| | |static syncer, in MiB/s |changeable via Ganeti| |
-| | | | | |
-| | | | | |
-| | | | | |
-+--------+-------------+-------------------------+---------------------+------+
-|ld/drbd8|disk_custom |Free-form string that |Not supported |string|
-| | |will be appended to the | | |
-| | |drbdsetup disk command | | |
-| | |line, for custom options | | |
-| | |not supported by Ganeti | | |
-| | |itself | | |
-+--------+-------------+-------------------------+---------------------+------+
-|ld/drbd8|net_custom |Free-form string for | | |
-| | |custom net setup options | | |
-| | | | | |
-| | | | | |
-| | | | | |
-| | | | | |
-+--------+-------------+-------------------------+---------------------+------+
-
-Note that the DRBD8 parameters will change once we support DRBD 8.4,
-which has changed syntax significantly; new syncer modes will be added
-for that release.
+The proposed model for the new disk parameters is a simple free-form one
+based on dictionaries, indexed per disk template and parameter name.
+Only the disk template parameters are visible to the user, and those are
+internally translated to logical disk level parameters.
+
+This is a simplification, because each parameter is applied to a whole
+nested structure and there is no way of fine-tuning each level's
+parameters, but it is good enough for the current parameter set. This
+model could need to be expanded, e.g., if support for three-nodes stacked
+DRBD setups is added to Ganeti.
+
+At JSON level, since the object key has to be a string, the keys can be
+encoded via a separator (e.g. slash), or by having two dict levels.
+
+When needed, the unit of measurement is expressed inside square
+brackets.
+
++--------+--------------+-------------------------+---------------------+------+
+|Disk |Name |Description |Current status |Type |
+|template| | | | |
++========+==============+=========================+=====================+======+
+|plain |stripes |How many stripes to use |Configured at |int |
+| | |for newly created (plain)|./configure time, not| |
+| | |logical voumes |overridable at | |
+| | | |runtime | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |data-stripes |How many stripes to use |Same as for |int |
+| | |for data volumes |plain/stripes | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |metavg |Default volume group for |Same as the main |string|
+| | |the metadata LVs |volume group, | |
+| | | |overridable via | |
+| | | |'metavg' key | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |meta-stripes |How many stripes to use |Same as for lvm |int |
+| | |for meta volumes |'stripes', suboptimal| |
+| | | |as the meta LVs are | |
+| | | |small | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |disk-barriers |What kind of barriers to |Either all enabled or|string|
+| | |*disable* for disks; |all disabled, per | |
+| | |either "n" or a string |./configure time | |
+| | |containing a subset of |option | |
+| | |"bfd" | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |meta-barriers |Whether to disable or not|Handled together with|bool |
+| | |the barriers for the meta|disk-barriers | |
+| | |volume | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |resync-rate |The (static) resync rate |Hardcoded in |int |
+| | |for drbd, when using the |constants.py, not | |
+| | |static syncer, in KiB/s |changeable via Ganeti| |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |dynamic-resync|Whether to use the |Not supported. |bool |
+| | |dynamic resync speed | | |
+| | |controller or not. If | | |
+| | |enabled, c-plan-ahead | | |
+| | |must be non-zero and all | | |
+| | |the c-* parameters will | | |
+| | |be used by DRBD. | | |
+| | |Otherwise, the value of | | |
+| | |resync-rate will be used | | |
+| | |as a static resync speed.| | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |c-plan-ahead |Agility factor of the |Not supported. |int |
+| | |dynamic resync speed | | |
+| | |controller. (the higher, | | |
+| | |the slower the algorithm | | |
+| | |will adapt the resync | | |
+| | |speed). A value of 0 | | |
+| | |(that is the default) | | |
+| | |disables the controller | | |
+| | |[ds] | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |c-fill-target |Maximum amount of |Not supported. |int |
+| | |in-flight resync data | | |
+| | |for the dynamic resync | | |
+| | |speed controller | | |
+| | |[sectors] | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |c-delay-target|Maximum estimated peer |Not supported. |int |
+| | |response latency for the | | |
+| | |dynamic resync speed | | |
+| | |controller [ds] | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |c-max-rate |Upper bound on resync |Not supported. |int |
+| | |speed for the dynamic | | |
+| | |resync speed controller | | |
+| | |[KiB/s] | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |c-min-rate |Minimum resync speed for |Not supported. |int |
+| | |the dynamic resync speed | | |
+| | |controller [KiB/s] | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |disk-custom |Free-form string that |Not supported |string|
+| | |will be appended to the | | |
+| | |drbdsetup disk command | | |
+| | |line, for custom options | | |
+| | |not supported by Ganeti | | |
+| | |itself | | |
++--------+--------------+-------------------------+---------------------+------+
+|drbd |net-custom |Free-form string for |Not supported |string|
+| | |custom net setup options | | |
++--------+--------------+-------------------------+---------------------+------+
+
+Currently Ganeti supports only DRBD 8.0.x, 8.2.x, 8.3.x. It will refuse
+to work with DRBD 8.4 since the :command:`drbdsetup` syntax has changed
+significantly.
+
+The barriers-related parameters have been introduced in different DRBD
+versions; please make sure that your version supports all the barrier
+parameters that you pass to Ganeti. Any version later than 8.3.0
+implements all of them.
+
+The minimum DRBD version for using the dynamic resync speed controller
+is 8.3.9, since previous versions implement different parameters.
+
+A more detailed discussion of the dynamic resync speed controller
+parameters is outside the scope of the present document. Please refer to
+the ``drbdsetup`` man page
+(`8.3 <http://www.drbd.org/users-guide-8.3/re-drbdsetup.html>`_ and
+`8.4 <http://www.drbd.org/users-guide/re-drbdsetup.html>`_). An
+interesting discussion about them can also be found in a
+`drbd-user mailing list post
+<http://lists.linbit.com/pipermail/drbd-user/2011-August/016739.html>`_.
All the above parameters are at cluster and node group level; as in
other parts of the code, the intention is that all nodes in a node group
-should be equal.
+should be equal. It will later be decided to which node group give
+precedence in case of instances split over node groups.
+
+.. admonition:: FIXME
+
+ Add details about when each parameter change takes effect (device
+ creation vs. activation)
Node parameters
~~~~~~~~~~~~~~~