synced /next

This commit is contained in:
Edward Hope-Morley 2014-09-22 21:32:50 +01:00
commit 54080c7146
6 changed files with 14 additions and 4 deletions

View File

@ -239,3 +239,11 @@ options:
. .
Increasing this value will increase instance density on compute nodes Increasing this value will increase instance density on compute nodes
at the expense of instance performance. at the expense of instance performance.
ram-allocation-ratio:
type: float
default: 1.5
description: |
The physical ram -> virtual ram ratio to use in the Nova scheduler.
.
Increasing this value will increase instance density on compute nodes
at the potential expense of instance performance.

View File

@ -269,6 +269,7 @@ class NovaConfigContext(WorkerConfigContext):
def __call__(self): def __call__(self):
ctxt = super(NovaConfigContext, self).__call__() ctxt = super(NovaConfigContext, self).__call__()
ctxt['cpu_allocation_ratio'] = config('cpu-allocation-ratio') ctxt['cpu_allocation_ratio'] = config('cpu-allocation-ratio')
ctxt['ram_allocation_ratio'] = config('ram-allocation-ratio')
return ctxt return ctxt

View File

@ -566,7 +566,7 @@ def cluster_changed():
relation_settings={'private-address': addr}) relation_settings={'private-address': addr})
CONFIGS.write_all() CONFIGS.write_all()
if is_relation_made('cluster'): if relation_ids('cluster'):
peer_echo(includes='dbsync_state') peer_echo(includes='dbsync_state')
dbsync_state = peer_retrieve('dbsync_state') dbsync_state = peer_retrieve('dbsync_state')
if dbsync_state == 'complete': if dbsync_state == 'complete':

View File

@ -555,7 +555,7 @@ def migrate_database():
log('Migrating the nova database.', level=INFO) log('Migrating the nova database.', level=INFO)
cmd = ['nova-manage', 'db', 'sync'] cmd = ['nova-manage', 'db', 'sync']
subprocess.check_output(cmd) subprocess.check_output(cmd)
if is_relation_made('cluster'): if relation_ids('cluster'):
log('Informing peers that dbsync is complete', level=INFO) log('Informing peers that dbsync is complete', level=INFO)
peer_store('dbsync_state', 'complete') peer_store('dbsync_state', 'complete')
log('Enabling services', level=INFO) log('Enabling services', level=INFO)

View File

@ -33,6 +33,7 @@ ec2_workers = {{ workers }}
scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
cpu_allocation_ratio = {{ cpu_allocation_ratio }} cpu_allocation_ratio = {{ cpu_allocation_ratio }}
ram_allocation_ratio = {{ ram_allocation_ratio }}
use_syslog={{ use_syslog }} use_syslog={{ use_syslog }}

View File

@ -594,7 +594,7 @@ class NovaCCUtilsTests(CharmTestCase):
@patch('subprocess.check_output') @patch('subprocess.check_output')
def test_migrate_database(self, check_output): def test_migrate_database(self, check_output):
"Migrate database with nova-manage" "Migrate database with nova-manage"
self.is_relation_made.return_value = False self.relation_ids.return_value = []
utils.migrate_database() utils.migrate_database()
check_output.assert_called_with(['nova-manage', 'db', 'sync']) check_output.assert_called_with(['nova-manage', 'db', 'sync'])
self.enable_services.assert_called() self.enable_services.assert_called()
@ -603,7 +603,7 @@ class NovaCCUtilsTests(CharmTestCase):
@patch('subprocess.check_output') @patch('subprocess.check_output')
def test_migrate_database_cluster(self, check_output): def test_migrate_database_cluster(self, check_output):
"Migrate database with nova-manage in a clustered env" "Migrate database with nova-manage in a clustered env"
self.is_relation_made.return_value = True self.relation_ids.return_value = ['cluster:1']
utils.migrate_database() utils.migrate_database()
check_output.assert_called_with(['nova-manage', 'db', 'sync']) check_output.assert_called_with(['nova-manage', 'db', 'sync'])
self.peer_store.assert_called_with('dbsync_state', 'complete') self.peer_store.assert_called_with('dbsync_state', 'complete')