'gluon': 'gluon.yaml',
'vpp': {
'odl_vpp_netvirt': 'neutron-opendaylight-netvirt-vpp.yaml',
+ 'dvr': 'neutron-opendaylight-fdio-dvr.yaml',
'default': 'neutron-opendaylight-honeycomb.yaml'
},
'default': 'neutron-opendaylight.yaml',
else:
deploy_options.append('baremetal-environment.yaml')
- nodes = inv['nodes']
- num_control = 0
- num_compute = 0
- for node in nodes:
- if 'profile:control' in node['capabilities']:
- num_control += 1
- elif 'profile:compute' in node['capabilities']:
- num_compute += 1
- else:
- # TODO(trozet) do we want to allow capabilities to not exist?
- logging.error("Every node must include a 'capabilities' key "
- "tagged with either 'profile:control' or "
- "'profile:compute'")
- raise ApexDeployException("Node missing capabilities "
- "key: {}".format(node))
+ num_control, num_compute = inv.get_node_counts()
if num_control == 0 or num_compute == 0:
logging.error("Detected 0 control or compute nodes. Control nodes: "
"{}, compute nodes{}".format(num_control, num_compute))
virt_cmds.append(
{con.VIRT_RUN_CMD: "cd /usr/lib/python2.7/site-packages && patch "
"-p1 < neutron-patch-NSDriver.patch"})
+ if sdn is False:
+ virt_cmds.extend([
+ {con.VIRT_RUN_CMD: "yum remove -y vpp-lib"},
+ {con.VIRT_RUN_CMD: "yum install -y "
+ "/root/nosdn_vpp_rpms/*.rpm"}
+ ])
if sdn == 'opendaylight':
if ds_opts['odl_version'] != con.DEFAULT_ODL_VERSION:
virt_cmds.extend([
{con.VIRT_RUN_CMD: "yum -y remove opendaylight"},
- {con.VIRT_RUN_CMD: "yum -y install /root/{}/*".format(
- ds_opts['odl_version'])},
{con.VIRT_RUN_CMD: "rm -rf /etc/puppet/modules/opendaylight"},
{con.VIRT_RUN_CMD: "cd /etc/puppet/modules && tar xzf "
"/root/puppet-opendaylight-"
"{}.tar.gz".format(ds_opts['odl_version'])}
])
+ if ds_opts['odl_version'] == 'master':
+ virt_cmds.extend([
+ {con.VIRT_RUN_CMD: "rpm -ivh --nodeps /root/{}/*".format(
+ ds_opts['odl_version'])}
+ ])
+ else:
+ virt_cmds.extend([
+ {con.VIRT_RUN_CMD: "yum -y install /root/{}/*".format(
+ ds_opts['odl_version'])}
+ ])
+
elif sdn == 'opendaylight' and 'odl_vpp_netvirt' in ds_opts \
and ds_opts['odl_vpp_netvirt']:
virt_cmds.extend([
crypto_serialization.Encoding.OpenSSH,
crypto_serialization.PublicFormat.OpenSSH
)
- pub_key = re.sub('ssh-rsa\s*', '', public_key.decode('utf-8'))
- return private_key.decode('utf-8'), pub_key
+ return private_key.decode('utf-8'), public_key.decode('utf-8')
-def prep_env(ds, ns, opnfv_env, net_env, tmp_dir):
+def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir):
"""
Creates modified opnfv/network environments for deployment
:param ds: deploy settings
:param ns: network settings
+ :param inv: node inventory
:param opnfv_env: file path for opnfv-environment file
:param net_env: file path for network-environment file
:param tmp_dir: Apex tmp dir
if 'CloudDomain' in line:
output_line = " CloudDomain: {}".format(ns['domain_name'])
elif 'replace_private_key' in line:
- output_line = " key: '{}'".format(private_key)
+ output_line = " private_key: |\n"
+ key_out = ''
+ for line in private_key.splitlines():
+ key_out += " {}\n".format(line)
+ output_line += key_out
elif 'replace_public_key' in line:
- output_line = " key: '{}'".format(public_key)
+ output_line = " public_key: '{}'".format(public_key)
if ds_opts['sdn_controller'] == 'opendaylight' and \
- 'odl_vpp_routing_node' in ds_opts and ds_opts[
- 'odl_vpp_routing_node'] != 'dvr':
+ 'odl_vpp_routing_node' in ds_opts:
if 'opendaylight::vpp_routing_node' in line:
- output_line = (" opendaylight::vpp_routing_node: ${}.${}"
+ output_line = (" opendaylight::vpp_routing_node: {}.{}"
.format(ds_opts['odl_vpp_routing_node'],
ns['domain_name']))
elif 'ControllerExtraConfig' in line:
if 'NeutronVPPAgentPhysnets' in line:
output_line = (" NeutronVPPAgentPhysnets: 'datacentre:{}'".
format(tenant_ctrl_nic))
+ elif ds_opts['sdn_controller'] == 'opendaylight' and ds_opts.get(
+ 'dvr') is True:
+ if 'OS::TripleO::Services::NeutronDhcpAgent' in line:
+ output_line = ''
+ elif 'NeutronDhcpAgentsPerNetwork' in line:
+ num_control, num_compute = inv.get_node_counts()
+ output_line = (" NeutronDhcpAgentsPerNetwork: {}"
+ .format(num_compute))
+ elif 'ComputeServices' in line:
+ output_line = (" ComputeServices:\n"
+ " - OS::TripleO::Services::NeutronDhcpAgent")
if perf:
for role in 'NovaCompute', 'Controller':