Skip to content

Repository files navigation

CloudStack Cookbook

Build StatusCookbook Versionlicense

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 7 Some parts work with Ubuntu 16.04 but this cookbook does not perform all configuraiton required for CloudStack Management-server on Ubuntu.

Table of Contents

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.

# Using attributescloudstack_setup_databasenode['cloudstack']['db']['host']doroot_usernode['cloudstack']['db']['rootusername']root_passwordnode['cloudstack']['db']['rootpassword']usernode['cloudstack']['db']['username']passwordnode['cloudstack']['db']['password']action:createend
# using mysql cookbook and CloudStack default passwordscloudstack_setup_databasenode['cloudstack']['db']['host']doaction:createend

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.

# Using attributescloudstack_system_template'xenserver'dourlnode['cloudstack']['systemvm']['xenserver']nfs_pathnode['cloudstack']['secondary']['path']nfs_servernode['cloudstack']['secondary']['host']db_usernode['cloudstack']['db']['username']db_passwordnode['cloudstack']['db']['password']db_hostnode['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 databasecloudstack_system_template'kvm'doend

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_managementnode.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']
# Create API key if now exist in Cloudstack and update node attributescloudstack_api_keys'admin'doaction:createend
# Generate new API Keyscloudstack_api_keys'admin'doaction:resetend

cloudstack_global_setting

Update Global Settings values.

cloudstack_global_setting'expunge.delay'dovalue'80'notifies:restart,'service[cloudstack-management]',:delayedend

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.

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.

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Some snippets have been taken from: schubergphilis/cloudstack-cookbook

Copyright:: Copyright (c) 2018 CloudOps Inc.
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.

About

Chef library cookbook for Apache CloudStack using LWRP.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages