Helga Velroyen [Tue, 8 Oct 2013 15:12:35 +0000 (17:12 +0200)]
Use 'DTS_LVM' when possible
This patch replaces all usages of the utility function
'GetLvmDiskTemplate' by the new 'DTS_LVM' constant
to make it consistant with the usage of other DTS_*
constants.
Additionally, it provides a unit tests to ensure
consistancy between DTS_LVM and the mapping of disk
templates and storage types.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Helga Velroyen [Tue, 8 Oct 2013 12:20:43 +0000 (14:20 +0200)]
iallocator: use lookup by disk template
So far, the iallocator requested storage information
about all enabled disk templates but discarded all but
the LVM information, even if it was allocating space
for a non-LVM instance. With this patch, it now only
asks for the one that is relevant for
the allocation request.
This has the following advantages:
- less load in the RPC call
- meaningful storage information is used for non-LVM
instance and thus better allocation
Note that this so far works only for instance allocation.
The code introduces some FIXMEs which will be resolved
when utilizing the improvements in other iallocator
requests as well.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Helga Velroyen [Tue, 8 Oct 2013 12:47:44 +0000 (14:47 +0200)]
utils/storage.py: storage info lookup by disk template
This patch improves the handling of storage information
before and after a call to the RPC 'node_info'. It
adds a function to not only call for all storage
information on the cluster (as it is used right now),
but to ask only for storage information for a particular
disk template. This way, in many cases, for example
by the iallocator, less information is requested and thus
performance is increased. Unit tests are provided.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Helga Velroyen [Tue, 8 Oct 2013 12:26:47 +0000 (14:26 +0200)]
Replace GetLvmDiskTemplates by 'DTS_LVM'
To reach consistency by how we manage different
categorizations of disk templates, this patch
introduces the set of disk templates which are lvm-based:
'DTS_LVM'.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Klaus Aehlig [Tue, 8 Oct 2013 16:09:26 +0000 (18:09 +0200)]
If possible, replace symbolic links in place
Naive 'ln -s -f a b' will put the link inside 'b', if
'b' is (a symlink to) a directory; so, during upgrades,
the links in $(sysconfdir) cannot be updated this way.
Removing and readding works, however leaves the risk
of the upgrade process dying in that very moment, thus
leaving 'gnt-cluster' a dangling link, so that the --resume
option is of no help. On GNU systems, avoid this problem
by using the -T option of GNU ln.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Klaus Aehlig [Tue, 8 Oct 2013 15:10:09 +0000 (17:10 +0200)]
Make information about GNU ln available to programs
Propagate the information on whether we have the GNU version of ln
to all programs by making it available as a constant.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Klaus Aehlig [Tue, 8 Oct 2013 14:53:27 +0000 (16:53 +0200)]
Add simple test whether ln is the GNU version
If the GNU version is present, we can use certain GNU-extensions,
like the -T option, rendering some parts more robust.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:51:40 +0000 (19:51 +0200)]
Fix 'AutoConf' import
Fix 'AutoConf' import to be qualified.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 11:37:16 +0000 (13:37 +0200)]
Fix import order
Fix import order to be alphabetically sorted.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:45:43 +0000 (19:45 +0200)]
Hs2Py constants: improve auto repair
Fix auto repair related constants to use the Haskell type 'AutoRepairResult' instead of simple 'String' values.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:44:39 +0000 (19:44 +0200)]
Hs2Py constants: opcodes
Add opcode related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:43:51 +0000 (19:43 +0200)]
Hs2Py constants: node daemon setup
Add node daemon setup related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:43:11 +0000 (19:43 +0200)]
Hs2Py constants: hail, opcode, and SSH
Add hail, opcode, and SSH related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:42:07 +0000 (19:42 +0200)]
Hs2Py constants: assorted constants
Add assorted constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:40:57 +0000 (19:40 +0200)]
Hs2Py constants: UID pool
Add UID pool related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:40:01 +0000 (19:40 +0200)]
Hs2Py constants: 'maxUdpDataSize'
Add 'maxUdpDataSize' constant to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:39:09 +0000 (19:39 +0200)]
Hs2Py constants: remove comments
Remove several comment from 'lib/constants.py' because these have been moved to Haskell.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:36:28 +0000 (19:36 +0200)]
Hs2Py constants: assorted constants
Add some assorted constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:35:40 +0000 (19:35 +0200)]
Hs2Py constants: 'ispecsMinmaxDefaults'
Add 'ispecsMinmaxDefaults' to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:34:16 +0000 (19:34 +0200)]
Hs2Py constants: 'hvcGlobals' and 'ndcGlobals'
Add 'hvcGlobals' and 'ndcGlobals' to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:32:44 +0000 (19:32 +0200)]
Hs2Py constants: 'defaultEnabledHypervisor'
Add 'defaultEnabledHypervisor' to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:32:01 +0000 (19:32 +0200)]
Hs2Py constants: SSCONF
Add SSCONF related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:30:51 +0000 (19:30 +0200)]
Hs2Py constants: dynamic devices
Add dynamic devices related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:29:56 +0000 (19:29 +0200)]
Hs2Py constants: HT related constants
Add HT related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:27:12 +0000 (19:27 +0200)]
Hs2py constants: query resources
Add query resources related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:24:55 +0000 (19:24 +0200)]
Hs2Py constants: '/etc/hosts' and job queue
Add '/etc/hosts' and job queue related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:23:01 +0000 (19:23 +0200)]
Hs2Py constants: VNC
Add VNC related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 17:21:17 +0000 (19:21 +0200)]
Hs2Py constants: SSL, job queue, and locks
Add SSL, job queue, and locks related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:35:33 +0000 (18:35 +0200)]
Hs2Py constants: node verify
Add node verify constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 08:49:39 +0000 (10:49 +0200)]
Hs2Py constants: assorted, idisk, and inic
Add assorted, idisk, and inic related constants to the Haskell to
Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:28:12 +0000 (18:28 +0200)]
Hs2Py constants: nics
Add nics related constants to the Haskell to Python constant
generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 08:03:23 +0000 (10:03 +0200)]
Hs2Py constant: DRBD and dynamic disk
Add DRBD and dynamic disk parameter constants to the Haskell to Python
constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 08:18:07 +0000 (10:18 +0200)]
Hs2Py constants: backend and logical disks
Add backend and logical disks related constants to the Haskell to
Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 08:12:23 +0000 (10:12 +0200)]
Hs2Py constants: HVST and disk state
Add HVST and disk state related constants to the Haskell to Python
constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 08:11:45 +0000 (10:11 +0200)]
Hs2Py constants: assorted and HVS
Add asserted and HVS related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:12:01 +0000 (18:12 +0200)]
Hs2Py constants: move reboot types
Move constants 'instanceReboot*' to correct place according to
'lib/constants.py'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:11:46 +0000 (18:11 +0200)]
Hs2Py constants: reboot behaviour
Add reboot behaviour constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 08:38:11 +0000 (10:38 +0200)]
Hs2Py constants: scripts and actions
Add script and action related constants to the Haskell to Python
constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:08:52 +0000 (18:08 +0200)]
Hs2Py constants: move 'ipCommandPath'
Move constant 'ipCommandPath' to the appropriate place according to
'lib/constants.py'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:08:36 +0000 (18:08 +0200)]
Hs2Py constants: 'jobIdsKey', 'runparts' and 'rpc'
Add several groups of constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:07:15 +0000 (18:07 +0200)]
Hs2Py constants: 'diskTransferConnectTimeout'
Add 'diskTransferConnectTimeout' constant to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:06:14 +0000 (18:06 +0200)]
Hs2Py constants: remove comments
Remove useless comments from 'lib/constants.py'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:03:36 +0000 (18:03 +0200)]
Hs2Py constants: network related
Add network related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:02:04 +0000 (18:02 +0200)]
Hs2Py constants: add import/export config
Add import/export config constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 16:01:12 +0000 (18:01 +0200)]
Hs2Py constants: add 'RIE' related
Add remote import/export related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:57:04 +0000 (17:57 +0200)]
Hs2Py constants: add DRBD and RBD
Add DRBD and RBD related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:54:40 +0000 (17:54 +0200)]
Hs2Py constants: storage related groups
Add several groups of storage related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:42:51 +0000 (17:42 +0200)]
Hs2Py constants: add several groups of constants
Add several groups of constants, namely, console types, security, I/O
compression, import/export, hooks, and hkr related, to the Haskell to
Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:29:55 +0000 (17:29 +0200)]
Hs2Py constants: add 2 more constants
Add 2 more constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:25:18 +0000 (17:25 +0200)]
Hs2Py constants: add CPU pinning
Add CPU pinning constants to the Haskell to Python constant
generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:23:09 +0000 (17:23 +0200)]
Hs2Py constants: add export versions
Add export version constants to the Haskell to Python constant
generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:16:28 +0000 (17:16 +0200)]
Move VTypes to the appropriate place
Move 'VType' related constants to the appropriate place to match
Python's constants module.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 15:10:00 +0000 (17:10 +0200)]
Hs2Py constants: add SSH key files
Add SSH key file constants to the Haskell to Python constant
generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 14:16:48 +0000 (16:16 +0200)]
Hs2Py constants: add network mirrored disk templates
Add network mirrored disk template constants to the Haskell to Python
constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 12:12:58 +0000 (14:12 +0200)]
Fix documentation comment
Fix documentation comment in 'Ganeti.ConstantUtils'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 18:25:32 +0000 (20:25 +0200)]
Hs2Py constants: update forgotten 'SOCAT_ESCAPE_CODE'
Update constant 'SOCAT_ESCAPE_CODE' to retrieve its value from the
generated 'lib/_constants.py'. The Haskell counterpart of this
constant, namely, 'socatEscapeCode', has already been added.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 12:11:47 +0000 (14:11 +0200)]
Hs2Py constants: add Luxi constants
Add Luxi related constants to the Haskell to Python constant
generation. A new Haskell type is added 'Ganeti.Types.PythonChar' to
wrap the Python character type.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 7 Oct 2013 07:51:57 +0000 (09:51 +0200)]
Hs2Py constants: add 'fileDriver'
Add constant 'fileDriver' to the Haskell to Python constant
generation. The constant 'FILE_DRIVER' is also moved to the
appropriate place in 'lib/constants.py'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 12:08:23 +0000 (14:08 +0200)]
Hs2Py constants: add local disk status
Add constants related to local disk status to the Haskell to Python
constant generation. A new Haskell type 'LocalDiskStatus' is added
similarly to the constants that have been added previously in other
Hs2Py patches.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 4 Oct 2013 11:55:32 +0000 (13:55 +0200)]
Hs2Py constants: constants related to 'Ganeti.Htools.Types'
Add constants related to the Haskell types defined in
'Ganeti.Htools.Types' to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Wed, 2 Oct 2013 15:27:30 +0000 (17:27 +0200)]
Hs2Py constants: add node parameter related constants
Add node parameter related constants to the Haskell to Python constant
generation. This patch also fixes a type inconsistency between
Haskell and Python, namely, 'ndsParameterTypes' and
'ndsParameterTitles' become 'Map's instead of 'Tuple's, which allows
us to simplify the module 'Ganeti.Query.Common'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Wed, 2 Oct 2013 15:18:14 +0000 (17:18 +0200)]
Hs2Py constants: add RPC timeout constants
Add RPC timeout related constants to the Haskell to Python constant
generation. The Haskell data type 'RpcTimeout' is moved from
'Ganeti.Rpc' to 'Ganeti.Types' so it can be used by
'Ganeti.HsConstants' without causing circularity problems with
'Ganeti.Rpc'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Wed, 2 Oct 2013 14:49:59 +0000 (16:49 +0200)]
Hs2Py constants: add 'ReplaceDisksMode' related constants
Add constants related to the Haskell type 'ReplaceDisksMode'. The
data type declaration for 'ReplaceDisksMode' is also moved from
'Ganeti.OpParams' to 'Ganeti.Types' because it used to be used only by
the opcodes and now it is also needed for the constants.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Wed, 2 Oct 2013 13:25:04 +0000 (15:25 +0200)]
Hs2Py constants: add 'osApiVersions'
Add constant 'osApiVersions' to the Haskell to Python constant
generation. This patch fixes the type of this constant, by changing
from 'List' to 'Set', therefore, 'Ganeti.Query.Server' is updated
accordingly.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Wed, 2 Oct 2013 13:24:32 +0000 (15:24 +0200)]
Fix indentation
Fix indentation in 'Ganeti.OpCodes'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Wed, 2 Oct 2013 13:18:07 +0000 (15:18 +0200)]
Fix typo in documentation
Fix typo in documentation in 'Ganeti.JSON'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Wed, 2 Oct 2013 13:16:06 +0000 (15:16 +0200)]
Disregard comments in 'src/Ganeti/ListContants.hs' target
Update target 'src/Ganeti/ListContants.hs' to disregard comments in
'src.Ganeti.HsContants' when extracting the names of the constants
that need to be generated from Haskell to Python.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 30 Sep 2013 09:03:38 +0000 (11:03 +0200)]
Hs2Py constants: add more constants
Add more constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 30 Sep 2013 09:03:15 +0000 (11:03 +0200)]
Hs2Py constants: add 'Ganeti.Confd' types
Hs2Py constants: add 'Ganeti.Confd' types.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 30 Sep 2013 09:00:57 +0000 (11:00 +0200)]
Add 'declareILADT' to declare integer literal datatypes
Add 'declareILADT' to declare integer literal datatypes.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Mon, 30 Sep 2013 09:00:20 +0000 (11:00 +0200)]
Update reference to proper module
Update reference to constant 'confdMagicFourcc' to fetch its value
from 'Ganeti.Constants' instead of the re-export from module
'Ganeti.Confd.Types'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Thu, 26 Sep 2013 15:19:34 +0000 (17:19 +0200)]
Hs2Py constants: add confd requests
Add confd request related constants to the Haskell to Python constant
generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Thu, 26 Sep 2013 15:15:29 +0000 (17:15 +0200)]
Move confd request constants to 'Ganeti.ConstantUtils'
* move confd request related constants to 'Ganeti.ConstantUtils' so
they can be used in both 'Ganeti.HsConstants' and
'Ganeti.Confd.Types' without circularity problems and GHC stage
restrictions.
* fix some comments
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Mon, 7 Oct 2013 10:46:26 +0000 (12:46 +0200)]
Add --resume option to 'gnt-cluster upgrade'
This option will resume an upgrade of the Ganeti version of
a cluster that got interrupted by a reboot of the master node,
or similar event.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Mon, 7 Oct 2013 13:20:54 +0000 (15:20 +0200)]
Add function to determine current configuration version
The 'gnt-cluster upgrade --resume' command needs to determine whether the
configuration has already been updated or not, in order to decide at which
phase to resume. So provide a function to determine the version of the
configuration on file.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Mon, 7 Oct 2013 12:40:08 +0000 (14:40 +0200)]
Add method to read and parse the intent-to-upgrade file
During upgrades, a file is written to disk on master that documents
the fact that an upgrade is currently in progress. Add a function
to parse it.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Mon, 7 Oct 2013 14:40:22 +0000 (16:40 +0200)]
Provide utility function to check a configuration version
In order for 'gnt-cluster upgrade --resume' to determine whether the configuration
is already upgraded, it needs to compare whether a configuration version is compatible
with a Ganeti target version. Provide a utility function for this.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Mon, 7 Oct 2013 14:40:45 +0000 (16:40 +0200)]
Fix typo in doc string
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Fri, 4 Oct 2013 17:39:56 +0000 (19:39 +0200)]
Write the intent-to-upgrade file during upgrades
To recognize that an upgrade attempt of a cluster was interrupted by a
power failure or similar, write a file into the file system documenting
that currently an upgrade is in progress.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Fri, 4 Oct 2013 17:07:19 +0000 (19:07 +0200)]
Provide an inverse to UnescapeAndSplit
With utils.UnescapeAndSplit, we have a function to parse
arbitrary non-empty string lists encoded as strings. Also
provide the appropriate encoding function.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Fri, 4 Oct 2013 15:53:04 +0000 (17:53 +0200)]
Specify the intent-to-upgrade path
During a Ganeti upgrade, 'gnt-cluster upgrade --to' documents the
fact that an upgrade is going on in a file, in case of a power failure
on the master node. Specify the full file name in pathutils.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Raffa Santi [Mon, 7 Oct 2013 09:27:49 +0000 (11:27 +0200)]
Hardcode default access mode to kernelspace
Hardcode constants.KERNELSPACE as the default access method for
KVM disk templates, rather than allowing a change to the RBD default
access mode to affect all disk templates for KVM.
At some point in the future it might make more sense to have this
value as its own constant, but as it stands it makes little sense:
only one of several disk templates and one of several hypervisors
support an userspace option to begin with.
Signed-off-by: Raffa Santi <rsanti@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Fri, 4 Oct 2013 15:05:08 +0000 (17:05 +0200)]
Mention the private-module layout in NEWS
As the new private-module layout of Ganeti's python code implies
the 'import ganeti' will fail in python, this change is incompatible,
and hence should be mentioned. The impact is, however, limited, as the
internal API was never promised to be a stable interface.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Fri, 4 Oct 2013 14:59:43 +0000 (16:59 +0200)]
Get NEWS sections in consistent order
For all releases, the section on incompatible changes comes first,
as these changes are the ones to take most care of. New features
are not as important, as they can safely be ignored if you have no
use for them. Get the section on version 2.10.0 into that order, too.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Santi Raffa [Fri, 4 Oct 2013 11:54:39 +0000 (13:54 +0200)]
Handle scenarios where access is not set
It should not be possible to reach _GenerateKVMRuntime without having
the access method set, but if it does happen this commit makes sure
the default value is used anyway.
Signed-off-by: Raffa Santi <rsanti@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Klaus Aehlig [Wed, 2 Oct 2013 08:00:49 +0000 (10:00 +0200)]
Document gnt-cluster upgrade in the man page
A new command, upgrade, was added to gnt-cluster. Document it.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Tue, 24 Sep 2013 10:43:33 +0000 (12:43 +0200)]
Add an upgrade command to gnt-cluster
This command will coordinate the switching to a new
Ganeti version across the cluster. This has become
possible by the new layout that allows several Ganeti
versions to be present at the same time.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Tue, 1 Oct 2013 09:16:40 +0000 (11:16 +0200)]
Provide the DIRVERSION as a constant
Depending on configure options, the version string used in the name
of the version specific directory differs. Provide this string also
as a constant, as it is needed for the upgrade procedure, in order to
be able to roll back.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Tue, 1 Oct 2013 08:00:45 +0000 (10:00 +0200)]
Provide time constants related to upgrades
During upgrades, gnt-cluster needs to wait for all jobs
in the queue to finish. Provide constants for timeout and
polling interval.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Mon, 30 Sep 2013 11:59:31 +0000 (13:59 +0200)]
Add option to redist-conf while queue is drained
Add a new option to 'gnt-cluster redist-conf' allowing to ignore a drained
state of the Ganeti queue. This is needed (until we implement the fine-grained
queue control) during upgrades, as here we have to redistribute the configuration
to all nodes before undraining the queue.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Fri, 27 Sep 2013 16:26:28 +0000 (18:26 +0200)]
Provide means of submitting jobs to a drained queue
During an upgrade, the job queue needs to be drained in order to avoid
new jobs coming to the cluster. Nevertheless, the upgrade process
needs to carry out some maintenance, like redistributing the new
configuration, therefore, this patch provides a means of submitting
jobs to a drained queue.
Of course, once the more fine-grained job queue control will be implemented,
this functionality can be removed.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Fri, 27 Sep 2013 13:27:06 +0000 (15:27 +0200)]
Expose sharedir in pathutils
This path is needed to construct the link target
for $(sysconfdir)/ganeti/share for a different version.
The latter will happen in the automated upgrade procedure.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Wed, 2 Oct 2013 07:06:36 +0000 (09:06 +0200)]
Provide path to ensure-dirs in pathutils
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Thu, 26 Sep 2013 15:06:10 +0000 (17:06 +0200)]
Provide the canonical path to cfgupgrade in pathutils
This is the version-independent path for cfgupgrade, that will
always refer to the cfgupgrade of the currently installed version.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Wed, 25 Sep 2013 09:30:21 +0000 (11:30 +0200)]
Expose the list of online nodes at ssconf
Ganeti's ssconf contains the list of nodes currently considered
online. Expose this data at the ssconf interface.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Tue, 24 Sep 2013 16:42:20 +0000 (18:42 +0200)]
Also export PKGLIBDIR in pathutils
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Thu, 26 Sep 2013 14:15:22 +0000 (16:15 +0200)]
Add predicate whether to call cfgupgrade --downgrade
Provide a predicate that, given the current version and the
version to go to, tells whether it is appropriate to call
cfgupgrade --downgrade.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Tue, 24 Sep 2013 12:04:20 +0000 (14:04 +0200)]
Add utility function to recognize upgrade ranges
Upgrading is possible within the same major version to any equal
or higher minor version. Downgrading is possible within the same
major version to the previous minor version. Moreover, automatic
upgrades are only supported from version 2.10 onwards. Add a utility
function implementing this logic.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Thu, 26 Sep 2013 13:06:09 +0000 (15:06 +0200)]
Also provide the program version
Conceptionally, the versions of the program, the protocols, and the
configuration are three different things, even though, currently there
is a tight coupling. So export the version as well, as the upgrades
are designed to make decisions based on the version.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>
Klaus Aehlig [Tue, 24 Sep 2013 07:55:00 +0000 (09:55 +0200)]
Add utility function to parse version strings
The new 'gnt-cluster upgrade' command will get a Ganeti version as
argument. So provide a function able to parse it.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>