add HEARTBEAT plane to seperate the api and keeplived interface

Change-Id: I61cc751f7133f257d897a559b6c536f419940e2e
This commit is contained in:
root 2017-07-06 09:44:38 +08:00
parent b51853e422
commit 1dea7658e8
5 changed files with 31 additions and 12 deletions

View File

@ -164,6 +164,8 @@ def get_controller_node_cfg(req, host_detail, cluster_networks):
host_pub_macname = host_pub_network['name']
host_sto_network = get_host_interface_by_network(host_detail, 'STORAGE')
host_sto_macname = host_sto_network['name']
host_hbt_network = get_host_interface_by_network(host_detail, 'HEARTBEAT')
host_hbt_macname = host_hbt_network['name']
if not host_mgt_ip:
msg = "management ip of host %s can't be empty" % host_detail['id']
raise exception.InvalidNetworkConfig(msg)
@ -172,6 +174,7 @@ def get_controller_node_cfg(req, host_detail, cluster_networks):
deploy_node_cfg.update({'mgt_macname': host_mgt_macname})
deploy_node_cfg.update({'pub_macname': host_pub_macname})
deploy_node_cfg.update({'sto_macname': host_sto_macname})
deploy_node_cfg.update({'hbt_macname': host_hbt_macname})
deploy_node_cfg.update({'host_name': host_name})
return deploy_node_cfg

View File

@ -254,6 +254,17 @@ def enable_neutron_backend(req, cluster_id, kolla_config):
# generate kolla's globals.yml file
def update_globals_yml(config_data, multicast_flag):
LOG.info(_("begin to update kolla's globals.yml file..."))
kolla_yml = {'openstack_release': '3.0.0',
'docker_registry': '127.0.0.1:4000',
'docker_namespace': 'kollaglue',
'kolla_internal_vip_address': '10.10.10.254',
'network_interface': 'eth0',
'tunnel_interface': 'eth0',
'storage_interface': 'eth0',
'kolla_external_vip_interface': 'eth0',
'neutron_external_interface': 'eth1',
'keepalived_interface': '{{ network_interface }}'
}
Version = config_data['Version'].encode()
Namespace = config_data['Namespace'].encode()
VIP = config_data['VIP'].encode()
@ -278,17 +289,12 @@ def update_globals_yml(config_data, multicast_flag):
if config_data['vlans_id'].get('STORAGE'):
StoIfMac = StoIfMac + '.' + \
config_data['vlans_id'].get('STORAGE').encode()
kolla_yml = {'openstack_release': '3.0.0',
'docker_registry': '127.0.0.1:4000',
'docker_namespace': 'kollaglue',
'kolla_internal_vip_address': '10.10.10.254',
'network_interface': 'eth0',
'tunnel_interface': 'eth0',
'storage_interface': 'eth0',
'kolla_external_vip_interface': 'eth0',
'neutron_external_interface': 'eth1'
}
if config_data.get('HbtIfMac') != None:
HbtIfMac = config_data['HbtIfMac'].encode()
if config_data['vlans_id'].get('HEARTBEAT'):
HbtIfMac = HbtIfMac + '.' + \
config_data['vlans_id'].get('HEARTBEAT').encode()
kolla_yml['keepalived_interface'] = HbtIfMac
kolla_yml['openstack_release'] = Version
if multicast_flag == 0:
pass
@ -301,6 +307,7 @@ def update_globals_yml(config_data, multicast_flag):
kolla_yml['neutron_external_interface'] = ExtIfMac
kolla_yml['kolla_external_vip_interface'] = PubIfMac
kolla_yml['storage_interface'] = StoIfMac
yaml.dump(kolla_yml, file('/etc/kolla/globals.yml', 'w'),
default_flow_style=False)

View File

@ -164,6 +164,7 @@ def get_cluster_kolla_config(req, cluster_id):
dat_macname_list = []
ext_macname_list = []
sto_macname_list = []
hbt_macname_list = []
vlans_id = {}
openstack_version = '3.0.0'
docker_namespace = 'kolla'
@ -220,9 +221,11 @@ def get_cluster_kolla_config(req, cluster_id):
mgt_macname = deploy_host_cfg['mgt_macname']
pub_macname = deploy_host_cfg['pub_macname']
sto_macname = deploy_host_cfg['sto_macname']
hbt_macname = deploy_host_cfg.get('hbt_macname')
mgt_macname_list.append(mgt_macname)
pub_macname_list.append(pub_macname)
sto_macname_list.append(sto_macname)
hbt_macname_list.append(hbt_macname)
if host_name_ip not in host_name_ip_list:
host_name_ip_list.append(host_name_ip)
if len(set(mgt_macname_list)) != 1 or \
@ -238,6 +241,7 @@ def get_cluster_kolla_config(req, cluster_id):
kolla_config.update({'IntIfMac': mgt_macname})
kolla_config.update({'PubIfMac': pub_macname})
kolla_config.update({'StoIfMac': sto_macname})
kolla_config.update({'HbtIfMac': hbt_macname})
kolla_config.update({'LocalIP': docker_registry})
kolla_config.update({'Controller_ips': controller_ip_list})
kolla_config.update({'Network_ips': controller_ip_list})

View File

@ -105,7 +105,9 @@ def get_default_net_plane():
{"network_type": "STORAGE",
"net_planes": [{"name": "STORAGE", }]},
{"network_type": "EXTERNAL",
"net_planes": [{"name": "EXTERNAL", }]}, ]
"net_planes": [{"name": "EXTERNAL", }]},
{"network_type": "HEARTBEAT",
"net_planes": [{"name": "HEARTBEAT", }]}, ]
for net in networks:
for net_plane in net["net_planes"]:
net_plane.update({"cidr": "192.168.1.1/24",

View File

@ -514,6 +514,9 @@ function create_daisy_network
daisy --os-endpoint="http://${public_ip}:$bind_port" network-add "EXTERNAL" "For external interactive" "EXTERNAL" --cidr "1.0.0.0/8" --type template --capability high >> $install_logfile 2>&1
[ "$?" -ne 0 ] && { write_install_log "create the network of EXTERNAL failed"; exit 1; }
daisy --os-endpoint="http://${public_ip}:$bind_port" network-add "HEARTBEAT" "For keepalive interactive" "HEARTBEAT" --cidr "1.0.0.0/8" --type template --capability high >> $install_logfile 2>&1
[ "$?" -ne 0 ] && { write_install_log "create the network of HEARTBEAT failed"; exit 1; }
daisy --os-endpoint="http://${public_ip}:$bind_port" network-add "DEPLOYMENT" "For build pxe server" "DEPLOYMENT" --cidr "99.99.1.1/24" --ip "99.99.1.5" --ip-ranges "start":"99.99.1.50","end":"99.99.1.150" --type system >> $install_logfile 2>&1
[ "$?" -ne 0 ] && { write_install_log "create the network of DEPLOYMENT failed"; exit 1; }
}