cookbook 'cloudstack', '= 3.1.0'
cloudstack (7) Versions 3.1.0 Follow3
Installs/Configures cloudstack
cookbook 'cloudstack', '= 3.1.0', :supermarket
knife supermarket install cloudstack
knife supermarket download cloudstack
cloudstack Cookbook
Install and configure Apache Cloudstack using Chef. A wrapper cookbook is prefered in order to Install Apache CloudStack properly, refer to cloudstack_wrapper cookbook for example.
Tested on CentOS 6.5 and Ubuntu 14.04
About Apache Cloudstack
Apache CloudStack is open source software designed to deploy and manage large networks of virtual machines, as a highly available, highly scalable Infrastructure as a Service (IaaS) cloud computing platform.
More info on: http://cloudstack.apache.org/
Requirements
cookbooks
-
yum
- packages management -
apt
- packages management -
mysql
- for MySQL database server and client -
sudo
- to configure sudoers for user "cloud"
There is a dependency on Ruby gem cloudstack_ruby_client for chef which is handle in recipe[cloudstack::default]
.
Resources/Providers
cloudstack_setup_database
Create MySQL database and connection configuration used by CloudStack management-server using /usr/bin/cloudstack-setup-databases
utility.
Examples
# Using attributes cloudstack_setup_database node["cloudstack"]["db"]["host"] do root_user node["cloudstack"]["db"]["rootusername"] root_password node["cloudstack"]["db"]["rootpassword"] user node["cloudstack"]["db"]["username"] password node["cloudstack"]["db"]["password"] action :create end
# using mysql cookbook and CloudStack default passwords cloudstack_setup_database node["cloudstack"]["db"]["host"] do action :create end
cloudstack_system_template
Download initial SystemVM template prior to initialize a CloudStack Region. cloudstack_system_template require access to CloudStack database which must be initated before executing this ressource. If no URL is provided cloudstack_system_template will use the default URL from the database if available to download the template.
Examples
# Using attributes cloudstack_system_template 'xenserver' do url node['cloudstack']['systemvm']['xenserver'] nfs_path node["cloudstack"]["secondary"]["path"] nfs_server node["cloudstack"]["secondary"]["host"] db_user node["cloudstack"]["db"]["username"] db_password node["cloudstack"]["db"]["password"] db_host node["cloudstack"]["db"]["host"] end
Which is equivalent to:
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \ -m /mnt/secondary \ -u http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-xen.vhd.bz2 \ -h xenserver \ -F
Simpler example:
# Using URL from CloudStack database cloudstack_system_template 'kvm' do end
cloudstack_setup_management
Post package installation and Database Creation for CloudStack, cloudstack-management service must be configure using a script /usr/bin/cloudstack-setup-management
.
cloudstack_setup_management node.name
cloudstack_api_keys
Generate api keys for account. Currently working only for admin account.
Will update attributes:
- node["cloudstack"]["admin"]["api_key"]
- node["cloudstack"]["admin"]["secret_key"]
examples
# Create API key if now exist in Cloudstack and update node attributes cloudstack_api_keys "admin" do action :create end
# Generate new API Keys cloudstack_api_keys "admin" do action :reset end
cloudstack_global_setting
Update Global Settings values.
examples
cloudstack_global_setting "expunge.delay" do value "80" notifies :restart, "service[cloudstack-management]", :delayed end
Recipes
cloudstack::management_server
Prepare the node to be a CloudStack management server. It will not fully
install CloudStack because of dependency such as MySQL server and system VM
templates. Refer to cloudstack_wrapper cookbook
to install a fully working CloudStack management-server.
cloudstack::usage
Install, enable and start cloudstack-usage. cloudstack-usage is usefull to collect resource usage from account. This recipe make sure cloudstack-usage run on a cloudstack-management server as it is required.
cloudstack::kvm_agent
Install, enable and start KVM cloudstack-agent. KVM host managed by CloudStack require an agent. This recipe install cloudstack-agent required on a KVM server.
Support Ubuntu and CentOS/RHEL KVM server.
cloudstack::vhd-util
Download the tool vhd-util which is not include in CloudStack packages and required to manage XenServer hosts.
cloudstack::mysql_conf
MySQL tunning based on official CloudStack documentation.
cloudstack::eventbus
Configure CloudStack to send Events into RabbitMQ message bus. Work for CloudStack 4.3 and latest. RabbitMQ must be installed and configured somewhere, default values are for localhost.
cloudstack::default
Chef Required dependencies in order to interact with CloudStack.
Attributes
Attributes can be customized. The cookbook does not support encrypted data bag usage for now.
- <tt>node['cloudstack']['yum_repo']</tt> - yum repo url to use, default: http://cloudstack.apt-get.eu/rhel/4.3/
- <tt>node['cloudstack']['apt_repo']</tt> - apt repo url to use, default: http://cloudstack.apt-get.eu/ubuntu
- <tt>node['cloudstack']['release_major']</tt> - Major CloudStack release ex: 4.3 or 4.2
- <tt>node['cloudstack']['version']</tt> - Package version ex: 4.2.1-1.el6
Contributing
TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
e.g.
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
- Author:: Pierre-Luc Dion (pdion@cloudops.com)
Some snippets have been taken from: schubergphilis/cloudstack-cookbook
- Author:: Roeland Kuipers (rkuipers@schubergphilis.com)
- Author:: Sander Botman (sbotman@schubergphilis.com)
- Author:: Hugo Trippaers (htrippaers@schubergphilis.com)
Copyright:: Copyright (c) 2015 Author's Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
cloudstack CHANGELOG
This file is used to list changes made in each version of the co-cloudstack cookbook.
3.1.0
- pdion891 - support cookbook mysql6
3.0.10
- pdion891 - fix port_open: localhost-> 127.0.0.1
3.0.9
- pdion891 - fix sudoers.
3.0.8
- pdion891 - update date in header. - readme typos
3.0.7
- pdion891 - rename
hypervisor_tpl
bysystemvm
3.0.6
- pdion891 - update 4.4.1 systemplate urls
3.0.5
- pdion891 - fix systemvmtemplate url selection
3.0.4
- pdion891 - api_key: major rewrite part1.
3.0.3
- pdion891 - api_key: add existing keys validation to fix admin password change.
3.0.2
- pdion891 - Add eventlog to rabbitmq config template
3.0.0
- pdion891 - Complete rewrite of co-cloudstack as cloudstack using Chef LWRP
- pdion891 - Rename cookbook from co-cloudstack to cloudstack.
2.0.3
- pdion891 - Add mysql-conf to configure mysql-server tunings required by CloudStack.
2.0.2
- pdion891 - change way of generating APIkeys by querying CloudStack API instead of enabling integration api port.
2.0.0
- pdion891 - add support for CS 4.3
1.0.0
- pdion891 - add vhd-util recipe
- Update license headers
- Update dependencies for opscode cookbooks
0.1.2
- pdion891 - remove use of databag and use attributes instead.
0.1.0
- pdion891 - Initial release of co-cloudstack
Foodcritic Metric
3.1.0 failed this metric
FC003: Check whether you are running with chef server before using server-specific features: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/libraries/api_keys.rb:38
FC017: LWRP does not notify when updated: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/providers/api_keys.rb:40
FC017: LWRP does not notify when updated: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/providers/setup_management.rb:22
FC019: Access node attributes in a consistent manner: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/recipes/usage.rb:32
FC019: Access node attributes in a consistent manner: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/recipes/vhd-util.rb:26
FC023: Prefer conditional attributes: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/libraries/system_template.rb:37
FC023: Prefer conditional attributes: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/recipes/management_server.rb:32
FC048: Prefer Mixlib::ShellOut: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/providers/system_template.rb:56
3.1.0 failed this metric
FC017: LWRP does not notify when updated: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/providers/api_keys.rb:40
FC017: LWRP does not notify when updated: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/providers/setup_management.rb:22
FC019: Access node attributes in a consistent manner: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/recipes/usage.rb:32
FC019: Access node attributes in a consistent manner: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/recipes/vhd-util.rb:26
FC023: Prefer conditional attributes: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/libraries/system_template.rb:37
FC023: Prefer conditional attributes: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/recipes/management_server.rb:32
FC048: Prefer Mixlib::ShellOut: /tmp/cook/85f24d853a5a1882923c4eae/cloudstack/providers/system_template.rb:56