[jamespage, r=billy-olsen,thedac] Drop ec2 and objectstore checks from restart

tests for liberty or greater.

Closes-Bug: #1537155
Closes-Bug: #1546261
This commit is contained in:
billy.olsen@canonical.com 2016-02-16 14:52:04 -07:00
commit 40e3a51461
5 changed files with 215 additions and 7 deletions

View File

@ -1067,8 +1067,8 @@ def update_nova_consoleauth_config():
fp.write('manual\n')
fp.flush()
elif (not config('single-nova-consoleauth')
and console_attributes('protocol')):
elif (not config('single-nova-consoleauth') and
console_attributes('protocol')):
for item in ['vip_consoleauth', 'res_nova_consoleauth']:
if item not in data['delete_resources']:
data['delete_resources'].append(item)

View File

@ -162,6 +162,10 @@ BASE_SERVICES = [
'nova-scheduler',
]
SERVICE_BLACKLIST = {
'liberty': ['nova-api-ec2', 'nova-objectstore']
}
API_PORTS = {
'nova-api-ec2': 8773,
'nova-api-os-compute': 8774,
@ -186,9 +190,20 @@ APACHE_24_CONF = '/etc/apache2/sites-available/openstack_https_frontend.conf'
NEUTRON_DEFAULT = '/etc/default/neutron-server'
QUANTUM_DEFAULT = '/etc/default/quantum-server'
def resolve_services():
_services = deepcopy(BASE_SERVICES)
os_rel = get_os_codename_install_source(config('openstack-origin'))
for release in SERVICE_BLACKLIST:
if os_rel >= release:
[_services.remove(service)
for service in SERVICE_BLACKLIST[release]]
return _services
BASE_RESOURCE_MAP = OrderedDict([
(NOVA_CONF, {
'services': BASE_SERVICES,
'services': resolve_services(),
'contexts': [context.AMQPContext(ssl_dir=NOVA_CONF_DIR),
context.SharedDBContext(
relation_prefix='nova', ssl_dir=NOVA_CONF_DIR),
@ -220,7 +235,7 @@ BASE_RESOURCE_MAP = OrderedDict([
nova_cc_context.CloudComputeContext()],
}),
(NOVA_API_PASTE, {
'services': [s for s in BASE_SERVICES if 'api' in s],
'services': [s for s in resolve_services() if 'api' in s],
'contexts': [nova_cc_context.IdentityServiceContext(),
nova_cc_context.APIRateLimitingContext()],
}),
@ -348,8 +363,7 @@ def resource_map():
if plugin:
conf = neutron_plugin_attribute(plugin, 'config', net_manager)
ctxts = (neutron_plugin_attribute(plugin, 'contexts',
net_manager)
or [])
net_manager) or [])
services = neutron_plugin_attribute(plugin, 'server_services',
net_manager)
resource_map[conf] = {}
@ -1010,7 +1024,7 @@ def guard_map():
'''Map of services and required interfaces that must be present before
the service should be allowed to start'''
gmap = {}
nova_services = deepcopy(BASE_SERVICES)
nova_services = resolve_services()
if os_release('nova-common') not in ['essex', 'folsom']:
nova_services.append('nova-conductor')

174
templates/mitaka/nova.conf Normal file
View File

@ -0,0 +1,174 @@
# mitaka
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
###############################################################################
[DEFAULT]
verbose={{ verbose }}
debug={{ debug }}
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
logdir=/var/log/nova
state_path=/var/lib/nova
force_dhcp_release=True
iscsi_helper=tgtadm
libvirt_use_virtio_for_bridges=True
connection_type=libvirt
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
ec2_private_dns_show_ip=True
api_paste_config=/etc/nova/api-paste.ini
volumes_path=/var/lib/nova/volumes
enabled_apis=ec2,osapi_compute,metadata
auth_strategy=keystone
compute_driver=libvirt.LibvirtDriver
use_ipv6 = {{ use_ipv6 }}
osapi_compute_listen = {{ bind_host }}
metadata_host = {{ bind_host }}
s3_listen = {{ bind_host }}
ec2_listen = {{ bind_host }}
osapi_compute_workers = {{ workers }}
ec2_workers = {{ workers }}
scheduler_default_filters = {{ scheduler_default_filters }}
cpu_allocation_ratio = {{ cpu_allocation_ratio }}
ram_allocation_ratio = {{ ram_allocation_ratio }}
use_syslog={{ use_syslog }}
my_ip = {{ host_ip }}
{% if memcached_servers %}
memcached_servers = {{ memcached_servers }}
{% endif %}
{% include "parts/novnc" %}
{% if keystone_ec2_url -%}
keystone_ec2_url = {{ keystone_ec2_url }}
{% endif -%}
{% if rbd_pool -%}
rbd_pool = {{ rbd_pool }}
rbd_user = {{ rbd_user }}
rbd_secret_uuid = {{ rbd_secret_uuid }}
{% endif -%}
{% if neutron_plugin and neutron_plugin == 'ovs' -%}
libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtGenericVIFDriver
libvirt_user_virtio_for_bridges = True
{% if neutron_security_groups -%}
security_group_api = {{ network_manager }}
nova_firewall_driver = nova.virt.firewall.NoopFirewallDriver
{% endif -%}
{% if external_network -%}
default_floating_pool = {{ external_network }}
{% endif -%}
{% endif -%}
{% if neutron_plugin and neutron_plugin == 'vsp' -%}
neutron_ovs_bridge = alubr0
{% endif -%}
{% if neutron_plugin and neutron_plugin == 'nvp' -%}
security_group_api = neutron
nova_firewall_driver = nova.virt.firewall.NoopFirewallDriver
{% if external_network -%}
default_floating_pool = {{ external_network }}
{% endif -%}
{% endif -%}
{% if neutron_plugin and neutron_plugin == 'Calico' -%}
security_group_api = neutron
nova_firewall_driver = nova.virt.firewall.NoopFirewallDriver
{% endif -%}
{% if neutron_plugin and neutron_plugin == 'plumgrid' -%}
security_group_api=neutron
firewall_driver = nova.virt.firewall.NoopFirewallDriver
{% endif -%}
{% if network_manager_config -%}
{% for key, value in network_manager_config.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% if network_manager and network_manager == 'neutron' -%}
network_api_class = nova.network.neutronv2.api.API
{% else -%}
network_manager = nova.network.manager.FlatDHCPManager
{% endif -%}
{% if default_floating_pool -%}
default_floating_pool = {{ default_floating_pool }}
{% endif -%}
{% if volume_service -%}
volume_api_class=nova.volume.cinder.API
{% endif -%}
{% if user_config_flags -%}
{% for key, value in user_config_flags.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% if listen_ports -%}
{% for key, value in listen_ports.iteritems() -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif -%}
{% if sections and 'DEFAULT' in sections -%}
{% for key, value in sections['DEFAULT'] -%}
{{ key }} = {{ value }}
{% endfor -%}
{% endif %}
{% include "section-zeromq" %}
{% include "parts/database-v2" %}
{% if glance_api_servers -%}
[glance]
api_servers = {{ glance_api_servers }}
{% endif -%}
{% if network_manager and network_manager == 'neutron' -%}
[neutron]
url = {{ neutron_url }}
{% if auth_host -%}
auth_plugin = password
project_name = {{ admin_tenant_name }}
username = {{ admin_user }}
password = {{ admin_password }}
auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}
region = {{ region }}
{% endif -%}
{% endif -%}
[keystone_authtoken]
{% if auth_host -%}
auth_type = password
project_name = {{ admin_tenant_name }}
username = {{ admin_user }}
password = {{ admin_password }}
auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}
region = {{ region }}
{% endif -%}
[osapi_v3]
enabled=True
{% include "parts/cell" %}
[conductor]
workers = {{ workers }}
{% include "section-rabbitmq-oslo" %}
[oslo_concurrency]
lock_path=/var/lock/nova
[spice]
{% include "parts/spice" %}

View File

@ -195,6 +195,9 @@ class NovaCCBasicDeployment(OpenStackAmuletDeployment):
self.keystone_sentry: ['keystone'],
self.glance_sentry: ['glance-registry', 'glance-api']
}
if self._get_openstack_release_string() >= 'liberty':
services[self.nova_cc_sentry].remove('nova-api-ec2')
services[self.nova_cc_sentry].remove('nova-objectstore')
ret = u.validate_services_by_name(services)
if ret:
@ -731,6 +734,10 @@ class NovaCCBasicDeployment(OpenStackAmuletDeployment):
'nova-conductor': conf_file
}
if self._get_openstack_release_string() >= 'liberty':
del services['nova-api-ec2']
del services['nova-objectstore']
# Expected default and alternate values
flags_default = 'quota_cores=20,quota_instances=40,quota_ram=102400'
flags_alt = 'quota_cores=10,quota_instances=20,quota_ram=51200'

