Statistics
| Branch: | Tag: | Revision:

root / doc / design-storagespace.rst @ ab8747b7

History | View | Annotate | Download (4.2 kB)

1 ab8747b7 Guido Trotter
============================
2 ab8747b7 Guido Trotter
Storage free space reporting
3 ab8747b7 Guido Trotter
============================
4 ab8747b7 Guido Trotter
5 ab8747b7 Guido Trotter
.. contents:: :depth: 4
6 ab8747b7 Guido Trotter
7 ab8747b7 Guido Trotter
Background
8 ab8747b7 Guido Trotter
==========
9 ab8747b7 Guido Trotter
10 ab8747b7 Guido Trotter
Currently Space reporting is broken for all storage types except drbd or
11 ab8747b7 Guido Trotter
lvm (plain). This design looks at the root causes and proposes a way to
12 ab8747b7 Guido Trotter
fix it.
13 ab8747b7 Guido Trotter
14 ab8747b7 Guido Trotter
Proposed changes
15 ab8747b7 Guido Trotter
================
16 ab8747b7 Guido Trotter
17 ab8747b7 Guido Trotter
The changes below will streamline Ganeti to properly support
18 ab8747b7 Guido Trotter
interaction with different storage types.
19 ab8747b7 Guido Trotter
20 ab8747b7 Guido Trotter
Configuration changes
21 ab8747b7 Guido Trotter
---------------------
22 ab8747b7 Guido Trotter
23 ab8747b7 Guido Trotter
Each storage type will have a new "pools" parameter added (type list of
24 ab8747b7 Guido Trotter
strings). This will be list of vgs for plain and drbd (note that we make
25 ab8747b7 Guido Trotter
no distinction at this level between allowed vgs and metavgs), the list
26 ab8747b7 Guido Trotter
of rados pools for rados, or the storage directory for file and
27 ab8747b7 Guido Trotter
sharedfile. The parameters already present in the cluster config object
28 ab8747b7 Guido Trotter
will be moved to the storage parameters.
29 ab8747b7 Guido Trotter
30 ab8747b7 Guido Trotter
Since currently file and sharedfile only support a single directory this
31 ab8747b7 Guido Trotter
list will be limited to one. In the future if we'll have support for
32 ab8747b7 Guido Trotter
more directories, or for per-nodegroup directories this can be changed.
33 ab8747b7 Guido Trotter
34 ab8747b7 Guido Trotter
Note that these are just "mechanisms" parameters that define which
35 ab8747b7 Guido Trotter
storage pools the cluster can use. Further filtering about what's
36 ab8747b7 Guido Trotter
allowed can go in the ipolicy, but these changes are not covered in this
37 ab8747b7 Guido Trotter
design doc.
38 ab8747b7 Guido Trotter
39 ab8747b7 Guido Trotter
Since the ipolicy currently has a list of enabled storage types, we'll
40 ab8747b7 Guido Trotter
use that to decide which storage type is the default, and to self-select
41 ab8747b7 Guido Trotter
it for new instance creations, and reporting.
42 ab8747b7 Guido Trotter
43 ab8747b7 Guido Trotter
Enabling/disabling of storage types at ``./configure`` time will be
44 ab8747b7 Guido Trotter
eventually removed.
45 ab8747b7 Guido Trotter
46 ab8747b7 Guido Trotter
RPC changes
47 ab8747b7 Guido Trotter
-----------
48 ab8747b7 Guido Trotter
49 ab8747b7 Guido Trotter
The noded RPC call that reports node storage space will be changed to
50 ab8747b7 Guido Trotter
accept a list of <method>,<key> string tuples. For each of them it will
51 ab8747b7 Guido Trotter
report the free amount of space found on storage <key> as known by the
52 ab8747b7 Guido Trotter
requested method. Methods are for example ``lvm``, ``filesystem``,
53 ab8747b7 Guido Trotter
``rados``, and the key would be a volume group name in the case of lvm,
54 ab8747b7 Guido Trotter
a directory name for the filesystem and a rados pool name, for
55 ab8747b7 Guido Trotter
rados_pool.
56 ab8747b7 Guido Trotter
57 ab8747b7 Guido Trotter
Masterd will know (through a constant map) which storage type uses which
58 ab8747b7 Guido Trotter
method for storage calculation (i.e. ``plain`` and ``drbd`` use ``lvm``,
59 ab8747b7 Guido Trotter
``file`` and ``sharedfile`` use ``filesystem``, etc) and query the one
60 ab8747b7 Guido Trotter
needed (or all of the needed ones).
61 ab8747b7 Guido Trotter
62 ab8747b7 Guido Trotter
Note that for file and sharedfile the node knows which directories are
63 ab8747b7 Guido Trotter
allowed and won't allow any other directory to be queried for security
64 ab8747b7 Guido Trotter
reasons. The actual path still needs to be passed to distinguish the
65 ab8747b7 Guido Trotter
two, as the method will be the same for both.
66 ab8747b7 Guido Trotter
67 ab8747b7 Guido Trotter
These calculations will be implemented in the node storage system
68 ab8747b7 Guido Trotter
(currently lib/storage.py) but querying will still happen through the
69 ab8747b7 Guido Trotter
``node info`` call, to avoid requiring an extra RPC each time.
70 ab8747b7 Guido Trotter
71 ab8747b7 Guido Trotter
Ganeti reporting
72 ab8747b7 Guido Trotter
----------------
73 ab8747b7 Guido Trotter
74 ab8747b7 Guido Trotter
``gnt-node list`` will by default report information just about the
75 ab8747b7 Guido Trotter
default storage type. It will be possible to add fields to ask about
76 ab8747b7 Guido Trotter
other ones, if they're enabled.
77 ab8747b7 Guido Trotter
78 ab8747b7 Guido Trotter
``gnt-node info`` will report information about all enabled storage
79 ab8747b7 Guido Trotter
types, without querying them (just say which ones are supported
80 ab8747b7 Guido Trotter
according to the cluster configuration).
81 ab8747b7 Guido Trotter
82 ab8747b7 Guido Trotter
``gnt-node list-storage`` will change to report information about all
83 ab8747b7 Guido Trotter
available storage pools in each storage type. An extra flag will be
84 ab8747b7 Guido Trotter
added to filter by storage pool name (alternatively we can implement
85 ab8747b7 Guido Trotter
this by allowing to query by a list of ``type:pool`` string tuples to
86 ab8747b7 Guido Trotter
have a more comprehensive filter).
87 ab8747b7 Guido Trotter
88 ab8747b7 Guido Trotter
89 ab8747b7 Guido Trotter
Allocator changes
90 ab8747b7 Guido Trotter
-----------------
91 ab8747b7 Guido Trotter
92 ab8747b7 Guido Trotter
The iallocator protocol doesn't need to change: since we know which
93 ab8747b7 Guido Trotter
storage type an instance has, we'll pass only the "free" value for that
94 ab8747b7 Guido Trotter
storage type to the iallocator, when asking for an allocation to be
95 ab8747b7 Guido Trotter
made. Note that for DRBD nowadays we ignore the case when vg and metavg
96 ab8747b7 Guido Trotter
are different, and we only consider the main VG. Fixing this is outside
97 ab8747b7 Guido Trotter
the scope of this design.
98 ab8747b7 Guido Trotter
99 ab8747b7 Guido Trotter
Rebalancing changes
100 ab8747b7 Guido Trotter
-------------------
101 ab8747b7 Guido Trotter
102 ab8747b7 Guido Trotter
Hbal will not need changes, as it handles it already. We don't forecast
103 ab8747b7 Guido Trotter
any changes needed to it.
104 ab8747b7 Guido Trotter
105 ab8747b7 Guido Trotter
Space reporting changes
106 ab8747b7 Guido Trotter
-----------------------
107 ab8747b7 Guido Trotter
108 ab8747b7 Guido Trotter
Hspace will by default report by assuming the allocation will happen on
109 ab8747b7 Guido Trotter
the default storage for the cluster/nodegroup. An option will be added
110 ab8747b7 Guido Trotter
to manually specify a different storage.
111 ab8747b7 Guido Trotter
112 ab8747b7 Guido Trotter
.. vim: set textwidth=72 :
113 ab8747b7 Guido Trotter
.. Local Variables:
114 ab8747b7 Guido Trotter
.. mode: rst
115 ab8747b7 Guido Trotter
.. fill-column: 72
116 ab8747b7 Guido Trotter
.. End: