Statistics
| Branch: | Tag: | Revision:

root / lib / bootstrap.py @ 7a0156dc

History | View | Annotate | Download (19.1 kB)

# Date Author Comment
7a0156dc 09/16/2009 03:47 pm Luca Bigliardi

Fix authorized_keys generation at cluster init

Copy pub_key in authorized_keys.

Signed-off-by: Luca Bigliardi <>
Reviewed-by: Michael Hanselmann <>

13998ef2 09/03/2009 06:43 pm Michael Hanselmann

Use ReadFile/WriteFile in more places

This survived QA, burnin and unittests.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

d693c864 08/17/2009 05:46 pm Iustin Pop

Add ctime/mtime support to the main ConfigObjects

This patch adds ctime/mtime support to the “main” config objects - the
config data itself, and the cluster/nodes/instances objects.

These are not added on auto-upgrade, but rather should be migrated if it...

4a34c5cf 07/20/2009 07:58 pm Guido Trotter

Generate a shared HMAC key at cluster init time

This key is shared on all nodes (via cmdlib._RedistributeAncillaryFiles)
and will be used for HMAC authentication of confd messages.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

539210af 07/17/2009 02:41 pm Guido Trotter

Merge branch 'next' into branch-2.1

  • next:
    Fix another issue with hypervisor_name change
    Update NEWS and version for 2.0.2 release
    Improve the description of node flags in man page
    Add enabled hypervisors to TestConfigRunner
    Add a few more checks to verify config...
b119bccb 07/16/2009 04:40 pm Guido Trotter

Make sure enabled_hypervisors list is valid

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

066f465d 07/16/2009 04:34 pm Guido Trotter

Get rid of the default_hypervisor slot

Currently we have both a default_hypervisor and an enabled_hypervisors
list. The former is only settable at cluster init time, while the latter
can be changed with cluster modify.

This becomes cumbersome in a few ways: at cluster init time for example...

a33848a5 07/16/2009 01:57 pm Guido Trotter

Simplify InitConfig and remove SimpleConfigWriter

InitConfig currently creates the cluster config_data, then puts it into
a dict, passes it to SimpleConfigWriter to load it from a dict (which
just reuses the dict value) and then saves it. The SimpleConfigWriter is...

9e1333b9 07/16/2009 01:57 pm Guido Trotter

InitCluster, don't use SimpleConfigWriter

InitConfig returns a SimpleConfigWriter to InitCluster, which then
passes it on to ssh.WriteKnownHostsFile, which extracts a couple of
values from it. One line later the full ConfigWriter is initialized.

By initializing it one line before we can pass the full writer to...

3583908a 07/08/2009 12:49 pm Guido Trotter

Extend call_node_start_master rpc with no_voting

When the parameter is set to True and start_daemons is also True,
ganeti-masterd will be started with the new --no-voting --yes-do-it
options.

This new option is set to True only on masterfailover, when no_voting is...

2f7140ba 07/08/2009 12:28 pm Guido Trotter

Merge branch 'next' into branch-2.1

  • next:
    Create a new --no-voting option for masterfailover
    ganeti-masterd: allow non-interactive --no-voting
    Fix pylint warnings
    Add custom pylintrc
    bootstrap: Don't leak file descriptor when generating SSL certificate...
fba15943 07/08/2009 12:27 pm Guido Trotter

Merge branch 'master' into next

  • master:
    Create a new --no-voting option for masterfailover
    ganeti-masterd: allow non-interactive --no-voting
8e2524c3 07/08/2009 12:17 pm Guido Trotter

Create a new --no-voting option for masterfailover

This allows failing over in certain corner cases, such as a 2 node
cluster with one node down. The man page is also updated to document
this dangerous option and how to recover from this situation.

Signed-off-by: Guido Trotter <>...

88828491 07/07/2009 03:54 pm Michael Hanselmann

bootstrap: Don't leak file descriptor when generating SSL certificate

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

5bbd3f7f 07/07/2009 03:51 pm Michael Hanselmann

Fix some typos

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

2a52a064 06/15/2009 08:08 pm Iustin Pop

Convert master_info rpc to new style result

This was more tricky as the backend function is used by other function
in backend.py. As such, it must be handled specially - it must raise
always an exception and not simply return False, err.

Signed-off-by: Iustin Pop <>...

0623d351 06/15/2009 08:08 pm Iustin Pop

Conver node_leave_cluster rpc to new style result

This patch converts this rpc call to the new style result, and also
changes in the process the meaning of the QuitGanetiException's
arguments and the node daemon rpc call exception handler.

The problem with the exception handler is that we used a two-stage one,...

6c00d19a 06/15/2009 08:08 pm Iustin Pop

Convert node_stop_master rpc to new style result

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