View File

@ -794,6 +794,7 @@ class NovaCCUtilsTests(CharmTestCase):
self.relation_ids.return_value = []
self.network_manager.return_value = 'neutron'
self.os_release.return_value = 'icehouse'
self.get_os_codename_install_source.return_value = 'icehouse'
self.is_relation_made.return_value = False
self.assertEqual(
{'neutron-server': ['identity-service', 'amqp', 'shared-db'],
@ -807,6 +808,7 @@ class NovaCCUtilsTests(CharmTestCase):
)
self.network_manager.return_value = 'quantum'
self.os_release.return_value = 'grizzly'
self.get_os_codename_install_source.return_value = 'grizzly'
self.assertEqual(
{'quantum-server': ['identity-service', 'amqp', 'shared-db'],
'nova-api-ec2': ['identity-service', 'amqp', 'shared-db'],
@ -817,6 +819,17 @@ class NovaCCUtilsTests(CharmTestCase):
'nova-scheduler': ['identity-service', 'amqp', 'shared-db'], },
utils.guard_map()
)
self.network_manager.return_value = 'neutron'
self.os_release.return_value = 'mitaka'
self.get_os_codename_install_source.return_value = 'mitaka'
self.assertEqual(
{'neutron-server': ['identity-service', 'amqp', 'shared-db'],
'nova-api-os-compute': ['identity-service', 'amqp', 'shared-db'],
'nova-cert': ['identity-service', 'amqp', 'shared-db'],
'nova-conductor': ['identity-service', 'amqp', 'shared-db'],
'nova-scheduler': ['identity-service', 'amqp', 'shared-db'], },
utils.guard_map()
)
def test_guard_map_pgsql(self):
self.relation_ids.return_value = ['pgsql:1']