From 69eeea34d33c07b749454b06e3e8a390c1dbac07 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 29 Oct 2012 18:27:26 -0700 Subject: [PATCH 1/3] Add vswitch as testing sep This adds the switch module as a testing dep. --- .fixtures.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.fixtures.yml b/.fixtures.yml index 64cd2e4..e089997 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -14,5 +14,6 @@ fixtures: "sysctl": "git://github.com/duritong/puppet-sysctl.git" 'inifile': 'git://github.com/cprice-puppet/puppetlabs-inifile' "create_resources": 'git://github.com/puppetlabs/puppetlabs-create_resources' + 'vswitch': 'git://github.com/ekarlso/puppet-vswitch' symlinks: "openstack": "#{source_dir}" From d1054c68dd9dbe7bfdb1c3bee87aa0b5de4105f6 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 29 Oct 2012 18:28:14 -0700 Subject: [PATCH 2/3] Add quantum to compute, all and controller These commits add management of quantum to the openstack compute, controller and all classes. --- manifests/all.pp | 47 +++++++++++++++++++++++++++++ manifests/compute.pp | 58 ++++++++++++++++++++++++++++++++++-- manifests/nova/controller.pp | 31 +++++++++++++++++++ 3 files changed, 134 insertions(+), 2 deletions(-) diff --git a/manifests/all.pp b/manifests/all.pp index 9cf9319..d2003f0 100644 --- a/manifests/all.pp +++ b/manifests/all.pp @@ -263,6 +263,53 @@ class openstack::all ( } } else { # Set up Quantum + $quantum_sql_connection = "mysql://${quantum_db_user}:${quantum_db_password}@127.0.0.1/${quantum_db_dbname}?charset=utf8" + + class { 'quantum': + verbose => $verbose, + debug => $verbose, + rabbit_host => '127.0.0.1', + rabbit_user => $rabbit_user, + rabbit_password => $rabbit_password, + sql_connection => $quantum_sql_connection, + } + + class { 'quantum::server': + keystone_password => $quantum_user_password, + } + + class { 'quantum::agents::dhcp': } + + class { 'nova::compute::quantum': } + + nova_config { + 'linuxnet_interface_driver': value => 'nova.network.linux_net.LinuxOVSInterfaceDriver'; + 'linuxnet_ovs_integration_bridge': value => 'br-int'; + } + + class { 'quantum::plugins::ovs': + sql_connection => $quantum_sql_connection, + tenant_network_type => 'gre', + # I need to know what this does... + local_ip => '10.0.0.1', + } + + class { 'quantum::agents::ovs': + bridge_uplinks => ["br-virtual:${private_interface}"], + } + + class { 'nova::network::quantum': + #$fixed_range, + quantum_admin_password => $quantum_user_password, + #$use_dhcp = 'True', + #$public_interface = undef, + quantum_connection_host => 'localhost', + quantum_auth_strategy => 'keystone', + quantum_url => "http://127.0.0.1:9696", + quantum_admin_tenant_name => 'services', + #quantum_admin_username => 'quantum', + quantum_admin_auth_url => "http://127.0.0.1:35357/v2.0", + } } if $auto_assign_floating_ip { diff --git a/manifests/compute.pp b/manifests/compute.pp index 479e457..618ebef 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -25,13 +25,18 @@ class openstack::compute ( # DB $sql_connection, # Network - $quantum = true, $public_interface = undef, $private_interface = undef, $fixed_range = undef, $network_manager = 'nova.network.manager.FlatDHCPManager', $network_config = {}, $multi_host = false, + # Quantum + $quantum = true, + $quantum_sql_connection = false, + $quantum_host = false, + $quantum_user_password = false, + $keystone_host = false, # Nova $purge_nova_config = true, # Rabbit @@ -146,7 +151,56 @@ class openstack::compute ( install_service => $enable_network_service, } } else { - # TODO install quantum + + if ! $quantum_sql_connection { + fail('quantum sql connection must be specified when quantum is installed on compute instances') + } + if ! $quantum_host { + fail('quantum host must be specified when quantum is installed on compute instances') + } + if ! $quantum_user_password { + fail('quantum user password must be set when quantum is configured') + } + if ! $keystone_host { + fail('keystone host must be configured when quantum is installed') + } + + class { 'quantum': + verbose => $verbose, + debug => $verbose, + rabbit_host => $rabbit_host, + rabbit_user => $rabbit_user, + rabbit_password => $rabbit_password, + sql_connection => $quantum_sql_connection, + } + + class { 'quantum::agents::ovs': + bridge_uplinks => ["br-virtual:${private_interface}"], + } + + class { 'quantum::agents::dhcp': } + + class { 'nova::compute::quantum': } + + # does this have to be installed on the compute node? + # NOTE + class { 'nova::network::quantum': + #$fixed_range, + quantum_admin_password => $quantum_user_password, + #$use_dhcp = 'True', + #$public_interface = undef, + quantum_connection_host => $quantum_host, + #quantum_auth_strategy => 'keystone', + quantum_url => "http://${keystone_host}:9696", + quantum_admin_tenant_name => 'services', + #quantum_admin_username => 'quantum', + quantum_admin_auth_url => "http://${keystone_host}:35357/v2.0" + } + + nova_config { + 'linuxnet_interface_driver': value => 'nova.network.linux_net.LinuxOVSInterfaceDriver'; + 'linuxnet_ovs_integration_bridge': value => 'br-int'; + } } if ($cinder) { diff --git a/manifests/nova/controller.pp b/manifests/nova/controller.pp index f07b74a..1e367e9 100644 --- a/manifests/nova/controller.pp +++ b/manifests/nova/controller.pp @@ -136,6 +136,37 @@ class openstack::nova::controller ( } } else { # Set up Quantum + $quantum_sql_connection = "mysql://${quantum_db_user}:${quantum_db_password}@${db_host}/${quantum_db_dbname}?charset=utf8" + class { 'quantum': + rabbit_user => $rabbit_user, + rabbit_password => $rabbit_password, + sql_connection => $quantum_sql_connection, + verbose => $verbose, + } + + class { 'quantum::server': + keystone_password => $quantum_user_password, + } + + class { 'quantum::plugins::ovs': + sql_connection => $quantum_sql_connection, + tenant_network_type => 'gre', + # I need to know what this does... + local_ip => '10.0.0.1', + } + + class { 'nova::network::quantum': + #$fixed_range, + quantum_admin_password => $quantum_user_password, + #$use_dhcp = 'True', + #$public_interface = undef, + quantum_connection_host => 'localhost', + quantum_auth_strategy => 'keystone', + quantum_url => "http://$keystone_host}:9696", + quantum_admin_tenant_name => 'services', + #quantum_admin_username => 'quantum', + quantum_admin_auth_url => "http://${keystone_host}:35357/v2.0", + } } if $auto_assign_floating_ip { From 09370e1a74f3f5175896c9757fc13e1b909c4f4e Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 29 Oct 2012 18:28:31 -0700 Subject: [PATCH 3/3] fix test file error --- templates/test_nova.sh.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/test_nova.sh.erb b/templates/test_nova.sh.erb index d1a2f06..a42d1c2 100644 --- a/templates/test_nova.sh.erb +++ b/templates/test_nova.sh.erb @@ -24,9 +24,9 @@ wget http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd6 glance add name="precise-amd64" is_public=true container_format=ovf disk_format=qcow2 < precise-server-cloudimg-amd64-disk1.img # Caputre the Image ID so taht we can call the right UUID for this image IMAGE_ID=`glance index | grep 'precise-amd64' | head -1 | awk -F' ' '{print $1}'` +login_user='ubuntu' <% end -%> -login_user='ubuntu' # create a pub/priv keypair ssh-keygen -f /tmp/id_rsa -t rsa -N ''