From 481af2f96aaf0126dc7c56043949038760e3bfd4 Mon Sep 17 00:00:00 2001 From: Jan Klare Date: Wed, 3 Feb 2016 17:38:07 +0100 Subject: [PATCH] adaptions for refactored cookbooks in mitaka cycle * added new test scenarion allione (and all the needed files for it) * removed old test scenarios aio-nova and aio-neutron as well as multi-neutron and multi-node and the related files since they will not work with the refactored cookbooks * removed databag items for currently untested service cookbooks * modified Rakefile to use new test scenarios for local and jenkins integration testing * adapted README and docs to fit new test setup and explain the new attributes/template logic (with TODO) * adapted Berksfile to use the master apache2 cookbook to comply with the dependencies in identity and dashboard * removed image_upload recipe since this is already done in the integration-test::setup one * moved recipe integration-test to a different chef_run to allow all services to be restarted in delayed actions of first run before using them * removed heat from the testing stack until refactored * removed tempest unit tests 'run_tests.sh' from integration testing scenarion, since there is no need to run tempests unit tests in our deployment Depends-On: I0547182085eed91d05384fdd7734408a839a9a2c Depends-On: I3262b2e6f792f37c32a446e6567790b82bdd4613 Depends-On: I80ed8a7892b59f7fd582505445a31b0df8d68752 Depends-On: Ia7fd927f42f4a1e484e8f2d34c52b1dc6d0ce6dd Depends-On: Ifd11f86c576d7dbb709bdd302d41e39e900e1b74 Depends-On: Ida408a025f1a3e6a632108a9a32877026e286116 Depends-On: Idadc97bd7380d6c4f9f6f33d9c6b1215a5f24772 Depends-On: I9ac9eeb29ab27f31394830e4b6f999d5870cc0e4 Depends-On: Ifa5a7f4e1df47a3961976e64f654224864c3dcb4 Depends-On: I9cc1b5cc069987ac83e064322c2291772505ff5f Implements: blueprint cookbook-refactoring Change-Id: Icf0921229e9473a842d7ce5706027d56229e11d4 --- Berksfile | 29 +- Gemfile | 8 - Gemfile-Provisioning | 22 - README.md | 34 +- Rakefile | 42 +- aio-nova.rb | 41 -- aio-neutron.rb => allinone.rb | 11 +- data_bags/db_passwords/ceilometer.json | 9 - data_bags/db_passwords/heat.json | 9 - data_bags/db_passwords/ironic.json | 9 - .../orchestration_auth_encryption_key.json | 9 - data_bags/secrets/swift_authkey.json | 9 - data_bags/secrets/swift_hash_path_prefix.json | 9 - data_bags/secrets/swift_hash_path_suffix.json | 9 - .../openstack-bare-metal.json | 9 - .../openstack-object-storage.json | 9 - .../openstack-orchestration.json | 9 - data_bags/service_passwords/rbd.json | 9 - .../user_passwords/heat_stack_admin.json | 9 - destroy_all.rb | 2 +- doc/aio-bare-metal.md | 430 ------------------ doc/aio-nova.md | 21 - doc/{aio-neutron.md => allinone.md} | 2 +- doc/multi-neutron.md | 11 - doc/multi-nova.md | 28 -- doc/openstack-service.conf.erb.md | 40 ++ environments/allinone-centos7.json | 46 ++ environments/allinone-ubuntu14.json | 43 ++ environments/integration-aio-neutron.json | 50 -- environments/vagrant-aio-centos7-neutron.json | 61 --- environments/vagrant-aio-centos7-nova.json | 69 --- environments/vagrant-aio-neutron.json | 61 --- environments/vagrant-aio-nova.json | 70 --- environments/vagrant-multi-centos7-nova.json | 73 --- environments/vagrant-multi-nova.json | 106 ----- multi-nova.rb | 74 --- roles/allinone.json | 56 +++ 37 files changed, 238 insertions(+), 1300 deletions(-) delete mode 100644 Gemfile delete mode 100644 Gemfile-Provisioning delete mode 100644 aio-nova.rb rename aio-neutron.rb => allinone.rb (87%) delete mode 100644 data_bags/db_passwords/ceilometer.json delete mode 100644 data_bags/db_passwords/heat.json delete mode 100644 data_bags/db_passwords/ironic.json delete mode 100644 data_bags/secrets/orchestration_auth_encryption_key.json delete mode 100644 data_bags/secrets/swift_authkey.json delete mode 100644 data_bags/secrets/swift_hash_path_prefix.json delete mode 100644 data_bags/secrets/swift_hash_path_suffix.json delete mode 100644 data_bags/service_passwords/openstack-bare-metal.json delete mode 100644 data_bags/service_passwords/openstack-object-storage.json delete mode 100644 data_bags/service_passwords/openstack-orchestration.json delete mode 100644 data_bags/service_passwords/rbd.json delete mode 100644 data_bags/user_passwords/heat_stack_admin.json delete mode 100644 doc/aio-bare-metal.md delete mode 100644 doc/aio-nova.md rename doc/{aio-neutron.md => allinone.md} (94%) delete mode 100644 doc/multi-neutron.md delete mode 100644 doc/multi-nova.md create mode 100644 doc/openstack-service.conf.erb.md create mode 100644 environments/allinone-centos7.json create mode 100644 environments/allinone-ubuntu14.json delete mode 100644 environments/integration-aio-neutron.json delete mode 100644 environments/vagrant-aio-centos7-neutron.json delete mode 100644 environments/vagrant-aio-centos7-nova.json delete mode 100644 environments/vagrant-aio-neutron.json delete mode 100644 environments/vagrant-aio-nova.json delete mode 100644 environments/vagrant-multi-centos7-nova.json delete mode 100644 environments/vagrant-multi-nova.json delete mode 100644 multi-nova.rb create mode 100644 roles/allinone.json diff --git a/Berksfile b/Berksfile index bc5ee9c..ff7df65 100644 --- a/Berksfile +++ b/Berksfile @@ -1,18 +1,34 @@ source 'https://supermarket.chef.io' -%w{bare-metal block-storage common compute - dashboard database data-processing identity image - integration-test network object-storage ops-database - ops-messaging orchestration telemetry}.each do |cookbook| +%w( + bare-metal + database + data-processing + integration-test + object-storage + orchestration + telemetry + block-storage + common + compute + dashboard + identity + image + network + ops-database + ops-messaging + ).each do |cookbook| if ENV['ZUUL_CHANGES'] && Dir.exist?("../cookbook-openstack-#{cookbook}") cookbook "openstack-#{cookbook}", path: "../cookbook-openstack-#{cookbook}" else cookbook "openstack-#{cookbook}", github: "openstack/cookbook-openstack-#{cookbook}" end end -cookbook "openstack_client", github: "openstack/cookbook-openstack-client" -cookbook 'apache2', '3.1.0' +# use the current master branch until the new apache listen logic has been +# released +cookbook 'apache2', + github: "svanzoest-cookbooks/apache2" cookbook 'apt', '2.8.2' cookbook 'aws', '2.1.1' cookbook 'build-essential', '2.1.3' @@ -32,3 +48,4 @@ cookbook 'yum', '3.5.4' cookbook 'selinux', '0.9.0' cookbook 'yum-epel', '0.6.0' cookbook 'statsd', github: 'att-cloud/cookbook-statsd' +cookbook 'locale', '1.0.2' diff --git a/Gemfile b/Gemfile deleted file mode 100644 index e990fc8..0000000 --- a/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source 'https://rubygems.org' - -gem 'chef', '~> 11.18.6' -gem 'dep-selector-libgecode', '~> 1.0.2' -gem 'json', '<= 1.7.7' # chef 11 dependency -gem 'berkshelf', '~> 3.2.1' -gem 'hashie', '~> 2.0' -gem 'rubocop', '~> 0.29.1' diff --git a/Gemfile-Provisioning b/Gemfile-Provisioning deleted file mode 100644 index b9b5022..0000000 --- a/Gemfile-Provisioning +++ /dev/null @@ -1,22 +0,0 @@ -source 'https://rubygems.org' - -gem 'chef', '~> 12.0.3' -gem 'chef-provisioning', '~> 0.15' - -group :vagrant do - gem 'chef-provisioning-vagrant', '~> 0.8.1' -end - -group :lint do - gem 'foodcritic', '~> 4.0.0' - gem 'rubocop', '~> 0.29.0' -end - -group :unit do - gem 'berkshelf', '~> 3.2.3' - gem 'chefspec', '~> 4.2.0' -end - -group :kitchen do - gem 'test-kitchen', '~> 1.3.1' -end diff --git a/README.md b/README.md index 78b633c..180a69e 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ This framework also gives us an opportunity to show different Reference Architec With the `master` branch of the cookbooks, which is currently tied to the base OpenStack Liberty release, this supports deploying to Ubuntu 14.04 and CentOS 7.1 for all-in-one with nova-network. Support for all-in-one with Neutron, and multi-node support, is a work in progress. -Support for CentOS 6.5 and Ubuntu 12.04 with Icehouse is available with the stable/icehouse branch of this project. - ## Prereqs - [ChefDK](https://downloads.chef.io/chef-dk/) 0.9.0 or later @@ -34,17 +32,10 @@ via: `apt-get install linux-image-generic-lts-utopic`. This will install at leas ## Supported Deployments * All-in-One - * nova-network - * Neutron - * Bare-Metal -* Multi-Node - * nova-network * Neutron For each deployment model, there is a corresponding readme file in the doc/ directory. Please review that for specific details and additional setup that might be required before deploying the cloud. -If you would like to use the bare-metal click [here](docs/aio-bare-metal.md) for the documentation. - ## Rake Deploy Commands These commands will spin up various OpenStack cluster configurations, the simplest being the all-in-one controller with nova-network. @@ -52,10 +43,7 @@ These commands will spin up various OpenStack cluster configurations, the simple For CentOS, set the environment variable REPO_OS=centos7 ```bash -$ chef exec rake aio_nova # All-in-one controller with nova-network -$ chef exec rake aio_neutron # All-in-one controller with Neutron -$ chef exec rake multi_nova # Multi-node controller with nova-network and 3 compute nodes -$ chef exec rake multi_neutron # Multi-node controller with Neutron and 3 compute nodes +$ chef exec rake allinone # All-in-one controller with neutron-network ``` ### Access the Controller @@ -184,22 +172,19 @@ user_passwords # Show the list of data bag items $ chef exec knife data bag show db_passwords -z -ceilometer cinder dash glance -heat horizon -ironic keystone neutron nova # Show contents of data bag item -$ chef exec knife data bag show db_passwords ceilometer -z +$ chef exec knife data bag show db_passwords nova -z Encrypted data bag detected, decrypting with provided secret. -ceilometer: mypass -id: ceilometer +nova: mypass +id: nova # Update contents of data bag item # set EDITOR env var to your editor. For PowerShell, I used nano @@ -218,12 +203,6 @@ and referenced by .chef/knife.rb. ## Known Issues and Workarounds -### Gemfile support - -The ChefDK provides all the required level of gems this testing suite needs, but there exists a Gemfile-Provisioning file that can be used as well. -You will need to replace the Gemfile with the Gemfile-Provisioning before running your gem bundling. -Note: please ignore the Gemfile, as it is needed only to pass the existing gates with older levels of gems. - ### Windows Platform When using this on a Windows platform, here are some tweaks to make this work: @@ -232,11 +211,10 @@ When using this on a Windows platform, here are some tweaks to make this work: ## TODOs -- Better instructions for multi-node network setup -- Better support for aio_neutron and multi-node tests +- Support for multi node test - Support for floating IPs +- Better instructions for multi-node network setup - Split out the `multi-neutron-network-node` cluster also so the network node is it's own machine -- Support for swift multi node test - Easier debugging. Maybe a script to pull the logs from the controller. # License # diff --git a/Rakefile b/Rakefile index 7a4e538..5784541 100644 --- a/Rakefile +++ b/Rakefile @@ -37,25 +37,15 @@ task :create_key do end end -desc "All-in-One Neutron build" -task :aio_neutron => :create_key do - run_command("chef-client #{client_opts} vagrant_linux.rb aio-neutron.rb") +desc "All-in-One build" +task :allinone => :create_key do + run_command("chef-client #{client_opts} vagrant_linux.rb allinone.rb") end -desc "All-in-One Nova-networking build" -task :aio_nova => :create_key do - run_command("chef-client #{client_opts} vagrant_linux.rb aio-nova.rb") -end - -desc "Multi-Neutron build" -task :multi_neutron => :create_key do - run_command("chef-client #{client_opts} vagrant_linux.rb multi-neutron.rb") -end - -desc "Multi-Nova-networking build" -task :multi_nova => :create_key do - run_command("chef-client #{client_opts} vagrant_linux.rb multi-nova.rb") -end +#desc "Multi-Neutron build" +#task :multi_neutron => :create_key do +# run_command("chef-client #{client_opts} vagrant_linux.rb multi-neutron.rb") +#end desc "Blow everything away" task clean: [:destroy_all] @@ -115,8 +105,6 @@ def _run_basic_queries # rubocop:disable Metrics/MethodLength 'keystone' => %w(--version user-list endpoint-list role-list service-list tenant-list), 'cinder-manage' => ['version list', 'db version'], 'cinder' => %w(--version list), - 'heat-manage' => ['db_version', 'service list'], - 'heat' => %w(--version stack-list), 'rabbitmqctl' => %w(cluster_status), 'ifconfig' => [''], 'neutron' => %w(agent-list ext-list net-list port-list subnet-list quota-list), @@ -153,9 +141,15 @@ def _setup_cinder_volume # rubocop:disable Metrics/MethodLength ) end +# Helper for setting up tempest and upload the default cirros image. Tempest +# itself is not yet used for integration tests. +def _setup_tempest(client_opts) + sh %(sudo chef-client #{client_opts} -E allinone-ubuntu14 -r 'recipe[openstack-integration-test::setup]') +end + def _dump_logs paths = [] - %w(nova neutron keystone cinder glance heat).each do |project| + %w(nova neutron keystone cinder glance).each do |project| paths << "-r \"\" /etc/#{project}/*" paths << "-r \"\" /var/log/#{project}/*" end @@ -179,16 +173,14 @@ task :integration => [:create_key, :berks_vendor] do for i in 1..3 puts "####### Pass #{i}" # Kick off chef client in local mode, will converge OpenStack right on the gate job "in place" - sh %(sudo chef-client #{client_opts} -E integration-aio-neutron -r 'role[allinone-compute]','role[os-image-upload]','recipe[openstack-integration-test::setup]') + sh %(sudo chef-client #{client_opts} -E allinone-ubuntu14 -r 'role[allinone]') + _setup_tempest(client_opts) _dump_logs _setup_local_network if i == 1 _run_basic_queries _setup_cinder_volume _run_nova_tests end - # Run the tempest formal tests, setup with the openstack-integration-test cookbook - Dir.chdir('/opt/tempest') do - sh %(sudo ./run_tests.sh) - end + # TODO (jklare) utilise tempest to run tests against openstack # TODO (MRV) gather logs end diff --git a/aio-nova.rb b/aio-nova.rb deleted file mode 100644 index 45cbb22..0000000 --- a/aio-nova.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'chef/provisioning' - -controller_config = <<-ENDCONFIG - config.vm.network "forwarded_port", guest: 443, host: 9443 - config.vm.network "forwarded_port", guest: 4002, host: 4002 - config.vm.network "forwarded_port", guest: 5000, host: 5000 - config.vm.network "forwarded_port", guest: 6080, host: 6080 - config.vm.network "forwarded_port", guest: 8773, host: 8773 - config.vm.network "forwarded_port", guest: 8774, host: 8774 - config.vm.network "forwarded_port", guest: 35357, host: 35357 - config.vm.provider "virtualbox" do |v| - v.memory = 8096 - v.cpus = 2 - v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] - v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] - end - config.vm.network "public_network", - bridge: ["en0: USB Ethernet", - "en1: USB Ethernet", - "en2: USB Ethernet", - "en3: USB Ethernet", - "en4: USB Ethernet", - "en0: Wi-Fi (AirPort)", - "en1: Wi-Fi (AirPort)", - "en2: Wi-Fi (AirPort)", - "Intel(R) Centrino(R) Advanced-N 6205"] -ENDCONFIG - -env = 'vagrant-aio-nova' -env = 'vagrant-aio-centos7-nova' if ENV['REPO_OS'].to_s.include?('centos') - -machine 'controller' do - add_machine_options vagrant_config: controller_config - role 'allinone-compute' - role 'os-image-upload' - recipe 'openstack-integration-test::setup' - chef_environment env - file('/etc/chef/openstack_data_bag_secret', - "#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret") - converge true -end diff --git a/aio-neutron.rb b/allinone.rb similarity index 87% rename from aio-neutron.rb rename to allinone.rb index ba30775..538503d 100644 --- a/aio-neutron.rb +++ b/allinone.rb @@ -9,8 +9,8 @@ controller_config = <<-ENDCONFIG config.vm.network "forwarded_port", guest: 8774, host: 8774 config.vm.network "forwarded_port", guest: 35357, host: 35357 config.vm.provider "virtualbox" do |v| - v.memory = 4096 - v.cpus = 2 + v.memory = 8192 + v.cpus = 4 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end @@ -26,13 +26,12 @@ controller_config = <<-ENDCONFIG "Intel(R) Centrino(R) Advanced-N 6205"] ENDCONFIG -env = 'vagrant-aio-neutron' -env = 'vagrant-aio-centos7-neutron' if ENV['REPO_OS'].to_s.include?('centos') +env = 'allinone-ubuntu14' +env = 'allinone-centos7' if ENV['REPO_OS'].to_s.include?('centos') machine 'controller' do add_machine_options vagrant_config: controller_config - role 'allinone-compute' - role 'os-image-upload' + role 'allinone' chef_environment env file('/etc/chef/openstack_data_bag_secret', "#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret") diff --git a/data_bags/db_passwords/ceilometer.json b/data_bags/db_passwords/ceilometer.json deleted file mode 100644 index 0404bde..0000000 --- a/data_bags/db_passwords/ceilometer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "ceilometer", - "ceilometer": { - "encrypted_data": "NAJwrZJbTX7HxNH4rzGJMYnDeWQMz3dlskH1w1oK39c=\n", - "iv": "HQAYmxr9s/4T7wymjyOdkw==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/data_bags/db_passwords/heat.json b/data_bags/db_passwords/heat.json deleted file mode 100644 index 22720f9..0000000 --- a/data_bags/db_passwords/heat.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "heat", - "heat": { - "encrypted_data": "zgl0ZuuOiJ0LpzDdKCX4M9n/l9bkcF4Z45gv4abyLng=\n", - "iv": "182xiFiVaERWG53LotL7Gg==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/data_bags/db_passwords/ironic.json b/data_bags/db_passwords/ironic.json deleted file mode 100644 index f99702d..0000000 --- a/data_bags/db_passwords/ironic.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "ironic", - "ironic": { - "encrypted_data": "Dar/zqjgektkx9BOkjHJW4s6uQpGRcsBpSVEKgkqPws=\n", - "iv": "h+k6v3xcQdqzdqQWlyoOnQ==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/data_bags/secrets/orchestration_auth_encryption_key.json b/data_bags/secrets/orchestration_auth_encryption_key.json deleted file mode 100644 index ff4247f..0000000 --- a/data_bags/secrets/orchestration_auth_encryption_key.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "orchestration_auth_encryption_key", - "orchestration_auth_encryption_key": { - "encrypted_data": "2zjK5nNVG3ZTXQ6ZbpGBWjK+7X7vhcI8xq8EstBYdSQtrzcPAFToUG0jbb9d\nmJuJ10uXoH+JntEM68pNmCRsrw==\n", - "iv": "XMpkT6S0qeATHewNsnQCrw==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/data_bags/secrets/swift_authkey.json b/data_bags/secrets/swift_authkey.json deleted file mode 100644 index dc677bd..0000000 --- a/data_bags/secrets/swift_authkey.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "swift_authkey", - "swift_authkey": { - "encrypted_data": "it5ei2NN2bvT6nhS9D0bizNHQ1m/E0i0yR5i3a1rfv3GnqBEj0XSwYbC8EtG\njm+X\n", - "iv": "X7bGZy035eyagWkg2RLHuw==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} diff --git a/data_bags/secrets/swift_hash_path_prefix.json b/data_bags/secrets/swift_hash_path_prefix.json deleted file mode 100644 index 6a64c25..0000000 --- a/data_bags/secrets/swift_hash_path_prefix.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "swift_hash_path_prefix", - "swift_hash_path_prefix": { - "encrypted_data": "XV4El7sNlm3UVl3dh7Wy5nAyl1ooiXquFJ+Hn18+OFbH0z1Vt97nJO4GPqgq\n91d5\n", - "iv": "/v6woWV+Aun9FbjV1WG/4A==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} diff --git a/data_bags/secrets/swift_hash_path_suffix.json b/data_bags/secrets/swift_hash_path_suffix.json deleted file mode 100644 index c543ebb..0000000 --- a/data_bags/secrets/swift_hash_path_suffix.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "swift_hash_path_suffix", - "swift_hash_path_suffix": { - "encrypted_data": "OV1/aLTF6fPxNco19u951J/AcDKpsNjnY8Xp4CLWNQeC0wHU4X0+rWCTLdY3\nfGhk\n", - "iv": "G72rzoiAi2L97VmfXg/gyg==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} diff --git a/data_bags/service_passwords/openstack-bare-metal.json b/data_bags/service_passwords/openstack-bare-metal.json deleted file mode 100644 index 39b6ff4..0000000 --- a/data_bags/service_passwords/openstack-bare-metal.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "openstack-bare-metal", - "openstack-bare-metal": { - "encrypted_data": "Yz9/wWb2C597X6JoLOtMtrtr6WGzL8a//cYXpmwqDrE=\n", - "iv": "UkPywI/PL7Vv5fVoafRrqQ==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/data_bags/service_passwords/openstack-object-storage.json b/data_bags/service_passwords/openstack-object-storage.json deleted file mode 100644 index 373fa5e..0000000 --- a/data_bags/service_passwords/openstack-object-storage.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "openstack-object-storage", - "openstack-object-storage": { - "encrypted_data": "RShH8KMN9TFJ/+vD0vzoRZ4GCvGmttLvuN3nokwdYkw=\n", - "iv": "c428JDwUz6pT8VrN0vUSDA==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} diff --git a/data_bags/service_passwords/openstack-orchestration.json b/data_bags/service_passwords/openstack-orchestration.json deleted file mode 100644 index 692f032..0000000 --- a/data_bags/service_passwords/openstack-orchestration.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "openstack-orchestration", - "openstack-orchestration": { - "encrypted_data": "0HpyFflTF4UHGDtq3koSMGkLOZ7XAKrp0fw2D0rKSt0=\n", - "iv": "xRgADbFNtnNdPrRHGdI1vg==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/data_bags/service_passwords/rbd.json b/data_bags/service_passwords/rbd.json deleted file mode 100644 index eb7691a..0000000 --- a/data_bags/service_passwords/rbd.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "rbd", - "rbd": { - "encrypted_data": "bjXhcqcYeDLeg60nZQhX6XSsn/I77ACH5EqEWaDCc84=\n", - "iv": "dY6O+HHA0mBLgnvcjnLBGQ==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/data_bags/user_passwords/heat_stack_admin.json b/data_bags/user_passwords/heat_stack_admin.json deleted file mode 100644 index fdc5c86..0000000 --- a/data_bags/user_passwords/heat_stack_admin.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "heat_stack_admin", - "heat_stack_admin": { - "encrypted_data": "GHmi2aJPWAXp4UyiennthLH/Kn5GLUAWQHsA3n1pLZU=\n", - "iv": "ifhyjNj74PFd1+vkGiMpdA==\n", - "version": 1, - "cipher": "aes-256-cbc" - } -} \ No newline at end of file diff --git a/destroy_all.rb b/destroy_all.rb index 58a2f27..fd5cb10 100644 --- a/destroy_all.rb +++ b/destroy_all.rb @@ -1,6 +1,6 @@ require 'chef/provisioning' -resource_name :machine_batch do +machine_batch do machines search(:node, '*:*').map(&:name) action :destroy end diff --git a/doc/aio-bare-metal.md b/doc/aio-bare-metal.md deleted file mode 100644 index ccd1116..0000000 --- a/doc/aio-bare-metal.md +++ /dev/null @@ -1,430 +0,0 @@ -# OpenStack On Bare-Metal - -This is the process to install OpenStack via Chef and the recipes to complete an OpenStack All in One build. We will leverage Chef to give the ability to standup an OpenStack Kilo environment. - -## Terms - -- **OpenStack** or **OpenStack server** = The physical machine that only has Ubuntu running on it -- **Workstation** = This is the machine or VM that has the ChefDK installed. This will be the system that communicates to the Chef server -- **Chef Server** = This is either the Hosted Chef solution or can be in On Premises Chef server - -## Prereqs - -- [ChefDK](https://downloads.chef.io/chef-dk/) 0.7.0 or later -- [Ubuntu](http://www.ubuntu.com/download/server) 14.04 or later -- You will need to have 2 NICs on the OpenStack Server. Your configuration should look similar to this: - -``` -auto eth0 -iface eth0 inet static - address 192.168.2.5 - gateway 192.168.2.254 - dns-nameservers 192.168.2.254 - netmask 255.255.255.0 -auto eth1 -iface eth1 inet manual -``` - -Where `eth0` is a management network, and `eth1` is a bridged connected NIC to your network. - -## Initial Setup Steps - -### Installing ChefDK on the Workstation - -- If not already installed install git (`apt-get install git`) -- If not already installed install unzip (`apt-get install unzip`) -- [ChefDK Installation Instructions](https://docs.chef.io/install_dk.html) - -### Setup the Chef Server - -- [Chef Server install](https://docs.chef.io/install_server.html) This can be a standalone server or an HA environment. For the purpose of this i would recommend an standalone server at first -- [Hosted Chef Setup](https://learn.chef.io/manage-a-node/rhel/set-up-your-chef-server/#step1) This will walk you through the ability to create a free hosted Chef Server - -### Setting up the workstation - -Create a local copy repo of the OpenStack Chef Repo. - -- `git clone https://github.com/OpenStack/OpenStack-chef-repo.git` -- `git checkout stable/kilo # if you would like to run newest stable release` - -Login to the Chef Server Website - - - Create an Organization (Under the Administration Tab) - - Type the Full name and the short-name - - Click the `Create Organization` - - Click `Download the starter kit` - - You will be prompted with "Your user and organization keys will be reset. Are you sure you want to do this?" - - Click `Proceed` - - Copy this file to the Workstation folder you will be working out of - -Extracting the Starter Kit on the Workstation - -- verify that you are in the location on the workstation where the start-kit.zip file is located - -``` -$ unzip starter-kit.zip -$ cd chef-repo/.chef -``` - -Verify the connection from the workstation to the Chef Server - -``` -$ chef exec knife status -``` - -If everything works correctly you will not receive any errors - -Copy the extracted repo to the cloned repo from earlier. - -``` -$ cp -R ../.chef ../ ../../ -``` - -#### Create a new Branch - -The path you should now want to be at is in the cloned repo. - -``` -$ git checkout -b -``` -then run `git status` and this should result in an error - -``` -Changes not staged for commit: - (use "git add ..." to update what will be committed) - (use "git checkout -- ..." to discard changes in working directory) - - modified: .chef/knife.rb - modified: .gitignore - modified: README.md - -Untracked files: - (use "git add ..." to include in what will be committed) - - cookbooks/ - roles/starter.rb - -no changes added to commit (use "git add" and/or "git commit -a") -``` - -#### Setting up the Local OpenStack Repo - -##### Berks - -- Install the Berks - `chef exec berks install` -- Upload the Berks - `chef exec berks upload` - -##### Setting up the AIO Neutron json - -Download a template json for OpenStack - -[Click here to see the example json](../environments/baremetal-aio-neutron.json) - -Modify the json for the environment to point to the file that you are using - -###### Modifying the JSON File - -- Change the apache "listen_addresses" to your external IP for OpenStack -- Change the endpoints "bind-hosts"", and "host" to your external IP for OpenStack -- Verify that your network interface is eth0 and eth1. If not modify this file and change eth0 for en0 or whatever the NIC is named. Same would go for eth1. (ONLY NEEDED if NIC NAME IS DIFFERENT) -- Save the file once completed - -##### Uploading Roles - -Now it is time to upload the roles. From within the roles folder - -``` -chef exec knife role from file * -``` -##### Changing and Uploading Passwords - -This is one of the critical points. This is the stage where you can modify the passwords that OpenStack will use. You must be careful and run all of the listed commands in this article in order for it to work correctly. - -[How to modify the Data Bags Passwords](https://github.com/OpenStack/OpenStack-chef-repo/blob/master/doc/databags.md) - -To create the Data Bags go to the OpenStack-chef-repo/data_bags folder. The following commands will create the Data Bags and then Upload the Data Bag on the Chef Server - -``` -cd ../data_bags/db_passwords/ -chef exec knife data bag create db_passwords -chef exec knife data bag from file db_passwords ./ -cd ../secrets -chef exec knife data bag create secrets -chef exec knife data bag from file secrets ./ -cd ../service_passwords -chef exec knife data bag create service_passwords -chef exec knife data bag from file service_passwords ./ -cd ../user_passwords -chef exec knife data bag create user_passwords -chef exec knife data bag from file user_passwords ./ -chef exec knife upload /environments -``` - -### Setting up the OpenStack Server - -#### Verify connectivity - -- Once the Operating system is on the machine verify sshd is up and running on the server. -- Also verify the Server is able to access the Chef Server and the Chef Workstation is able to access the OpenStack Server - -#### Bootstrap the OpenStack Server to the Chef Environment - -On the Chef Workstation run the following - -``` -chef exec knife bootstrap -x -P -N --sudo -``` -If you receive any errors please address these before proceeding - -Then add the runlist for the OpenStack Server - -``` -chef exec knife node run_list add 'role[allinone-compute], role[os-image-upload], role[os-orchestration], role[os-block-storage]' -``` - -Now we will need to modify the node to point to the OpenStack environment. - -``` -chef exec knife node edit -``` - -It should look like - -``` -{ - "name": "nodename", - "chef_environment": "File name that was created earlier -aio.neutron.json>", - "normal": { - "tags": [ - - ] - }, - "run_list": [ - "role[allinone-compute]", - "role[os-image-upload]", - "role[os-orchestration]", - "role[os-block-storage]" -] - -} - -``` - -We will need to copy the encrypted_data_bag_secret to the OpenStack server. - -``` -scp encrypted_data_bag_secret @: -``` -Then we will move the file from the home locate to the correct location on the OpenStack server - -``` -mv encrypted_data_bag_secret /etc/chef/OpenStack_data_bag_secret -``` -We now are going to make a temporary change this section can be removed after the install but would be recommended to keep in place for future needs. - -Create a file in `/etc/apt/apt.conf.d/90forceyes` with the following content: - -``` -APT::Get::Assume-Yes "true"; -APT::Get::force-yes "true"; -``` - -## Creating OpenStack from Chef Repo - -Now you should be able to login to the OpenStack Server and run as root: - -``` -chef-client -``` - -You may have to modify the `/etc/apache2/ports.conf` to point to the external IP address vs the internal - -# Login to your OpenStack Environment!! - -## Setup the networking for OpenStack - -On the OpenStack server login - -Source the file so we will be able to access the OpenStack api. Then we will run `nova image-list` to see the current images that were built by OpenStack. - -``` -# source openrc -# nova image-list -+--------------------------------------+---------------+--------+--------+ -| ID | Name | Status | Server | -+--------------------------------------+---------------+--------+--------+ -| 8dfa3a8f-a982-4197-b8f7-5116e33d56fb | centos-7 | ACTIVE | | -| 332d52fb-d080-41bc-b8cf-48460baae60a | cirros | ACTIVE | | -| ea18acb2-18f5-432b-b8c7-40fdecf2d87b | ubuntu-trusty | ACTIVE | | -+--------------------------------------+---------------+--------+--------+ -``` - -Now we want to look at the current networking: - -``` -# ovs-vsctl show -f816c29f-27f8-4a0d-8e82-9ee0313f6c16 - Bridge br-ex - Port "eth1" - Interface "eth1" - Port br-ex - Interface br-ex - type: internal - Bridge br-tun - Port br-tun - Interface br-tun - type: internal - Bridge br-int - fail_mode: secure - Port br-int - Interface br-int - type: internal - ovs_version: "2.3.1" -``` - -Now create the flat network: - -``` -# neutron net-create ext-net --router:external --provider:physical_network external --provider:network_type flat -Created a new network: -+---------------------------+--------------------------------------+ -| Field | Value | -+---------------------------+--------------------------------------+ -| admin_state_up | True | -| id | 7276586e-10e1-462d-a9c2-a35f99a7b53d | -| mtu | 0 | -| name | ext-net | -| provider:network_type | flat | -| provider:physical_network | external | -| provider:segmentation_id | | -| router:external | True | -| shared | False | -| status | ACTIVE | -| subnets | | -| tenant_id | 57443e433b6744d3a36227717032515e | -+---------------------------+--------------------------------------+ -``` - -Create the external IP range - -``` -neutron subnet-create ext-net --name ext-subnet --allocation-pool start=,end= --disable-dhcp --gateway -``` - -``` -# neutron subnet-create ext-net 192.168.2.0/24 --name ext-subnet --allocation-pool start=192.168.2.200,end=192.168.2.240 --disable-dhcp --gateway 192.168.2.254 -Created a new subnet: -+-------------------+----------------------------------------------------+ -| Field | Value | -+-------------------+----------------------------------------------------+ -| allocation_pools | {"start": "192.168.2.200", "end": "192.168.2.240"} | -| cidr | 192.168.2.0/24 | -| dns_nameservers | | -| enable_dhcp | False | -| gateway_ip | 192.168.2.254 | -| host_routes | | -| id | 1a4d8f0f-44c2-4e6d-bd68-019eedf13af9 | -| ip_version | 4 | -| ipv6_address_mode | | -| ipv6_ra_mode | | -| name | ext-subnet | -| network_id | 7276586e-10e1-462d-a9c2-a35f99a7b53d | -| subnetpool_id | | -| tenant_id | 57443e433b6744d3a36227717032515e | -+-------------------+----------------------------------------------------+ -``` - -Now access the OpenStack Server WebUI -Login to the webui: https:// - -``` -Username: Admin -Password: -``` -Then Login - -### Create Router for First Network - -1. Expand the `Project` tab in the top left hand side of the screen. -1. Choose the drop down for `Network`. Once you see a link for `Routers` choose that one. -1. In the top right hand side of the `Routers` page click `Create Router`. this will bring up a pop up windows with the Title of `Create Router` -1. Now for the `Router Name` you can enter whichever name you prefer -1. Leave the `Admin State` on `Up` -1. For the `External Network` use the drop down to ext-net unless you modified the script from earlier. -1. Then click on the button labeled `Create Router` -1. You should see a Green box in the top right hand corner of the page saying `Successful`. Also the name of the router you created and status should also say `Active` - -### Create Internal Network - -1. With in the `Network` section click on `Network Topology` on the left hand side of the screen. -1. In the top right hand corner click on the `+ Create Network` button -1. A window will open with the title of `Create Network` -1. In the `Network Name` field enter the name you would like. For this example we chose adminint-net. Since we are under the Admin project. You will have to create a network for each project that you want. -1. For the `Admin State` Leave the setting as `UP` -1. Choose next for the `Subnet` Section. -1. You can name this `Subnet Name` anything you would like. We used adminsubnet. -1. For the `Network Address` field this will be the subnet that is the internal network for this network. We used `172.16.1.0/24` -1. You can leave the `IP Version` as IPV4 and the `Gateway IP` empty. -1. Leave the `Disable Gateway` unchecked. -1. Choose `Next` to move to the `Subnet Details` section -1. For the `Subnet Details` section you can manually add the DNS servers if you desire. -1. Choose `Create` to complete the internal networking. -1. You should see a Green box in the top right hand corner of the page saying `Successful`. - -### Create the additional interface for the Router to connect the networks - -You should now see one Blue line with the name of the external network. The second like a orange color you have the name of the internal name and a black box in between these two with the router name. -If you highlight over the router name you will see a button that says `Add Interface` and click that button. -The title of the page will be `Add Interface` and for the `Subnet` drop down choose the internal network you created in the last section. -Leave the `IP Address`, `Router Name` and the `Router ID` alone. -Click the button labeled `Add Interface`. -You should see a Green box in the top right hand corner of the page saying `Successful`. - -### Verify the Router Connectivity - -Click on the router that you created in the last step. -In the `External Fixed IPs` Under the `External Gateway` Section you will see an `IP Address`. this is the Gateway that the Virtual Machines will be accessing. -On the Chef Server see if you are able to ping that address: - -``` -$ ping 192.168.2.10 -PING 192.168.2.10 (192.168.2.10): 56 data bytes -64 bytes from 192.168.2.10: icmp_seq=0 ttl=255 time=157.467 ms -64 bytes from 192.168.2.10: icmp_seq=1 ttl=255 time=2.147 ms -``` -## Create the first OpenStack VM - -Click the`Project` section on the top right hand side of the page. -Click on the `Compute` icon on the right hand side of the page under `Project` -You will now see an item with the name of `Instances` under that. Choose that item. -On the far right hand side click the button with a cloud pointing up and the words `Launch Instance` -This will bring up a new window labeled `Launch Instance` -Type in the name of the Instance you would like to create. -For the Flavor choose which size? keep in mind that different sizes have different disk,cpu, and memory configurations. If you want more of a custom size you will need to do this prior to this section. -If you would like to create more than one instance this time you can choose that as well. -The `Instance Boot Source` will be which template you want to create. For the first one i would recommend using `Boot from image` and the `Image Name` would be `cirros (9.3 MB)`. -then click on the `Networking*` tab. -Here you will click on the internal network under `Available networks` hit the `+` sign next to the internal network name. -This will add the network for the instance on the internal network. Which in turn has a connection to the outside world via the router we created earlier. -Now choose the `Launch` button to start up the first OpenStack Instance in your new environment. -The page should turn and you will see the new instance you created. It will have under `Task` Spawning till it complete. the larger the operating system disk size the longer this process may take. - -## Logging into the new instance - -Now you will be able to click on the instance that was created in the prior section, after verifying that the Status is `Active` -If you would like to have this machine accessible from the outside in you can choose the drop down on the far right hand side instead of `Create Snapshot` Choose `Associate Floating IP`. -This will give you the abiility to choose an ip that can be accessed on the network. -Once the floating IP has been assigned you will see an IP under the `IP Address` and then another IP under the same section for `Floating IPs:` -Now click on the Instance name so we can access the console. -Then choose the tab `Console` to see the Instance's console. -You can either click on the right or left hand side in the grey area or choose the link at the top of the page labeled `Click here to show only console`. -Now that you see the console you will see that cirros gives you the username and password for this machine. Use these credentials to login. - -Now that you are logged into the Instance let verify network connectivity. -first see if you can `ping 8.8.8.8` -If that works see if DNS works and see if you can ping google.com. -If this is not working please look at the Networking topology to see where the issue may occur. Keep in mind that the OpenStack server must have 2 NIC's that are connected to the network and have the ability to access outside resources. - -#If these are working you are done! Enjoy OpenStack brought to you by the builders at Chef diff --git a/doc/aio-nova.md b/doc/aio-nova.md deleted file mode 100644 index a8e6803..0000000 --- a/doc/aio-nova.md +++ /dev/null @@ -1,21 +0,0 @@ -# All-in-One with nova-network - -Note: Default operating system is Ubuntu. If you would like CentOS, set env var REPO_OS=centos7 - -## Networking setup - -Changes need to be made to the aio-nova.rb file. - -### Device interface - -The device interface must be is specified by name in the aio-nova.rb file. -There is one place to change, look for `bridge: [....]`. If your interface is not in the list, add it. -This is for an extra network adapter to your network, this is good practise for the -more advance setups. - -Note: To see a list of virtualbox network interface names use: -`$ vboxmanage list bridgedifs` - -+ For Windows 7, open the Control Panel, Network and Internet, Network Connections. Look in the Connectivity column for a row with "Internet access", and use the "Device Name". For example, 'Intel(R) Centrino(R) Advanced-N 6205'. -+ For Mac, this works from some: `'en0: Wi-Fi (AirPort)'`, but there is an issue with VirtualBox and the Airport. You should look into using an Ethernet adaptor and something like: `'en3: Ethernet'` -+ For Linux, ...TODO... diff --git a/doc/aio-neutron.md b/doc/allinone.md similarity index 94% rename from doc/aio-neutron.md rename to doc/allinone.md index 08bf698..1516008 100644 --- a/doc/aio-neutron.md +++ b/doc/allinone.md @@ -4,7 +4,7 @@ Note: Default operating system is Ubuntu. If you would like CentOS, set env var ## Networking setup -Changes need to be made to the aio-neutron.rb file. +Changes need to be made to the allinone.rb file. ### Device interface diff --git a/doc/multi-neutron.md b/doc/multi-neutron.md deleted file mode 100644 index ae4ca7b..0000000 --- a/doc/multi-neutron.md +++ /dev/null @@ -1,11 +0,0 @@ -# Multi-node with Neutron - -Note: Default operating system is Ubuntu. If you would like CentOS, set env var REPO_OS=centos7 - -## Nodes - -The multi-node environments will have four machines `controller`, `compute1`, `compute2`, and `compute3`. - -## Networking setup - -Changes need to be made to the multi-neutron.rb and the environments\vagrant-multi-neutron.json or environments\vagrant-multi-centos7-neutron.json file. diff --git a/doc/multi-nova.md b/doc/multi-nova.md deleted file mode 100644 index 51bf43c..0000000 --- a/doc/multi-nova.md +++ /dev/null @@ -1,28 +0,0 @@ -# Multi-node with nova-network - -Note: Default operating system is Ubuntu. If you would like CentOS, set env var REPO_OS=centos7 - -## Nodes - -The multi-node environments will have four machines `controller`, `compute1`, `compute2`, and `compute3`. - -## Networking setup - -Changes need to be made to the multi-nova.rb and the environments\vagrant-multi-nova.json or environments\vagrant-multi-centos7-nova.json file. - -### Bridge IP Address - -The IP address used for the bridge should on the same network as your machine connects to the internet. Change the '172.16.100.' ip address in the multi-nova.rb and the environments\vagrant-multi-nova.json files. -For example, on my home network, my laptop has an IP of 192.168.1.xxx, so I set the bridge address to 192.168.1.60. - -### Device interface - -The device interface must be is specified by name in the multi-nova.rb file. -There are two places to change, look for `bridge: [....]`. If your interface is not in the list, add it. - -Note: To see a list of virtualbox network interface names use: -`$ vboxmanage list bridgedifs` - -+ For Windows 7, open the Control Panel, Network and Internet, Network Connections. Look in the Connectivity column for a row with "Internet access", and use the "Device Name". For example, 'Intel(R) Centrino(R) Advanced-N 6205'. -+ For Mac, this works from some: 'en0: Wi-Fi (AirPort)' or 'en3: USB Ethernet' -+ For Linux, ...TODO... diff --git a/doc/openstack-service.conf.erb.md b/doc/openstack-service.conf.erb.md new file mode 100644 index 0000000..1941fbc --- /dev/null +++ b/doc/openstack-service.conf.erb.md @@ -0,0 +1,40 @@ +# Render all openstack-service configuration files from attributes + +Note: This functionality has been added in mitaka and replaces most of the +previously existing template files to generate service configurations like +nova.conf, neutron.conf or even ml2_conf.ini. + +# Usage + +All service configuration files following the [INI file +format](https://en.wikipedia.org/wiki/INI_file) can be created with the template +from the [openstack-common cookbook] +(https://github.com/openstack/cookbook-openstack-common/blob/master/templates/default/openstack-service.conf.erb). + +The attributes to create for example the neutron.conf have to follow this +format: + +``` +default['openstack']['network']['conf'][$SECTION][$PROPERTY][$VALUE] +``` + +In the case given above, you first have to select the proper section ($SECTION) +like 'DEFAULT' or 'keystone_authtoken'. After that you can simply select the +property (e.g. 'log_file', 'verbose' or 'password') and its value (e.g. +'/var/log/neutron/neutron-server.log', true or 'mypass'). The given examples would render +something similar to this: + +``` +['DEFAULT'] +log_file = /var/log/neutron/neutron-server.log +verbose = true +['keystone_authtoken'] +password = mypass +``` + +The exact same logic is used for most services (currently keystone, nova, +neutron (conf and plugin files), cinder and glance) and will be adapted for all +other services and config files throughout the openstack cookbooks if possible. + +TODO: add more specifics of the used defaults to each service cookbook and link +these sections here diff --git a/environments/allinone-centos7.json b/environments/allinone-centos7.json new file mode 100644 index 0000000..d5bc344 --- /dev/null +++ b/environments/allinone-centos7.json @@ -0,0 +1,46 @@ +{ + "name": "allinone-centos7", + "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the vagrantfile-allinone vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin", + "cookbook_versions": { + }, + "json_class": "Chef::Environment", + "chef_type": "environment", + "default_attributes": { + "apache": { + "listen" : {} + } + }, + "override_attributes": { + "openstack": { + "yum": { + "rdo_delorean_enabled": true + }, + "mq": { + "user": "admin" + }, + "network":{ + "conf": { + "DEFAULT": { + "service_plugins": "router" + } + } + }, + "image": { + "image_upload": true, + "upload_images": [ + "cirros" + ], + "upload_image": { + "cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" + } + }, + "compute": { + "conf": { + "libvirt": { + "virt_type": "qemu" + } + } + } + } + } +} diff --git a/environments/allinone-ubuntu14.json b/environments/allinone-ubuntu14.json new file mode 100644 index 0000000..70b456c --- /dev/null +++ b/environments/allinone-ubuntu14.json @@ -0,0 +1,43 @@ +{ + "name": "allinone-ubuntu14", + "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the vagrantfile-allinone vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin", + "cookbook_versions": { + }, + "json_class": "Chef::Environment", + "chef_type": "environment", + "default_attributes": { + "apache": { + "listen" : {} + } + }, + "override_attributes": { + "openstack": { + "mq": { + "user": "admin" + }, + "network":{ + "conf": { + "DEFAULT": { + "service_plugins": "router" + } + } + }, + "image": { + "image_upload": true, + "upload_images": [ + "cirros" + ], + "upload_image": { + "cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" + } + }, + "compute": { + "conf": { + "libvirt": { + "virt_type": "qemu" + } + } + } + } + } +} diff --git a/environments/integration-aio-neutron.json b/environments/integration-aio-neutron.json deleted file mode 100644 index 082c761..0000000 --- a/environments/integration-aio-neutron.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "integration-aio-neutron", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-neutron vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "openstack": { - "mq": { - "user": "admin" - }, - "network": { - "dhcp": { - "enable_isolated_metadata": "True" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "image": { - "image_upload": true, - "upload_images": [ - "cirros" - ], - "upload_image": { - "cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" - } - }, - "compute": { - "network": { - "service_type": "neutron" - }, - "libvirt": { - "virt_type": "qemu" - } - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/environments/vagrant-aio-centos7-neutron.json b/environments/vagrant-aio-centos7-neutron.json deleted file mode 100644 index 69c8bc8..0000000 --- a/environments/vagrant-aio-centos7-neutron.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "vagrant-aio-centos7-neutron", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-neutron vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "openstack": { - "yum": { - "rdo_delorean_enabled": true - }, - "endpoints": { - "bind-host": "0.0.0.0", - "host": "0.0.0.0" - }, - "mq": { - "user": "admin" - }, - "network": { - "service_plugins": [ "neutron.services.l3_router.l3_router_plugin.L3RouterPlugin" ], - "dhcp": { - "enable_isolated_metadata": "True" - }, - "l3":{ - "external_network_bridge_interface": "enp0s8" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "image": { - "image_upload": true, - "upload_images": [ - "cirros" - ], - "upload_image": { - "cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" - } - }, - "compute": { - "network": { - "service_type": "neutron" - }, - "libvirt": { - "virt_type": "qemu" - } - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/environments/vagrant-aio-centos7-nova.json b/environments/vagrant-aio-centos7-nova.json deleted file mode 100644 index 740f4ac..0000000 --- a/environments/vagrant-aio-centos7-nova.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "vagrant-aio-centos7-nova", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-nova vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using nova-network for the networking component", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "openstack": { - "yum": { - "rdo_delorean_enabled": true - }, - "mq": { - "user": "admin" - }, - "endpoints": { - "bind-host": "0.0.0.0", - "host": "0.0.0.0" - }, - "image": { - "image_upload": true, - "upload_images": [ - "cirros", - "ubuntu-trusty", - "centos-7" - ], - "upload_image": { - "cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img", - "ubuntu-trusty": "http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img", - "centos-7": "http://cloud.centos.org/centos/7/devel/CentOS-7-x86_64-GenericCloud.qcow2" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "compute": { - "network": { - "public_interface": "enp0s3", - "service_type": "nova" - }, - "libvirt": { - "virt_type": "qemu" - }, - "networks": [ - { - "label": "public", - "ipv4_cidr": "192.168.10.0/24", - "num_networks": "1", - "network_size": "255", - "bridge": "br100", - "bridge_dev": "enp0s8", - "dns1": "8.8.8.8", - "dns2": "8.8.4.4" - } - ] - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/environments/vagrant-aio-neutron.json b/environments/vagrant-aio-neutron.json deleted file mode 100644 index 7f4f4bf..0000000 --- a/environments/vagrant-aio-neutron.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "vagrant-aio-neutron", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-neutron vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "openstack": { - "endpoints": { - "bind-host": "0.0.0.0", - "host": "0.0.0.0", - "identity-bind": { - "host": "0.0.0.0" - } - }, - "mq": { - "user": "admin" - }, - "network": { - "service_plugins": [ "neutron.services.l3_router.l3_router_plugin.L3RouterPlugin" ], - "dhcp": { - "enable_isolated_metadata": "True" - }, - "l3":{ - "external_network_bridge_interface": "eth1" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "image": { - "image_upload": true, - "upload_images": [ - "cirros" - ], - "upload_image": { - "cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" - } - }, - "compute": { - "network": { - "service_type": "neutron" - }, - "libvirt": { - "virt_type": "qemu" - } - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/environments/vagrant-aio-nova.json b/environments/vagrant-aio-nova.json deleted file mode 100644 index 9c43776..0000000 --- a/environments/vagrant-aio-nova.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "vagrant-aio-nova", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-nova vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using nova-network for the networking component", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "openstack": { - "mq": { - "user": "admin" - }, - "endpoints": { - "bind-host": "0.0.0.0", - "host": "0.0.0.0" - }, - "image": { - "image_upload": true, - "upload_images": [ - "cirros", - "ubuntu-trusty", - "fedora" - ], - "upload_image": { - "cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img", - "ubuntu-trusty": "http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img", - "fedora": "http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "compute": { - "network": { - "public_interface": "eth0", - "service_type": "nova" - }, - "enabled_apis": "ec2,osapi_compute", - "config": { - "ram_allocation_ratio": 5.0 - }, - "libvirt": { - "virt_type": "qemu" - }, - "networks": [ - { - "label": "public", - "ipv4_cidr": "192.168.10.0/24", - "num_networks": "1", - "network_size": "255", - "bridge": "br100", - "bridge_dev": "eth1", - "dns1": "8.8.8.8", - "dns2": "8.8.4.4" - } - ] - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/environments/vagrant-multi-centos7-nova.json b/environments/vagrant-multi-centos7-nova.json deleted file mode 100644 index 3067476..0000000 --- a/environments/vagrant-multi-centos7-nova.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "vagrant-multi-centos7-nova", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "openstack": { - "yum": { - "rdo_delorean_enabled": true - }, - "mq": { - "user": "admin" - }, - "endpoints": { - "bind-interface": "enp0s8", - "compute-vnc-bind":{ - "host": "0.0.0.0" - } - }, - "image": { - "image_upload": true, - "upload_images": [ - "cirros", - "ubuntu-trusty", - "centos-7" - ], - "upload_image": { - "cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img", - "ubuntu-trusty": "http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img", - "centos-7": "http://cloud.centos.org/centos/7/devel/CentOS-7-x86_64-GenericCloud.qcow2" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "compute": { - "network": { - "public_interface": "enp0s3", - "service_type": "nova", - "multi_host": "true" - }, - "libvirt": { - "virt_type": "qemu" - }, - "networks": [ - { - "label": "public", - "ipv4_cidr": "10.0.1.0/24", - "num_networks": "1", - "network_size": "254", - "bridge": "br100", - "bridge_dev": "enp0s8", - "dns1": "8.8.8.8", - "dns2": "8.8.4.4", - "multi_host": "T" - } - ] - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/environments/vagrant-multi-nova.json b/environments/vagrant-multi-nova.json deleted file mode 100644 index 9b14f3a..0000000 --- a/environments/vagrant-multi-nova.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "vagrant-multi-nova", - "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-multi-neutron vagrantfile. Defines the necessary attributes for a working mutltinode (1 controller/n computes) openstack deployment, using neutron (with gre tunnels between hosts) for the networking component.", - "cookbook_versions": { - }, - "json_class": "Chef::Environment", - "chef_type": "environment", - "default_attributes": { - }, - "override_attributes": { - "yum": { - "repo": { - "baseurl": "https://repos.fedorapeople.org/repos/openstack/openstack-liberty/epel-7" - }, - "epel": { - "mirrorlist": "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=$basearch", - "gpgkey": "http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7" - } - }, - "mysql": { - "allow_remote_root": true, - "root_network_acl": ["%"] - }, - "openstack": { - "mq": { - "user": "admin" - }, - "yum": { - "uri": "https://repos.fedorapeople.org/repos/openstack/openstack-liberty/epel-7" - }, - "identity": { - "bind_interface": "eth1" - }, - "endpoints": { - "bind-host": "172.16.100.60", - "host": "172.16.100.60", - "mq": { - "host": "172.16.100.60" - }, - "db": { - "host": "172.16.100.60" - }, - "compute-vnc-bind":{ - "host": "0.0.0.0" - } - }, - "image": { - "api": { - "bind_interface": "eth1" - }, - "registry": { - "bind_interface": "eth1" - }, - "image_upload": true, - "upload_images": [ - "cirros", - "ubuntu-trusty", - "centos-7" - ], - "upload_image": { - "cirros": "http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img", - "ubuntu-trusty": "https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img", - "centos-7": "http://cloud.centos.org/centos/7/devel/CentOS-7-x86_64-GenericCloud.qcow2" - } - }, - "block-storage": { - "volume": { - "create_volume_group": true, - "default_volume_type": "lvm" - } - }, - "compute": { - "enabled_apis": "ec2,osapi_compute", - "libvirt": { - "virt_type": "qemu" - }, - "network": { - "public_interface": "eth0", - "service_type": "nova", - "multi_host": "true" - }, - "config": { - "ram_allocation_ratio": 5.0 - }, - "networks": [ - { - "label": "public", - "ipv4_cidr": "172.16.100.0/24", - "num_networks": "1", - "network_size": "254", - "bridge": "br100", - "bridge_dev": "eth1", - "dns1": "8.8.8.8", - "dns2": "8.8.4.4", - "multi_host": "T" - } - ] - }, - "orchestration": { - "heat_stack_user_role": "heat_stack_user", - "stack_user_domain_name": "heat", - "stack_domain_admin": "heat_stack_admin" - } - } - } -} diff --git a/multi-nova.rb b/multi-nova.rb deleted file mode 100644 index 7e001a9..0000000 --- a/multi-nova.rb +++ /dev/null @@ -1,74 +0,0 @@ -require 'chef/provisioning' - -controller_config = <<-ENDCONFIG - config.vm.network "forwarded_port", guest: 443, host: 9443 # dashboard-ssl - config.vm.network "forwarded_port", guest: 4002, host: 4002 - config.vm.network "forwarded_port", guest: 5000, host: 5000 - config.vm.network "forwarded_port", guest: 6080, host: 6080 - config.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api - config.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api - config.vm.network "forwarded_port", guest: 35357, host: 35357 - config.vm.provider "virtualbox" do |v| - v.memory = 2048 - v.cpus = 2 - v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] - v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] - v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] - end - config.vm.network "public_network", ip: "172.16.100.60", - bridge: ["en0: USB Ethernet", - "en1: USB Ethernet", - "en2: USB Ethernet", - "en3: USB Ethernet", - "en4: USB Ethernet", - "en0: Wi-Fi (AirPort)", - "en1: Wi-Fi (AirPort)", - "en2: Wi-Fi (AirPort)", - "Intel(R) Centrino(R) Advanced-N 6205"] -ENDCONFIG - -env = 'vagrant-multi-nova' -env = 'vagrant-multi-centos7-nova' if ENV['REPO_OS'].to_s.include?('centos') - -machine 'controller' do - add_machine_options vagrant_config: controller_config - role 'os-compute-single-controller' - recipe 'openstack-common::openrc' - recipe 'openstack-common::client' - recipe 'openstack-integration-test::setup' - chef_environment env - file('/etc/chef/openstack_data_bag_secret', - "#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret") - converge true -end - -resource_name :machine_batch do - [%w(compute1 61), %w(compute2 62), %w(compute3 63)].each do |name, ip_suff| - machine name do - add_machine_options vagrant_config: <<-ENDCONFIG -config.vm.provider "virtualbox" do |v| - v.memory = 2048 - v.cpus = 2 - v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] - v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] - v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] -end -config.vm.network "public_network", ip: "172.16.100.#{ip_suff}", - bridge: ["en0: USB Ethernet", - "en1: USB Ethernet", - "en2: USB Ethernet", - "en3: USB Ethernet", - "en4: USB Ethernet", - "en0: Wi-Fi (AirPort)", - "en1: Wi-Fi (AirPort)", - "en2: Wi-Fi (AirPort)", - "Intel(R) Centrino(R) Advanced-N 6205"] -ENDCONFIG - role 'os-compute-worker' - chef_environment env - file('/etc/chef/openstack_data_bag_secret', - "#{File.dirname(__FILE__)}/.chef/encrypted_data_bag_secret") - converge true - end - end -end diff --git a/roles/allinone.json b/roles/allinone.json new file mode 100644 index 0000000..5d2ea97 --- /dev/null +++ b/roles/allinone.json @@ -0,0 +1,56 @@ +{ + "name": "allinone", + "description": "This will deploy all of the services for Openstack Compute to function on a single box.", + "json_class": "Chef::Role", + "default_attributes": { + }, + "override_attributes": { + }, + "chef_type": "role", + "run_list": [ + "recipe[locale]", + "recipe[apt]", + "recipe[yum]", + "recipe[openstack-common]", + "recipe[openstack-common::logging]", + "recipe[openstack-common::sysctl]", + "recipe[openstack-ops-database::server]", + "recipe[openstack-ops-database::openstack-db]", + "recipe[openstack-ops-messaging::rabbitmq-server]", + "recipe[openstack-identity::server-apache]", + "recipe[openstack-identity::registration]", + "recipe[openstack-identity::openrc]", + "recipe[openstack-image::api]", + "recipe[openstack-image::registry]", + "recipe[openstack-image::identity_registration]", + "recipe[openstack-network::identity_registration]", + "recipe[openstack-network::ml2_core_plugin]", + "recipe[openstack-network::ml2_openvswitch]", + "recipe[openstack-network::plugin_config]", + "recipe[openstack-network::l3_agent]", + "recipe[openstack-network::dhcp_agent]", + "recipe[openstack-network::metadata_agent]", + "recipe[openstack-network::server]", + "recipe[openstack-compute::nova-setup]", + "recipe[openstack-compute::identity_registration]", + "recipe[openstack-compute::conductor]", + "recipe[openstack-compute::scheduler]", + "recipe[openstack-compute::api-ec2]", + "recipe[openstack-compute::api-os-compute]", + "recipe[openstack-compute::api-metadata]", + "recipe[openstack-compute::nova-cert]", + "recipe[openstack-compute::vncproxy]", + "recipe[openstack-compute::compute]", + "recipe[openstack-compute::identity_registration]", + "recipe[openstack-block-storage::api]", + "recipe[openstack-block-storage::scheduler]", + "recipe[openstack-block-storage::volume_driver_lvm]", + "recipe[openstack-block-storage::volume]", + "recipe[openstack-block-storage::backup]", + "recipe[openstack-block-storage::identity_registration]", + "recipe[openstack-common::client]", + "recipe[openstack-dashboard::server]" + ], + "env_run_lists": { + } +}