Split out compute from controller

- split compute::libvirt from compute
- moved network_manager and flat interface to 
  nova class b/c they are shared by multiple 
  components
- added compute::libvirt
This commit is contained in:
Dan Bode 2011-06-24 13:33:02 -07:00
parent b97237db88
commit c09d2d69c7
7 changed files with 23 additions and 15 deletions

View File

@ -4,15 +4,12 @@ class nova::compute(
$api_server,
$enabled = false,
$api_port = 8773,
$aws_address = '169.254.169.254',
$libvirt_type = 'kvm'
$aws_address = '169.254.169.254'
) {
Exec['post-nova_config'] ~> Service['nova-compute']
Exec['nova-db-sync'] ~> Service['nova-compute']
nova_config { 'libvirt_type': value => $libvirt_type }
if $enabled {
$service_ensure = 'running'
} else {

View File

@ -0,0 +1,12 @@
class nova::compute::libvirt (
$libvirt_type = 'kvm',
$flat_network_bridge = 'br100',
$flat_network_bridge_ip,
$flat_network_bridge_netmask
) {
nova_config { 'libvirt_type': value => $libvirt_type }
nova::network::bridge { $flat_network_bridge:
ip => $flat_network_bridge_ip,
netmask => $flat_network_bridge_netmask,
}
}

View File

@ -5,10 +5,7 @@ class nova::compute::xenserver(
$xenapi_connection_url,
$xenapi_connection_username,
$xenapi_connection_password,
$xenapi_inject_image=false,
$network_manager='nova.network.manager.FlatManager',
$flat_network_bridge='xenbr0',
$enabled=true
$xenapi_inject_image=false
) {
class { 'nova::compute':

View File

@ -14,7 +14,8 @@ class nova(
$rabbit_port='5672',
$rabbit_userid='guest',
$rabbit_virtual_host='/',
# Following may need to be broken out to different nova services
$network_manager = 'nova.network.manager.FlatManager',
$flat_network_bridge = 'br100',
$service_down_time = 60,
$logdir = '/var/log/nova',
$state_path = '/var/lib/nova',
@ -98,6 +99,11 @@ class nova(
'state_path': value => $state_path;
'lock_path': value => $lock_path;
'service_down_time': value => $service_down_time;
# These network entries wound up in the common
# config b/c they have to be set by both compute
# as well as controller.
'network_manager': value => $network_manager;
'flat_network_bridge': value => $flat_network_bridge;
}
exec { 'post-nova_config':

View File

@ -11,11 +11,6 @@ class nova::network::flat (
enabled => $enabled,
}
nova_config {
'network_manager': value => 'nova.network.manager.FlatManager';
'flat_network_bridge': value => $flat_network_bridge;
}
# flatManager requires a network bridge be manually setup.
if $configure_bridge {
nova::network::bridge { $flat_network_bridge:

View File

@ -14,7 +14,6 @@ class nova::network::flatdhcp (
}
nova_config {
'network_manage': value => 'nova.network.manager.FlatDHCPManager';
'public_interface': value => $public_interface;
'flat_interface': value => $flat_interface;
'flat_dhcp_start': value => $flat_dhcp_start;

2
tests/compute/libvirt.pp Normal file
View File

@ -0,0 +1,2 @@
$libvirt_hash = { 'nova::compute::libvirt' => {} }
create_resources( 'class', $libvirt_hash)