Restart libvirt only when deploying nova network on compute

Also ensure nova network does have nova_common classes and
make sure all nodes can connect to mysql.

Change-Id: I7adbdb08ad9c27575d8832feda8402450768ed92
Closes-Bug: rhbz#1114930
This commit is contained in:
Lukas Bezdicka
2014-07-01 16:28:28 +02:00
parent 26eb962148
commit 8a3206ac6a
4 changed files with 24 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ import logging
from packstack.installer import validators
from packstack.installer import utils
from packstack.installer.utils import split_hosts
from packstack.modules.common import filtered_hosts
from packstack.modules.ospluginutils import (getManifestTemplate,
appendManifestFile)
@@ -106,8 +107,7 @@ def create_manifest(config, messages):
if config['CONFIG_%s_INSTALL' % mod.upper()] == 'y':
append_for(mod, suffix)
hosts = set([config['CONFIG_CONTROLLER_HOST']])
hosts |= split_hosts(config['CONFIG_COMPUTE_HOSTS'])
hosts = filtered_hosts(config, exclude=False, dbhost=True)
config['FIREWALL_SERVICE_NAME'] = "mysql"
config['FIREWALL_PORTS'] = "'3306'"

View File

@@ -289,6 +289,14 @@ def initSequences(controller):
if controller.CONF['CONFIG_NOVA_INSTALL'] != 'y':
return
if controller.CONF['CONFIG_NEUTRON_INSTALL'] == 'y':
network_title = ('Adding Openstack Network-related '
'Nova manifest entries')
network_function = create_neutron_manifest
else:
network_title = 'Adding Nova Network manifest entries'
network_function = create_network_manifest
novaapisteps = [
{'title': 'Adding Nova API manifest entries',
'functions': [create_api_manifest]},
@@ -302,6 +310,8 @@ def initSequences(controller):
'functions': [create_ssh_keys]},
{'title': 'Gathering ssh host keys for Nova migration',
'functions': [gather_host_keys]},
{'title': network_title,
'functions': [network_function]},
{'title': 'Adding Nova Compute manifest entries',
'functions': [create_compute_manifest]},
{'title': 'Adding Nova Scheduler manifest entries',
@@ -312,16 +322,6 @@ def initSequences(controller):
'functions': [create_common_manifest]},
]
if controller.CONF['CONFIG_NEUTRON_INSTALL'] == 'y':
novaapisteps.append(
{'title': 'Adding Openstack Network-related Nova manifest entries',
'functions': [create_neutron_manifest]}
)
else:
novaapisteps.append(
{'title': 'Adding Nova Network manifest entries',
'functions': [create_network_manifest]}
)
controller.addSequence("Installing OpenStack Nova API", [], [],
novaapisteps)
@@ -548,6 +548,9 @@ def create_network_manifest(config, messages):
manifestfile = "%s_nova.pp" % host
manifestdata = getManifestTemplate("nova_network.pp")
# Restart libvirt if we deploy nova network on compute
if host in compute_hosts:
manifestdata += getManifestTemplate("nova_network_libvirt.pp")
# in multihost mode each compute host runs nova-api-metadata
if multihost and host != api_host and host in compute_hosts:

View File

@@ -39,12 +39,3 @@ class { "nova::network":
package { 'dnsmasq': ensure => present }
$vmware_backend = '%(CONFIG_VMWARE_BACKEND)s'
if $vmware_backend == 'n' {
exec { 'libvirtd_restart':
path => ['/usr/sbin/', '/sbin'],
command => 'service libvirtd restart',
logoutput => 'on_failure',
require => Class['nova::network'],
}
}

View File

@@ -0,0 +1,9 @@
$vmware_backend = '%(CONFIG_VMWARE_BACKEND)s'
if $vmware_backend == 'n' {
exec { 'libvirtd_restart':
path => ['/usr/sbin/', '/sbin'],
command => 'service libvirtd restart',
logoutput => 'on_failure',
require => Class['nova::network'],
}
}