b726aff0 06/15/2009 08:08 pm Iustin Pop

Convert node_start_master to new style result

This is used in multiple places outside cmdlib.py, so it's a more
interesting patch.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

ec0652ad 06/15/2009 01:52 pm Guido Trotter

InitCluster: don't set default_bridge

And remove the -b option, as default nic parameters can be used instead.
We could support the option, but that would add more code, and since
cluster init is not a frequent operation, it's better to keep the code
clean....

b6a30b0d 06/08/2009 07:58 pm Guido Trotter

Allow setting NIC parameters at gnt-cluster init

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

4ef7f423 06/08/2009 07:58 pm Guido Trotter

Change BEGR_DEFAULT to PP_DEFAULT

This way the same constant can represent the default profile also for
nic, disk and OS parameters.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

022c3a0b 06/08/2009 07:58 pm Guido Trotter

Fix a typo in InitCluster

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

b86a6bcd 05/28/2009 03:18 pm Guido Trotter

Add cluster-init --no-etc-hosts parameter

If --no-etc-hosts is passed in at cluster init time we set a new
parameter in the cluster's object to false, and avoid adding nodes to
the hosts file. The UpgradeConfig function is used to set the value to
True, when upgrading from an old configuration version....

bd45767b 05/07/2009 11:13 am Carlos Valiente

Remove some superfluous imports

This is for Python 2.6 compatibility.

Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

8eb148ae 05/04/2009 04:09 pm Iustin Pop

Fix gnt-cluster getmaster on non-master nodes

The current implementation of “gnt-cluster getmaster” doesn't work on
non-master nodes, which is a regression from 1.2. This patch implements
it (again) via ssconf.

Signed-off-by: Iustin Pop <>...

9dae41ad 02/27/2009 07:08 pm Guido Trotter

Create runtime dir in bootstrap

Some hypervisors (KVM) need RUN_GANETI_DIR to exist even at cluster init
time. This patch creates it in InitCluster just before hv parameter
checking. Since the code to make list of directories is already repeated
twice in the code, and this would be the third time, we abstract it into...

5fcc718f 02/27/2009 03:06 pm Iustin Pop

Fix some epydoc style issues

99% of the epydoc return tags are "@return:", but each of the modified files
had one "@returns:" line. We fix this for consistency.

Reviewed-by: imsnah

a5728081 02/10/2009 05:06 pm Guido Trotter

Instance parameters: force typing

We want all the hv/be parameters to have a known type, rather than a
random mix of empty string, boolean values, and None, so we declare the
type of each variable and we enforce/convert it.

- Add some new constants for enforceable value types...

af64c0ea 02/10/2009 04:45 pm Iustin Pop

Add a ‘drained’ attribute to node objects

This attribute will be used to prevent any allocation on the node (any
of replace-disks with new secondary this node, failover to the node,
migration to the node).

The patch adds the attribute and initializes it correctly in cluster...

5b099da9 12/19/2008 09:31 pm Michael Hanselmann

ganeti.bootstrap: Set permissions on newly uploaded files

Reviewed-by: amishchenko

2438c157 12/19/2008 09:30 pm Michael Hanselmann

ganeti.bootstrap: Upload remote API certificate to new nodes

Reviewed-by: amishchenko

5557b04c 12/19/2008 09:30 pm Michael Hanselmann

ganeti.bootstrap: Prepare for remote API certificate

Reviewed-by: amishchenko

c4415fd5 12/19/2008 09:30 pm Michael Hanselmann

ganeti.bootstrap: Write SSL key to temporary file and set permissions

Previously, we set the permissions only after writing the key. This
gave other users on the system a small window during which they could
read the key.

Reviewed-by: amishchenko

61a08fa3 12/19/2008 09:30 pm Michael Hanselmann

ganeti.bootstrap: Generate SSL certificate for remote API

Reviewed-by: amishchenko

40a97d80 12/19/2008 09:29 pm Michael Hanselmann

ganeti.bootstrap: Move SSL certificate generation into separate function

Reviewed-by: amishchenko

e38220e4 12/17/2008 04:09 pm Michael Hanselmann

ganeti.bootstrap: Whitespace fix

Reviewed-by: iustinp

7bc9e58f 12/14/2008 02:02 pm Iustin Pop

cleanup: fix GatherMasterVotes

Remove unused vars

Reviewed-by: amishchenko

531baf8e 12/14/2008 02:01 pm Iustin Pop

cleanup: _InitSSHSetup doesn't need its argument

Reviewed-by: imsnah

c41eea6e 12/11/2008 07:13 pm Iustin Pop

Fix epydoc format warnings

This patch should fix all outstanding epydoc parsing errors; as such, we
switch epydoc into verbose mode so that any new errors will be visible.

Reviewed-by: imsnah

