Commit 9cdea43f authored by Petr Pudlak's avatar Petr Pudlak

Check the existence of system users and groups at bootstrap

Before, if any of these were missing, the creation of a cluster failed
and the cluster remained in an inconsistent state, without the
possibility to destroy it or to re-create it (#603).

This patch calls 'GetEnts' during bootstrap, which tries to read all
required system users and groups, and if it fails, stops before
commencing the cluster creation.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent e63e8891
......@@ -47,6 +47,7 @@ from ganeti import netutils
from ganeti import luxi
from ganeti import jstore
from ganeti import pathutils
from ganeti import runtime
# ec_id for InitConfig's temporary reservation manager
......@@ -742,6 +743,13 @@ def InitCluster(cluster_name, mac_prefix, # pylint: disable=R0913, R0914
os.path.isfile):
default_iallocator = constants.IALLOC_HAIL
# check if we have all the users we need
try:
runtime.GetEnts()
except errors.ConfigurationError, err:
raise errors.OpPrereqError("Required system user/group missing: %s" %
err, errors.ECODE_ENVIRON)
candidate_certs = {}
now = time.time()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment