compute: configure availability zone

In the last commit, the AZ was only for compute nodes but it was an
error. It should also be configured on nova-api nodes.

Close bug #239

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
Co-Authored-By: Sebastien Badia <sebastien.badia@enovance.com>
This commit is contained in:
Emilien Macchi 2014-02-13 14:50:53 +01:00 committed by Sebastien Badia
parent 7d46f0c605
commit 677fadb82b
4 changed files with 11 additions and 8 deletions

View File

@ -78,7 +78,8 @@ class cloud::compute(
$neutron_endpoint = $os_params::ks_neutron_admin_host,
$neutron_protocol = $os_params::ks_neutron_public_proto,
$neutron_password = $os_params::ks_neutron_password,
$neutron_region_name = $os_params::region
$neutron_region_name = $os_params::region,
$availability_zone = $os_params::region
) {
if !defined(Resource['nova_config']) {
@ -111,6 +112,7 @@ class cloud::compute(
nova_config {
'DEFAULT/resume_guests_state_on_host_boot': value => true;
'DEFAULT/default_availability_zone': value => $availability_zone;
}
# Note(EmilienM):

View File

@ -37,7 +37,6 @@ class cloud::compute::hypervisor(
$rbd_user = $os_params::cinder_rbd_user,
$rbd_pool = $os_params::cinder_rbd_pool,
$rbd_secret_uuid = $os_params::ceph_fsid,
$availability_zone = $os_params::region,
$has_ceph = false
) {
@ -86,11 +85,11 @@ Host *
}
class { 'nova::compute':
enabled => true,
vnc_enabled => false,
enabled => true,
vnc_enabled => false,
#TODO(EmilienM) Bug #1259545 currently WIP:
virtio_nic => false,
neutron_enabled => true
virtio_nic => false,
neutron_enabled => true
}
class { 'nova::compute::spice':
@ -126,7 +125,6 @@ Host *
'DEFAULT/libvirt_inject_key': value => false;
'DEFAULT/libvirt_inject_partition': value => '-2';
'DEFAULT/live_migration_flag': value => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST';
'DEFAULT/default_availability_zone': value => $availability_zone;
'DEFAULT/disk_cachemodes': value => 'network=writeback';
}

View File

@ -24,6 +24,7 @@ describe 'cloud::compute::controller' do
let :pre_condition do
"class { 'cloud::compute':
availability_zone => 'MyZone',
nova_db_host => '10.0.0.1',
nova_db_user => 'nova',
nova_db_password => 'secrete',
@ -66,6 +67,7 @@ describe 'cloud::compute::controller' do
:glance_api_servers => 'http://10.0.0.1:9292'
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
end
it 'configure neutron on compute node' do

View File

@ -24,6 +24,7 @@ describe 'cloud::compute::hypervisor' do
let :pre_condition do
"class { 'cloud::compute':
availability_zone => 'MyZone',
nova_db_host => '10.0.0.1',
nova_db_user => 'nova',
nova_db_password => 'secrete',
@ -55,7 +56,6 @@ describe 'cloud::compute::hypervisor' do
let :params do
{ :libvirt_type => 'kvm',
:availability_zone => 'MyZone',
:server_proxyclient_address => '7.0.0.1',
:spice_port => '6082',
:has_ceph => true,
@ -82,6 +82,7 @@ describe 'cloud::compute::hypervisor' do
:glance_api_servers => 'http://10.0.0.1:9292'
)
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
should contain_nova_config('DEFAULT/default_availability_zone').with('value' => 'MyZone')
end
it 'configure neutron on compute node' do