Commit e78b63ed authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Add 'install_image' param to 'Cluster'



The 'Cluster.install_image' param holds the location of the image to
be used for the safe installation instances.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent 3277b56a
......@@ -555,6 +555,7 @@ def ShowClusterConfig(opts, args):
utils.CommaJoin(pathutils.ES_SEARCH_PATH)),
("enabled disk templates",
utils.CommaJoin(result["enabled_disk_templates"])),
("install image", result["install_image"]),
("instance communication network",
result["instance_communication_network"]),
("zeroing image", result["zeroing_image"]),
......
......@@ -1580,6 +1580,26 @@ class ConfigWriter(object):
return result
@_ConfigSync(shared=1)
def GetInstallImage(self):
"""Get the install image location
@rtype: string
@return: location of the install image
"""
return self._ConfigData().cluster.install_image
@_ConfigSync()
def SetInstallImage(self, install_image):
"""Set the install image location
@type install_image: string
@param install_image: location of the install image
"""
self._ConfigData().cluster.install_image = install_image
@_ConfigSync(shared=1)
def GetInstanceCommunicationNetwork(self):
"""Get cluster instance communication network
......
......@@ -1588,6 +1588,7 @@ class Cluster(TaggableObject):
"enabled_disk_templates",
"candidate_certs",
"max_running_jobs",
"install_image",
"instance_communication_network",
"zeroing_image",
"compression_tools",
......@@ -1728,6 +1729,9 @@ class Cluster(TaggableObject):
if self.instance_communication_network is None:
self.instance_communication_network = ""
if self.install_image is None:
self.install_image = ""
if self.compression_tools is None:
self.compression_tools = constants.IEC_DEFAULT_TOOLS
......
......@@ -724,6 +724,7 @@ $(buildObject "Cluster" "cluster" $
, simpleField "enabled_disk_templates" [t| [DiskTemplate] |]
, simpleField "candidate_certs" [t| CandidateCertificates |]
, simpleField "max_running_jobs" [t| Int |]
, simpleField "install_image" [t| String |]
, simpleField "instance_communication_network" [t| String |]
, simpleField "zeroing_image" [t| String |]
, simpleField "compression_tools" [t| [String] |]
......
......@@ -169,6 +169,7 @@ handleCall _ _ cdata QueryClusterInfo =
, ("hidden_os", showJSON $ clusterHiddenOs cluster)
, ("blacklisted_os", showJSON $ clusterBlacklistedOs cluster)
, ("enabled_disk_templates", showJSON diskTemplates)
, ("install_image", showJSON $ clusterInstallImage cluster)
, ("instance_communication_network",
showJSON (clusterInstanceCommunicationNetwork cluster))
, ("zeroing_image", showJSON $ clusterZeroingImage cluster)
......
......@@ -206,6 +206,7 @@ instance Arbitrary OpCodes.OpCode where
<*> genMaybe genName -- file_storage_dir
<*> genMaybe genName -- shared_file_storage_dir
<*> genMaybe genName -- gluster_file_storage_dir
<*> arbitrary -- install_image
<*> arbitrary -- instance_communication_network
<*> arbitrary -- zeroing_image
<*> arbitrary -- compression_tools
......
......@@ -48,6 +48,7 @@ def GetMinimalConfig():
"default_iallocator_params": {},
"ndparams": {},
"candidate_certs": {},
"install_image": "",
"instance_communication_network": "",
"zeroing_image": "",
"compression_tools": constants.IEC_DEFAULT_TOOLS,
......
......@@ -154,6 +154,8 @@ def UpgradeCluster(config_data):
cluster["candidate_certs"] = {}
cluster["instance_communication_network"] = \
cluster.get("instance_communication_network", "")
cluster["install_image"] = \
cluster.get("install_image", "")
cluster["zeroing_image"] = \
cluster.get("zeroing_image", "")
cluster["compression_tools"] = \
......@@ -454,6 +456,9 @@ def DowngradeCluster(config_data):
if "instance_communication_network" in cluster:
del cluster["instance_communication_network"]
if "install_image" in cluster:
del cluster["install_image"]
if "zeroing_image" in cluster:
del cluster["zeroing_image"]
......
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