ganeti-local
10 years agoCheck for running instances when disabling templates
Helga Velroyen [Wed, 9 Oct 2013 09:24:03 +0000 (11:24 +0200)]
Check for running instances when disabling templates

This patch introduces a function to be used in
'gnt-cluster modify' when disabling a couple of disk
templates. It checks whether there are still instances
running that use these templates.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMerge branch 'stable-2.9' into master
Klaus Aehlig [Wed, 9 Oct 2013 14:05:20 +0000 (16:05 +0200)]
Merge branch 'stable-2.9' into master

* stable-2.9
  Version bump for 2.9.0 rc2
  Update NEWS for 2.9.0 rc2
  Downgrade 'vif_script'
  Downgrade 'xen_cmd'
  Add test cluster config for version 2.9
  Remove superfluous import of 'errors'
  Start NEWS entry for 2.9.0 rc2
  Fix lint errors
  Fix upgrade and downgrade regarding disk.dev_type
  Rename LDS_DRBD to DTS_DRBD

* stable-2.8
  Fix typo in walkthrough documentation
  Don't attemp ipv6 ssh in case of ipv4 cluster
  Fix outdated documentation for users-setup

Conflicts:
NEWS: trivial
configure.ac: ignore suffix bump on stable-2.9
lib/constants.py: manually replay 66a37e on master
lib/objects.py: manually apply the LDS -> DTS change on master
test/data/cluster_config_2.9.json: take version of stable-2.9
tools/cfgupgrade: union of all Upgrade tasks, remove all downgrade paths from stable-2.9

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoSuggest running 'gnt-cluster upgrade --resume' at reboots
Klaus Aehlig [Wed, 9 Oct 2013 11:27:19 +0000 (13:27 +0200)]
Suggest running 'gnt-cluster upgrade --resume' at reboots

In the example crontab, add an entry to run 'gnt-cluster upgrade --resume'
upon reboot of the node, as suggested in the design document.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMention 'gnt-cluster upgrade' in NEWS
Klaus Aehlig [Wed, 9 Oct 2013 11:13:23 +0000 (13:13 +0200)]
Mention 'gnt-cluster upgrade' in NEWS

We added a new command, so mention it as news.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoUpdate man page for 'gnt-cluster upgrade --resume'
Klaus Aehlig [Wed, 9 Oct 2013 11:03:44 +0000 (13:03 +0200)]
Update man page for 'gnt-cluster upgrade --resume'

This option is now implemented, and this change should be
mentioned in the man page. Also, document that it is safe
call on all nodes, and if no update was going on.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoNEWS: mention improvements on instance allocation
Helga Velroyen [Wed, 9 Oct 2013 08:16:41 +0000 (10:16 +0200)]
NEWS: mention improvements on instance allocation

This patch mentions the improvements of the iallocator
with respect to instance allocation of non-LVM disk
templates.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUse 'DTS_LVM' when possible
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>

10 years agoiallocator: use lookup by disk template
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>

10 years agoutils/storage.py: storage info lookup by disk template
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>

10 years agoReplace GetLvmDiskTemplates by 'DTS_LVM'
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>

10 years agoIf possible, replace symbolic links in place
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>

10 years agoMake information about GNU ln available to programs
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>

10 years agoAdd simple test whether ln is the GNU version
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>

10 years agoVersion bump for 2.9.0 rc2 v2.9.0rc2
Klaus Aehlig [Tue, 8 Oct 2013 12:57:54 +0000 (14:57 +0200)]
Version bump for 2.9.0 rc2

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoUpdate NEWS for 2.9.0 rc2
Klaus Aehlig [Tue, 8 Oct 2013 12:56:24 +0000 (14:56 +0200)]
Update NEWS for 2.9.0 rc2

Document that we have also taken care of the bug in 'cfgupgrade --downgrade'
and schedule release date.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix 'AutoConf' import
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>

10 years agoFix import order
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>

10 years agoHs2Py constants: improve auto repair
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>

10 years agoHs2Py constants: opcodes
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>

10 years agoHs2Py constants: node daemon setup
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>

