diff --git a/lib/bootstrap.py b/lib/bootstrap.py
index 2dfb1fa74646cfe52489d5eac18ba9c68b713c4f..af9cb9297b4843231d117c1c3067e640a394dba3 100644
--- a/lib/bootstrap.py
+++ b/lib/bootstrap.py
@@ -229,9 +229,9 @@ def InitCluster(cluster_name, hypervisor_type, mac_prefix, def_bridge,
   master_node_config = objects.Node(name=hostname.name,
                                     primary_ip=hostname.ip,
                                     secondary_ip=secondary_ip)
-  cfg = config.ConfigWriter()
-  cfg.InitConfig(constants.CONFIG_VERSION, cluster_config, master_node_config)
 
+  cfg = InitConfig(constants.CONFIG_VERSION,
+                   cluster_config, master_node_config)
   ssh.WriteKnownHostsFile(cfg, constants.SSH_KNOWN_HOSTS_FILE)
 
   # start the master ip
@@ -239,6 +239,41 @@ def InitCluster(cluster_name, hypervisor_type, mac_prefix, def_bridge,
   rpc.call_node_start_master(hostname.name, True)
 
 
+def InitConfig(version, cluster_config, master_node_config,
+               cfg_file=constants.CLUSTER_CONF_FILE):
+    """Create the initial cluster configuration.
+
+    It will contain the current node, which will also be the master
+    node, and no instances.
+
+    @type version: int
+    @param version: Configuration version
+    @type cluster_config: objects.Cluster
+    @param cluster_config: Cluster configuration
+    @type master_node_config: objects.Node
+    @param master_node_config: Master node configuration
+    @type file_name: string
+    @param file_name: Configuration file path
+
+    @rtype: ssconf.SimpleConfigWriter
+    @returns: Initialized config instance
+
+    """
+    nodes = {
+      master_node_config.name: master_node_config,
+      }
+
+    config_data = objects.ConfigData(version=version,
+                                     cluster=cluster_config,
+                                     nodes=nodes,
+                                     instances={},
+                                     serial_no=1)
+    cfg = ssconf.SimpleConfigWriter.FromDict(config_data.ToDict(), cfg_file)
+    cfg.Save()
+
+    return cfg
+
+
 def FinalizeClusterDestroy(master):
   """Execute the last steps of cluster destroy
 
diff --git a/lib/ssconf.py b/lib/ssconf.py
index f7bf49c338a104d6cde8a6ec9808badb97544107..b800f25031080163f04e62f145d5af40de272014 100644
--- a/lib/ssconf.py
+++ b/lib/ssconf.py
@@ -35,7 +35,7 @@ from ganeti import utils
 from ganeti import serializer
 
 
-class SimpleConfigReader:
+class SimpleConfigReader(object):
   """Simple class to read configuration file.
 
   """
@@ -74,6 +74,16 @@ class SimpleConfigReader:
   def GetNodeList(self):
     return self._config_data["nodes"].keys()
 
+  @classmethod
+  def FromDict(cls, val, cfg_file=constants.CLUSTER_CONF_FILE):
+    """Alternative construction from a dictionary.
+
+    """
+    obj = SimpleConfigReader.__new__(cls)
+    obj._config_data = val
+    obj._file_name = cfg_file
+    return obj
+
 
 class SimpleConfigWriter(SimpleConfigReader):
   """Simple class to write configuration file.