Skip to content

Commit

Permalink
SM-Liberty: Fix HA issues
Browse files Browse the repository at this point in the history
Partial-Bug: #1593675
Closes-Bug: #1567767

1. Fix internal_ip in keystone endpoints
2. Ensure nova-manage command and neutron-common resources orddering
3. Ensure nova-compute gets restarted after nova_config changes and
compute_server_setup.sh
4. Ensure keystone endpoints are created from a single node (opesntack[0])
instead of each openstack node

TESTING:

Liberty:
1. provisioned 1 all-in-one node, verified that provision is completed
2. added image, created a network, subnetwork and 2 VMs, verified VMs are
active.
3. Logged-in to instance using shell.
4. VMs are able to ping each other.
5. VM is able get http://169.254.269.254/openstack (metadata service)

Conflicts:
	contrail/environment/modules/contrail/manifests/compute/config.pp
	contrail/environment/modules/contrail/manifests/compute/service.pp
	contrail/environment/modules/contrail/manifests/profile/neutron_db_sync.pp
	contrail/environment/modules/contrail/manifests/profile/openstack/neutron.pp

Change-Id: Iba4df7dbf9a5570041498ffee0e38421c92192cf
  • Loading branch information
Dheeraj Gautam committed Aug 4, 2016
1 parent 87c9f71 commit bfe9660
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 63 deletions.
55 changes: 3 additions & 52 deletions contrail/environment/modules/contrail/manifests/compute/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -263,58 +263,7 @@
Contrail_vrouter_nodemgr_config['DISCOVERY/server']
}

# Debug Print all variable values
notify {"host_control_ip = ${host_control_ip}":; } ->
notify {"config_ip = ${config_ip}":; } ->
notify {"openstack_ip = ${openstack_ip}":; } ->
notify {"control_ip_list = ${control_ip_list}":; } ->
notify {"compute_ip_list = ${compute_ip_list}":; } ->
notify {"keystone_ip = ${keystone_ip}":; } ->
notify {"keystone_auth_protocol = ${keystone_auth_protocol}":; } ->
notify {"keystone_auth_port = ${keystone_auth_port}":; } ->
notify {"openstack_manage_amqp = ${openstack_manage_amqp}":; } ->
notify {"amqp_server_ip = ${amqp_server_ip}":; } ->
notify {"openstack_mgmt_ip = ${openstack_mgmt_ip}":; } ->
notify {"amqp_server_ip_to_use = ${amqp_server_ip_to_use}":; } ->
notify {"neutron_service_protocol = ${neutron_service_protocol}":; } ->
notify {"keystone_admin_user = ${keystone_admin_user}":; } ->
notify {"keystone_admin_password = ${keystone_admin_password}":; } ->
notify {"keystone_admin_tenant = ${keystone_admin_tenant}":; } ->
notify {"haproxy = ${haproxy}":; } ->
notify {"host_non_mgmt_ip = ${host_non_mgmt_ip}":; } ->
notify {"host_non_mgmt_gateway = ${host_non_mgmt_gateway}":; } ->
notify {"metadata_secret = ${metadata_secret}":; } ->
notify {"internal_vip = ${internal_vip}":; } ->
notify {"external_vip = ${external_vip}":; } ->
notify {"contrail_internal_vip = ${contrail_internal_vip}":; } ->
notify {"vmware_ip = ${vmware_ip}":; } ->
notify {"vmware_username = ${vmware_username}":; } ->
notify {"vmware_password = ${vmware_password}":; } ->
notify {"vmware_vswitch = ${vmware_vswitch}":; } ->
notify {"vgw_public_subnet = ${vgw_public_subnet}":; } ->
notify {"vgw_public_vn_name = ${vgw_public_vn_name}":; } ->
notify {"vgw_interface = ${vgw_interface}":; } ->
notify {"vgw_gateway_routes = ${vgw_gateway_routes}":; } ->
notify {"nfs_server = ${nfs_server}":; } ->
notify {"keystone_ip_to_use = ${keystone_ip_to_use}":; } ->
notify {"config_ip_to_use = ${config_ip_to_use}":; } ->
notify {"number_control_nodes = ${number_control_nodes}":; } ->
notify {"multinet_opt = ${multinet_opt}":; } ->
notify {"vhost_ip = ${vhost_ip}":; } ->
notify {"physical_dev = ${physical_dev}":; } ->
notify {"contrail_compute_dev = ${contrail_compute_dev}":; } ->
notify {"contrail_macaddr = ${contrail_macaddr}":; } ->
notify {"contrail_netmask = ${contrail_netmask}":; } ->
notify {"contrail_cidr = ${contrail_cidr}":; } ->
notify {"contrail_gway = ${contrail_gway}":; } ->
notify {"contrail_gateway = ${contrail_gateway}":; } ->
notify {"quantum_port = ${quantum_port}":; } ->
notify {"quantum_ip = ${quantum_ip}":; } ->
notify {"quantum_service_protocol = ${quantum_service_protocol}":; } ->
notify {"discovery_ip = ${discovery_ip}":; } ->
notify {"hypervisor_type = ${hypervisor_type}":; } ->
notify {"vmware_physical_intf = ${vmware_physical_intf}":; } ->
Nova_config['neutron/admin_auth_url'] ->

# set rpc backend in neutron.conf
contrail::lib::augeas_conf_rm { "compute_neutron_rpc_backend":
Expand Down Expand Up @@ -415,7 +364,9 @@
subscribe => Exec ["setup-compute-server-setup"],
timeout => 0,
}
contain ::contrail::compute::setup_compute_server_setup