10 years agoHs2Py constants: hail, opcode, and SSH
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>

10 years agoHs2Py constants: assorted constants
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>

10 years agoHs2Py constants: UID pool
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>

10 years agoHs2Py constants: 'maxUdpDataSize'
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>

10 years agoHs2Py constants: remove comments
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>

10 years agoHs2Py constants: assorted constants
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>

10 years agoHs2Py constants: 'ispecsMinmaxDefaults'
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>

10 years agoHs2Py constants: 'hvcGlobals' and 'ndcGlobals'
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>

10 years agoHs2Py constants: 'defaultEnabledHypervisor'
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>

10 years agoHs2Py constants: SSCONF
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>

10 years agoHs2Py constants: dynamic devices
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>

10 years agoHs2Py constants: HT related constants
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>

10 years agoHs2py constants: query resources
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>

10 years agoHs2Py constants: '/etc/hosts' and job queue
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>

10 years agoHs2Py constants: VNC
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>

10 years agoHs2Py constants: SSL, job queue, and locks
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>

10 years agoHs2Py constants: node verify
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>

10 years agoHs2Py constants: assorted, idisk, and inic
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>

10 years agoHs2Py constants: nics
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>

10 years agoHs2Py constant: DRBD and dynamic disk
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>

10 years agoHs2Py constants: backend and logical disks
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>

10 years agoHs2Py constants: HVST and disk state
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>

10 years agoHs2Py constants: assorted and HVS
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>

10 years agoHs2Py constants: move reboot types
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>

10 years agoHs2Py constants: reboot behaviour
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>

10 years agoHs2Py constants: scripts and actions
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>

10 years agoHs2Py constants: move 'ipCommandPath'
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>

10 years agoHs2Py constants: 'jobIdsKey', 'runparts' and 'rpc'
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>

10 years agoHs2Py constants: 'diskTransferConnectTimeout'
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>

10 years agoHs2Py constants: remove comments
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>

10 years agoHs2Py constants: network related
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>

10 years agoHs2Py constants: add import/export config
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>

10 years agoHs2Py constants: add 'RIE' related
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>

10 years agoHs2Py constants: add DRBD and RBD
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>

10 years agoHs2Py constants: storage related groups
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>

10 years agoHs2Py constants: add several groups of constants
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>

10 years agoHs2Py constants: add 2 more constants
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>

10 years agoHs2Py constants: add CPU pinning
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>

10 years agoHs2Py constants: add export versions
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>

10 years agoMove VTypes to the appropriate place
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>

10 years agoHs2Py constants: add SSH key files
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>

10 years agoHs2Py constants: add network mirrored disk templates
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>

10 years agoFix documentation comment
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>

10 years agoHs2Py constants: update forgotten 'SOCAT_ESCAPE_CODE'
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>

10 years agoHs2Py constants: add Luxi constants
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>

10 years agoHs2Py constants: add 'fileDriver'
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>

10 years agoHs2Py constants: add local disk status
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>

10 years agoHs2Py constants: constants related to 'Ganeti.Htools.Types'
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>

10 years agoHs2Py constants: add node parameter related constants
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>

10 years agoHs2Py constants: add RPC timeout constants
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>

10 years agoHs2Py constants: add 'ReplaceDisksMode' related constants
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>

10 years agoHs2Py constants: add 'osApiVersions'
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>

10 years agoFix indentation
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>

10 years agoFix typo in documentation
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>

10 years agoDisregard comments in 'src/Ganeti/ListContants.hs' target
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>

10 years agoHs2Py constants: add more constants
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>

10 years agoHs2Py constants: add 'Ganeti.Confd' types
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>

10 years agoAdd 'declareILADT' to declare integer literal datatypes
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>

10 years agoUpdate reference to proper module
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>

10 years agoHs2Py constants: add confd requests
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>

