Revision b8e39189 doc/design-upgrade.rst
b/doc/design-upgrade.rst | ||
---|---|---|
29 | 29 |
to install new binaries ahead of time, and the actual switch |
30 | 30 |
between versions will be a single command. |
31 | 31 |
|
32 |
While changing the file layout anyway, we install the python |
|
33 |
code, which is architecture independent, under ``${prefix}/share``, |
|
34 |
in a way that properly separates the Ganeti libraries of the |
|
35 |
various versions. |
|
36 |
|
|
32 | 37 |
Path changes to allow multiple versions installed |
33 | 38 |
------------------------------------------------- |
34 | 39 |
|
... | ... | |
37 | 42 |
|
38 | 43 |
These paths will be changed in the following way. |
39 | 44 |
|
40 |
- The python package will be installed to ``${pythondir}/ganeti-${VERSION}``. |
|
41 |
Here ${VERSION} is the full qualified version number, consisting of |
|
42 |
major, minor, revision, and suffix. All python executables will be changed |
|
43 |
to import the correct version of the ganeti package. |
|
45 |
- The python package will be installed to |
|
46 |
``${PREFIX}/share/ganeti/${VERSION}/ganeti``. |
|
47 |
Here ${VERSION} is, depending on configure options, either the full qualified |
|
48 |
version number, consisting of major, minor, revision, and suffix, or it is |
|
49 |
just a major.minor pair. All python executables will be installed under |
|
50 |
``${PREFIX}/share/ganeti/${VERSION}`` so that they see their respective |
|
51 |
Ganeti library. ``${PREFIX}/share/ganeti/default`` is a symbolic link to |
|
52 |
``${sysconfdir}/ganeti/share`` which, in turn, is a symbolic link to |
|
53 |
``${PREFIX}/share/ganeti/${VERSION}``. For all python executatables (like |
|
54 |
``gnt-cluster``, ``gnt-node``, etc) symbolic links going through |
|
55 |
``${PREFIX}/share/ganeti/default`` are added under ``${PREFIX}/sbin``. |
|
44 | 56 |
|
45 | 57 |
- All other files will be installed to the corresponding path under |
46 |
``${libdir}/ganeti-${VERSION}`` instead of under ``${PREFIX}`` |
|
47 |
directly, where ${libdir} defaults to ${PREFIX}/lib. Symbolic links |
|
48 |
to these files will be added under ``${PREFIX}/bin``, |
|
49 |
``${PREFIX}/sbin``, and so on. |
|
50 |
|
|
51 |
As only each version itself has the authoritative knowledge of which |
|
52 |
files belong to it, each version provides two executables ``install`` |
|
53 |
and ``uninstall`` that add and remove the symbolic links, |
|
54 |
respectively. Both executables will be idempotent and only touch |
|
55 |
symbolic links that are outside the directory for their version of |
|
56 |
Ganeti and point into this directory. In particular, an ``uninstall`` |
|
57 |
of one version will not interfere with an ``install`` of a different |
|
58 |
version. |
|
58 |
``${libdir}/ganeti/${VERSION}`` instead of under ``${PREFIX}`` |
|
59 |
directly, where ``${libdir}`` defaults to ``${PREFIX}/lib``. |
|
60 |
``${libdir}/ganeti/default`` will be a symlink to ``${sysconfdir}/ganeti/lib`` |
|
61 |
which, in turn, is a symlink to ``${libdir}/ganeti/${VERSION}``. |
|
62 |
Symbolic links to the files installed under ``${libdir}/ganeti/${VERSION}`` |
|
63 |
will be added under ``${PREFIX}/bin``, ``${PREFIX}/sbin``, and so on. These |
|
64 |
symbolic links will go through ``${libdir}/ganeti/default`` so that the |
|
65 |
version can easily be changed by updating the symbolic link in |
|
66 |
``${sysconfdir}``. |
|
67 |
|
|
68 |
The set of links for ganeti binaries might change between the versions. |
|
69 |
However, as the file structure under ``${libdir}/ganeti/${VERSION}`` reflects |
|
70 |
that of ``/``, two links of differnt versions will never conflict. Similarly, |
|
71 |
the symbolic links for the python executables will never conflict, as they |
|
72 |
always point to a file with the same basename directly under |
|
73 |
``${PREFIX}/share/ganeti/default``. Therefore, each version will make sure that |
|
74 |
enough symbolic links are present in ``${PREFIX}/bin``, ``${PREFIX}/sbin`` and |
|
75 |
so on, even though some might be dangling, if a differnt version of ganeti is |
|
76 |
currently active. |
|
77 |
|
|
78 |
The extra indirection through ``${sysconfdir}`` allows installations that choose |
|
79 |
to have ``${sysconfdir}`` and ``${localstatedir}`` outside ``${PREFIX}`` to |
|
80 |
mount ``${PREFIX}`` read-only. The latter is important for systems that choose |
|
81 |
``/usr`` as ``${PREFIX}`` and are following the Filesystem Hierarchy Standard. |
|
82 |
For example, choosing ``/usr`` as ``${PREFIX}`` and ``/etc`` as ``${sysconfdir}``, |
|
83 |
the layout for version 2.10 will look as follows. |
|
84 |
:: |
|
85 |
|
|
86 |
/ |
|
87 |
| |
|
88 |
+-- etc |
|
89 |
| | |
|
90 |
| +-- ganeti |
|
91 |
| | |
|
92 |
| +-- lib -> /usr/lib/ganeti/2.10 |
|
93 |
| | |
|
94 |
| +-- share -> /usr/share/ganeti/2.10 |
|
95 |
+-- usr |
|
96 |
| |
|
97 |
+-- bin |
|
98 |
| | |
|
99 |
| +-- harep -> /usr/lib/ganeti/default/usr/bin/harep |
|
100 |
| | |
|
101 |
| ... |
|
102 |
| |
|
103 |
+-- sbin |
|
104 |
| | |
|
105 |
| +-- gnt-cluster -> /usr/share/ganeti/default/gnt-cluster |
|
106 |
| | |
|
107 |
| ... |
|
108 |
| |
|
109 |
+-- ... |
|
110 |
| |
|
111 |
+-- lib |
|
112 |
| | |
|
113 |
| +-- ganeti |
|
114 |
| | |
|
115 |
| +-- default -> /etc/ganeti/lib |
|
116 |
| | |
|
117 |
| +-- 2.10 |
|
118 |
| | |
|
119 |
| +-- usr |
|
120 |
| | |
|
121 |
| +-- bin |
|
122 |
| | | |
|
123 |
| | +-- htools |
|
124 |
| | | |
|
125 |
| | +-- harep -> htools |
|
126 |
| | | |
|
127 |
| | ... |
|
128 |
| ... |
|
129 |
| |
|
130 |
+-- share |
|
131 |
| |
|
132 |
+-- ganeti |
|
133 |
| |
|
134 |
+-- default -> /etc/ganeti/share |
|
135 |
| |
|
136 |
+-- 2.10 |
|
137 |
| |
|
138 |
+ -- gnt-cluster |
|
139 |
| |
|
140 |
+ -- gnt-node |
|
141 |
| |
|
142 |
+ -- ... |
|
143 |
| |
|
144 |
+ -- ganeti |
|
145 |
| |
|
146 |
+-- backend.py |
|
147 |
| |
|
148 |
+-- ... |
|
149 |
| |
|
150 |
+-- cmdlib |
|
151 |
| | |
|
152 |
| ... |
|
153 |
... |
|
154 |
|
|
155 |
|
|
59 | 156 |
|
60 | 157 |
gnt-upgrade |
61 | 158 |
----------- |
... | ... | |
110 | 207 |
- If the action is a downgrade to the previous minor version, the |
111 | 208 |
configuration is downgraded now, using ``cfgupgrade --downgrade``. |
112 | 209 |
|
113 |
- The current version of ganeti is deactivated on all nodes, using the |
|
114 |
``uninstall`` executable described earlier. |
|
115 |
|
|
116 |
- The new version of ganeti is activated on all nodes, using the |
|
117 |
``install`` executable described earlier. |
|
210 |
- The ``${sysconfdir}/ganeti/lib`` and ``${sysconfdir}/ganeti/share`` |
|
211 |
symbolic links are updated. |
|
118 | 212 |
|
119 | 213 |
- If the action is an upgrade to a higher minor version, the configuration |
120 | 214 |
is upgraded now, using ``cfgupgrade``. |
Also available in: Unified diff