fc0fe88c 12/05/2008 04:53 am Iustin Pop

Add a new node parameter 'offline'

This patch adds a new node parameter called offline that will be used to
mark nodes which should be touched by commands.

We also add this flag at cluster init, node add, and export it to
iallocator scripts.

Reviewed-by: ultrotter

05cc153f 12/03/2008 01:12 pm Guido Trotter

InitCluster force a config file update

After the cluster is ready we'll load the ConfigWriter and force a
writeout of all config files.

Reviewed-by: imsnah

c044f32c 12/03/2008 01:12 pm Guido Trotter

Make sure the initial node is a master candidate

Reviewed-by: imsnah

ce735215 12/03/2008 01:12 pm Guido Trotter

gnt-cluster init, handle candidate_pool_size

- Add a new command line option, defaulting to the constant value
- Pass the value to bootstrap.InitCluster
- Use it to init the new Cluster object

Reviewed-by: imsnah

781de953 12/02/2008 02:58 pm Iustin Pop

Convert rpc results to a custom type

For a long time we had the problem that both RPC-layer errors and
results from the remote node share the same "valuespace". This is
because we shouldn't raise an exception when only one node failed
(and lose the results from the other nodes)....

d4b72030 12/02/2008 12:53 pm Guido Trotter

Use the new utils.CheckBEParams function

Where we used/forgot to validate beparams we now use the new common function.

Reviewed-by: imsnah

bbe19c17 12/02/2008 07:07 am Iustin Pop

Fix master failover

The ssconf files were not updated by the master failover. We need to
push them, and since we already have RPC initialized, we can use the
standard ConfigWriter to do so - this will take care of both the config
file and the ssconf files....

8135a2db 12/02/2008 07:05 am Iustin Pop

Prevent master failover to a non candidate node

Reviewed-by: imsnah

b9222f32 12/01/2008 05:47 pm Guido Trotter

InitCluster: initialize master node serial_no

Currently it was left alone, and thus its value was "null".

Reviewed-by: imsnah

87622829 11/27/2008 12:38 pm Iustin Pop

Improve the node add operation

Currently, the node add operation uses a job to query the node name and
the bootstrap function directly reads the config file for the cluster
name.

This patch changes to that both the cluster name and the verification of
the node is done via queries to the master....

ec17d09c 11/21/2008 12:46 pm Michael Hanselmann

Get rid of node daemon password

With the new SSL client certificate stuff it's no longer needed.

Reviewed-by: iustinp

8049a1d7 11/12/2008 02:52 pm Michael Hanselmann

Use utils.ReadFile to read SSL certificate

Reviewed-by: iustinp

fda5f19f 11/12/2008 02:51 pm Michael Hanselmann

bootstrap: Always use rpc.RpcRunner

"from ganeti.rpc import RpcRunner" does not conform to the style guide.

Reviewed-by: iustinp

02691904 10/20/2008 07:38 pm Alexander Schreiber

Set default hypervisor at cluster init

During cluster init, set the default hypervisor to be used for instances.
Ensure that the default hypervisor belongs to the set enabled hypervisors
for this cluster. Also fix a small bug with setting the default enabled...

4342e89b 10/20/2008 01:47 pm Alexander Schreiber

Remove --hypervisor-type from gnt-cluster.

We no longer use a single, cluster-wide hypervisor, but configure the
actual to be used hypervisor on the instance level.

Reviewed-by: imsnah

ea3a925f 10/19/2008 01:27 am Alexander Schreiber

Fix gnt-cluster init to set cluster defaults.

Reviewed-by: iustinp

d5927e48 10/16/2008 02:36 pm Iustin Pop

Prevent master failover if we have wrong data

If we don't actually know the current master (as determined via voting),
we prevent the failover.

The patch also changes some messages (capitalization, typos).

Reviewed-by: ultrotter

d7cdb55d 10/16/2008 02:36 pm Iustin Pop

Improvements to the master startup checks

In order to account for future improvements to master failover, we move
the actual data gathering capabilities from ganeti-masterd into
bootstrap.py, and we leave only the verification into masterd.