10 years agoMove confd request constants to 'Ganeti.ConstantUtils'
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>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Klaus Aehlig [Tue, 8 Oct 2013 11:45:00 +0000 (13:45 +0200)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Fix typo in walkthrough documentation
  Don't attemp ipv6 ssh in case of ipv4 cluster

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix typo in walkthrough documentation
Jose A. Lopes [Tue, 8 Oct 2013 11:26:47 +0000 (13:26 +0200)]
Fix typo in walkthrough documentation

Fix typo in walkthrough documentation, where 'instance3' should read
'instance1' in order to be consistent with the output below in the
example.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoDowngrade 'vif_script'
Helga Velroyen [Tue, 8 Oct 2013 09:35:30 +0000 (11:35 +0200)]
Downgrade 'vif_script'

This patch adds removing the 'vif_script' attribute
from the cluster's config when downgrading from 2.9
to 2.8. Adaption of the unit test is included.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoDowngrade 'xen_cmd'
Helga Velroyen [Tue, 8 Oct 2013 09:00:42 +0000 (11:00 +0200)]
Downgrade 'xen_cmd'

This downgrades the cluster's hypervisor parameters for the
xen hypervisors with respect to the 'xen_cmd' attribute.
A unit tests is provided.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd test cluster config for version 2.9
Helga Velroyen [Tue, 8 Oct 2013 09:09:35 +0000 (11:09 +0200)]
Add test cluster config for version 2.9

This adds a cluster config example for version 2.9 to
the test data collection. It will be used in subsequent
tests.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRemove superfluous import of 'errors'
Helga Velroyen [Tue, 8 Oct 2013 09:03:06 +0000 (11:03 +0200)]
Remove superfluous import of 'errors'

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd --resume option to 'gnt-cluster upgrade'
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>

10 years agoAdd function to determine current configuration version
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>

10 years agoAdd method to read and parse the intent-to-upgrade file
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>

10 years agoProvide utility function to check a configuration version
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>

10 years agoFix typo in doc string
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>

10 years agoDon't attemp ipv6 ssh in case of ipv4 cluster
Costas Drogos [Thu, 3 Oct 2013 09:37:14 +0000 (12:37 +0300)]
Don't attemp ipv6 ssh in case of ipv4 cluster

In case of a cluster with primary-ip-version=4, there is no need
for cluster to try ipv6 ssh connections which may timeout.
So append '-4' on ssh if cluster is ipv4-only

Signed-off-by: Costas Drogos <costas.drogos@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Klaus Aehlig [Mon, 7 Oct 2013 15:10:42 +0000 (17:10 +0200)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Fix outdated documentation for users-setup

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoStart NEWS entry for 2.9.0 rc2
Klaus Aehlig [Mon, 7 Oct 2013 14:06:12 +0000 (16:06 +0200)]
Start NEWS entry for 2.9.0 rc2

So far, there is one important change since 2.9.0 rc1, the fix
in cfgupgrade.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoFix lint errors
Helga Velroyen [Mon, 7 Oct 2013 14:01:06 +0000 (16:01 +0200)]
Fix lint errors

This fixes a couple of lint errors that I missed with
the patch "Fix upgrade and downgrade regarding
disk.dev_type".

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoFix upgrade and downgrade regarding disk.dev_type
Helga Velroyen [Mon, 7 Oct 2013 11:00:01 +0000 (13:00 +0200)]
Fix upgrade and downgrade regarding disk.dev_type

The up/downgrade procedure so far did not consider the
changes in the 'dev_type' attribute of disks. This patch
adds relevant checks and updates. A related problem
was that the logical IDs of disks were adjusted depending
on the dev_type, which made the order of updates not
arbitrary anymore. To make this more robust, the upgrade
procedure also considers the old versions of dev_types
(at least for 2.9).

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoRename LDS_DRBD to DTS_DRBD
Helga Velroyen [Mon, 7 Oct 2013 11:50:07 +0000 (13:50 +0200)]
Rename LDS_DRBD to DTS_DRBD

This patch renames the constant 'LDS_DRBD' to 'DTS_DRBD'
to make it consistent with the renaming of LD_* constants
to DT_* constants.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoWrite the intent-to-upgrade file during upgrades
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>

10 years agoProvide an inverse to UnescapeAndSplit
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>