Class['::contrail::compute::setup_compute_server_setup'] -> Nova_config <||>

contain ::contrail::compute::add_vnc_config
# Now reboot the system
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
Expand Down
19 changes: 17 additions & 2 deletions contrail/environment/modules/contrail/manifests/compute/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@
enable => true,
}
}
service { 'nova-compute' :
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
$nova_service_name = "openstack-nova-compute"
exec { 'sevc-openstk-nova-restart' :
command => "service ${nova_service_name} restart",
provider => shell,
logoutput => $contrail_logoutput,
}
} else {
$nova_service_name = "nova-compute"
}

service { $nova_service_name :
enable => $nova_compute_status,
ensure => $nova_compute_status,
subscribe => Exec['setup-compute-server-setup']
}

Nova_config <||> ~> Service[$nova_service_name]

## Same condition as compute/config.pp
if ($nfs_server == 'xxx' and $host_control_ip == $compute_ip_list[0] ) {
Service['nova-compute']->
Service[$nova_service_name]->
service { 'nfs-kernel-server':
ensure => running,
enable => true
Expand Down
2 changes: 1 addition & 1 deletion contrail/environment/modules/contrail/manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@
$vip_to_use = $internal_vip
$config_ip_to_use = $internal_vip
$collector_ip_to_use = $internal_vip
$contrail_controller_address_api = internal_vip
$contrail_controller_address_api = $internal_vip
$contrail_controller_address_management = $internal_vip
$controller_address_management = $internal_vip
$address_api = $internal_vip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
$contrail_logoutput = $::contrail::params::contrail_logoutput,
$database_connection = $::openstack::resources::connectors::neutron
) {
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
$cmd="/usr/bin/neutron-db-manage --database-connection ${database_connection} upgrade head"
}
if ($::operatingsystem == 'Ubuntu') {
$cmd="neutron-db-manage --database-connection ${database_connection} upgrade head"
}

exec { 'openstack-neutron-db-sync':
command => "neutron-db-manage --database-connection ${database_connection} upgrade head",
path => '/usr/bin',
#require => Openstack::Resources::Database['neutron']
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

$auth_url = "http://${keystone_ip_to_use}:5000/v2.0"
$auth_password = $ceilometer_password
$auth_tenant_name = 'service'
$auth_tenant_name = 'services'
$auth_username = 'ceilometer'

class { '::ceilometer':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@
$database_credentials = join([$service_password, "@", $host_control_ip],'')
$keystone_db_conn = join(["mysql://neutron:",$database_credentials,"/neutron"],'')

if ($::operatingsystem == 'Ubuntu') {
package { 'neutron-common':
ensure => present
}
}
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
package { 'neutron-common':
name => 'openstack-neutron',
ensure => present
}
}
class {'::neutron::db::mysql':
password => $service_password,
allowed_hosts => $allowed_hosts,
} ->
package { 'neutron-server': ensure => present } ->

Package ['neutron-common'] ->

class {'::contrail::profile::neutron_db_sync':
database_connection => $keystone_db_conn
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
$host_roles = $::contrail::params::host_roles,
$package_sku = $::contrail::params::package_sku,
$openstack_manage_amqp = $::contrail::params::openstack_manage_amqp,
$neutron_ip_to_use = $::contrail::params::neutron_ip_to_use
$neutron_ip_to_use = $::contrail::params::neutron_ip_to_use,
$openstack_ip_list = $::contrail::params::openstack_ip_list,
$host_control_ip = $::contrail::params::host_ip
) {
if ($enable_module and 'openstack' in $host_roles and $is_there_roles_to_delete == false) {
contrail::lib::report_status { 'openstack_started': state => 'openstack_started' } ->
Expand All @@ -43,7 +45,6 @@
class {'::contrail::profile::openstack::nova' : } ->
class {'::contrail::profile::openstack::neutron' : } ->
class {'::contrail::profile::openstack::heat' : } ->
class {'::contrail::profile::openstack::provision' : } ->
class {'::contrail::profile::openstack::auth_file' : } ->
class {'::contrail::contrail_openstack' : } ->
package { 'openstack-dashboard': ensure => present } ->
Expand All @@ -56,7 +57,7 @@
->
contrail::lib::report_status { 'openstack_completed':
state => 'openstack_completed' ,
require => [Class['keystone::endpoint'], Keystone_role['admin']]
#require => [Class['keystone::endpoint'], Keystone_role['admin']]
}

contain ::contrail::profile::openstack::mysql
Expand All @@ -69,12 +70,26 @@

if ($enable_ceilometer) {
class {'::contrail::profile::openstack::ceilometer' :
before => Class['::contrail::profile::openstack::provision']
## NOTE: no dependency on heat, it cant be before provision
before => Class['::contrail::profile::openstack::heat']
}
contain ::contrail::profile::openstack::ceilometer
}

contain ::contrail::profile::openstack::provision
if ($host_control_ip == $openstack_ip_list[0]) {
class { '::contrail::profile::openstack::provision':}

Class ['::contrail::profile::openstack::heat'] ->
Class ['::contrail::profile::openstack::provision'] ->
Class ['::contrail::profile::openstack::auth_file']

Class['keystone::endpoint'] ->
Contrail::Lib::Report_status['openstack_completed']

Keystone_role['admin'] ->
Contrail::Lib::Report_status['openstack_completed']
contain ::contrail::profile::openstack::provision
}
contain ::contrail::profile::openstack::auth_file
contain ::contrail::contrail_openstack

Expand Down

0 comments on commit bfe9660

Please sign in to comment.