Commit 77bad5b2 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add support for vm_capable in file distribution

Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 4e2d3d25
......@@ -2875,7 +2875,7 @@ def _UploadHelper(lu, nodes, fname):
def _RedistributeAncillaryFiles(lu, additional_nodes=None):
def _RedistributeAncillaryFiles(lu, additional_nodes=None, additional_vm=True):
"""Distribute additional files which are part of the cluster configuration.
ConfigWriter takes care of distributing the config and ssconf files, but
......@@ -2884,15 +2884,23 @@ def _RedistributeAncillaryFiles(lu, additional_nodes=None):
@param lu: calling logical unit
@param additional_nodes: list of nodes not in the config to distribute to
@type additional_vm: boolean
@param additional_vm: whether the additional nodes are vm-capable or not
# 1. Gather target nodes
myself = lu.cfg.GetNodeInfo(lu.cfg.GetMasterNode())
dist_nodes = lu.cfg.GetOnlineNodeList()
nvm_nodes = lu.cfg.GetNonVmCapableNodeList()
vm_nodes = [name for name in dist_nodes if name not in nvm_nodes]
if additional_nodes is not None:
if additional_vm:
if in dist_nodes:
if in vm_nodes:
# 2. Gather files to distribute
dist_files = set([constants.ETC_HOSTS,
......@@ -2903,14 +2911,17 @@ def _RedistributeAncillaryFiles(lu, additional_nodes=None):
vm_files = set()
enabled_hypervisors = lu.cfg.GetClusterInfo().enabled_hypervisors
for hv_name in enabled_hypervisors:
hv_class = hypervisor.GetHypervisor(hv_name)
# 3. Perform the files upload
for fname in dist_files:
_UploadHelper(lu, dist_nodes, fname)
for fname in vm_files:
_UploadHelper(lu, vm_nodes, fname)
class LURedistributeConfig(NoHooksLU):
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