bug fixes for canonical::all to work.

This commit is contained in:
Dan Bode 2011-05-31 18:42:29 -07:00
parent 24a930415e
commit 43617b82bd
7 changed files with 28 additions and 70 deletions

View File

@ -3,7 +3,7 @@
class nova::all(
$logdir,
$verbose,
# $sql_connection='mysql://root:<password>@127.0.0.1/nova',
$sql_connection='mysql://root:<password>@127.0.0.1/nova',
$network_manager,
$image_service,
$flat_network_bridge = 'xenbr0',
@ -33,8 +33,8 @@ class nova::all(
$xenapi_connection_url,
$xenapi_connection_username,
$xenapi_connection_password,
$xenapi_inject_image = 'false'
$db_host =
$xenapi_inject_image = 'false',
$db_host = 'localhost'
) {
class { "nova":

View File

@ -1,6 +1,6 @@
#
# TODO - this is currently hardcoded to be a xenserver
class nova::all(
class nova::canonical::all(
$logdir,
$verbose,
$sql_connection='mysql://root:<password>@127.0.0.1/nova',
@ -18,23 +18,8 @@ class nova::all(
$state_path,
$lock_path,
$service_down_time,
$quota_instances,
$quota_cores,
$quota_volumes,
$quota_gigabytes,
$quota_floating_ips,
$quota_metadata_items,
$quota_max_injected_files,
$quota_max_injected_file_content_bytes,
$quota_max_injected_file_path_bytes,
$host,
$compute_type = 'libvirt',
# do kvm and libvirt have extra config options?
$xenapi_connection_url,
$xenapi_connection_username,
$xenapi_connection_password,
$xenapi_inject_image = 'false'
$db_host =
$host
# they are only supporting libvirt for now
) {
class { "nova":
@ -55,25 +40,11 @@ class nova::all(
state_path => $state_path,
lock_path => $lock_path,
service_down_time => $service_down_time,
quota_instances => $quota_instances,
quota_cores => $quota_cores,
quota_volumes => $quota_volumes,
quota_gigabytes => $quota_gigabytes,
quota_floating_ips => $quota_floating_ips,
quota_metadata_items => $quota_metadata_items,
quota_max_injected_files => $quota_max_injected_files,
quota_max_injected_file_content_bytes => $quota_max_injected_file_content_bytes,
quota_max_injected_file_path_bytes => $quota_max_injected_file_path_bytes,
}
class { "nova::api": enabled => false }
# class { 'nova::compute::libvirt': }
class { "nova::compute":
compute_type => $compute_type,
host => $host,
xenapi_connection_url => $xenapi_connection_url,
xenapi_connection_username => $xenapi_connection_username,
xenapi_connection_password => $xenapi_connection_password,
xenapi_inject_image => $xenapi_inject_image,
enabled => false
}
class { "nova::network": enabled => false }

View File

@ -1,27 +1,9 @@
# this class should probably never be declared except
# from the virtualization implementation of the compute node
class nova::compute(
$host,
$compute_type = 'xenserver',
$xenapi_connection_url,
$xenapi_connection_username,
$xenapi_connection_password,
$xenapi_inject_image=false,
$enabled = false
) {
if $compute_type == 'xenserver' {
class { 'nova::compute::xenserver':
xenapi_connection_url => $xenapi_connection_url,
xenapi_connection_username => $xenapi_connection_username,
xenapi_connection_password => $xenapi_connection_password,
xenapi_inject_image => $xenapi_inject_image,
host => $host,
}
} else {
fail("Unsupported compute type: ${compute_type}")
}
Nova_config<| |>~>Service['nova-compute']
if $enabled {

View File

@ -4,9 +4,13 @@ class nova::compute::xenserver(
$xenapi_connection_url,
$xenapi_connection_username,
$xenapi_connection_password,
$xenapi_inject_image=false
$xenapi_inject_image=false,
$enabled=true
) {
class { 'nova':
enabled => $enabled,
}
nova_config {
'xenapi_connection_url': value => $xenapi_connection_url;
'xenapi_connection_username': value => $xenapi_connection_username;

View File

@ -2,14 +2,14 @@ class nova::db(
$password,
$name = 'nova',
$user = 'nova',
$host = '127.0.0.1'
$zone = 'localzone'
$host = '127.0.0.1',
$cluster_id = 'localzone'
) {
# now this requires storedconfigs
# TODO - worry about the security implications
@@nova_config { 'database_url':
value => "mysql://${user}:${password}@${host}/${name}"
value => "mysql://${user}:${password}@${host}/${name}" ,
tag => $zone,
}

View File

@ -16,15 +16,16 @@ class nova(
$rabbit_virtual_host,
# Following may need to be broken out to different nova services
$service_down_time,
$quota_instances,
$quota_cores,
$quota_volumes,
$quota_gigabytes,
$quota_floating_ips,
$quota_metadata_items,
$quota_max_injected_files,
$quota_max_injected_file_content_bytes,
$quota_max_injected_file_path_bytes,
# TODO - do we really want to enforce the defaults here?
$quota_instances = 10,
$quota_cores = 20,
$quota_volumes = 10,
$quota_gigabytes = 1000,
$quota_floating_ips = 10,
$quota_metadata_items = 128,
$quota_max_injected_files = 5,
$quota_max_injected_file_content_bytes = 10240,
$quota_max_injected_file_path_bytes = 255,
$logdir = '/var/log/nova',
$state_path = '/var/lib/nova',
$lock_path = '/var/lock/nova',

View File

@ -1,4 +1,4 @@
Nova_config { target => '/tmp/nova.config' }
#Nova_config { target => '/tmp/nova.config' }
resources { 'nova_config':
purge => true,
}
@ -6,7 +6,7 @@ resources { 'nova_config':
class { 'mysql::server':
root_password => 'password'
}
class { 'nova::all':
class { 'nova::canonical::all':
#dhcpbridge_flagfile=/etc/nova/nova.conf
#dhcpbridge=/usr/bin/nova-dhcpbridge
#verbose => true,