The verification procedure is then changed to retry multiple times (up...

caad16e2 10/12/2008 11:40 pm Iustin Pop

Abstract checking own address into a function

Currently, we check if we have a given ip address (i.e. it's alive on
one of our interfaces) but manually calling TcpPing(source=localhost).
This works, but having it spread all over the code makes it hard to...

72737a7f 10/10/2008 12:55 pm Iustin Pop

Convert rpc module to RpcRunner

This big patch changes the call model used in internode-rpc from
standalong function calls in the rpc module to via a RpcRunner class,
that holds all the methods. This can be used in the future to enable
smarter processing in the RPC layer itself (some quick examples are not...

7b3a8fb5 10/10/2008 12:51 pm Iustin Pop

Small random fixes

Indentation in bootstrap was wrong and some names in cmdlib.py were not
right.

Reviewed-by: imsnah

00cd937c 10/08/2008 05:31 pm Iustin Pop

Sanitize the hypervisor names

Since in 2.0 the user will possibly have more interaction with the
hypervisor names, we sanitize them by removing the version numbers
(the version can be a prerequisite for the ganeti installation, we
shouldn't document it in variable names)....

02f99608 10/08/2008 04:04 pm Oleksiy Mishchenko

Fix for gnt-cluster init.

Reviewed-by: iustinp

6b0469d2 10/06/2008 04:16 pm Iustin Pop

Fix SshRunner breakage from the changed API

More places actually use the SshRunner than just the gnt-cluster
commands.

Reviewed-by: ultrotter

c259ce64 10/01/2008 08:37 pm Michael Hanselmann

Get rid of ssconf

Remove leftovers from ssconf.

Reviewed-by: iustinp

d23ef431 10/01/2008 08:35 pm Michael Hanselmann

Convert bootstrap.py

Replace ssconf with configuration.

Reviewed-by: iustinp

7688d0d3 10/01/2008 08:35 pm Michael Hanselmann

Convert ssh.py

Get rid of ssconf and convert to configuration instead.

Reviewed-by: iustinp

f6bd6e98 10/01/2008 12:03 pm Michael Hanselmann

Add cluster options from ssconf to configuration

ssconf will become write-only from ganeti-masterd's point of view,
therefore all settings in there need to go into the main configuration
file.

Reviewed-by: iustinp

b9eeeb02 10/01/2008 12:03 pm Michael Hanselmann

Move instantiation of config into bootstrap.py

Future patches will add even more variables to the cluster config.
Adding more parameters wouldn't make the function easier to use and
it doesn't make sense to pass them to another function, as it's
only done once in bootstrap.py on cluster initialization....

33081d90 09/28/2008 05:44 pm Iustin Pop

Move the pseudo-secret generation to utils.py

The bootstrap code needs a pseudo-secret and this is currently generated
inside the InitGanetiServerSetup function. Since more users will need
this, move it to utils.py

Reviewed-by: ultrotter

c4b6c29c 08/15/2008 11:55 am Michael Hanselmann

gnt-node: Add option to always accept peer's SSH key

This option will be used to add nodes to the cluster without
asking the user to confirm the key. Together with key based
authentication this can be used in the QA tests.

Reviewed-by: ultrotter

51144e33 08/13/2008 03:55 pm Michael Hanselmann

Fix adding pristine nodes

If a node hasn't been part of the cluster before being added it'll not
have the cluster's SSH key. This patch makes sure to accept those by
not aliasing the machine name to the cluster name.

Reviewed-by: ultrotter

140aa4a8 07/30/2008 06:58 pm Iustin Pop

Fix cluster destroy

With the recent startup/shutdown changes (and with the master daemon in
place), the cluster destroy needs some fixing.

This patch moves the finalization of the destroy out from cmdlib into
bootstrap, so we can nicely shutdown the rapi and master daemons....

b3f1cf6f 07/30/2008 06:17 pm Iustin Pop

Fix cluster init

With the recent changes, I forgot the extra parameter to this rpc call.
Also the rpc call needs to be done after we setup the config data, for
the master daemon to be able to start, so we move it after all other
init steps.

Reviewed-by: ultrotter

3b9e6a30 07/30/2008 04:27 pm Iustin Pop

Fix some errors detected by pylint

Reviewed-by: imsnah

b1b6ea87 07/30/2008 11:43 am Iustin Pop

Rework master startup/shutdown/failover

This (big) patch reworks the master startup/shutdown and the fixes the
master failover.

What does the patch do?

For master start/stop:
- remove the old ganeti-master script and its associated man page
- moves the ip start/stop directly into the backend.(Start|Stop)Master...

827f753e 06/27/2008 05:28 pm Guido Trotter

AddNode: move the initial setup to boostrap

From the master node we can't start ssh and connect to the remote node,
nor we can do it from ganeti-noded as this ssh section will possibly ask
for key confirmation and password. So the code to copy the ganeti-noded...

05f86716 06/16/2008 05:32 pm Guido Trotter

Move SetKey to WritableSimpleStore and use it

Before we used to be able to update SimpleStore by just calling SetKey, this
feature is now moved to an external class, which inherits from it. In this
patch the new WritableSimpleStore class is also put to use, in the LUs that...

a0c9f010 06/12/2008 04:05 pm Michael Hanselmann

Move InitCluster opcode into a single function

This allows us to initialize a new cluster. The code certainly contains
bugs and hooks aren't implemented yet.

Reviewed-by: iustinp