Repository is archived
No commit activity in last 3 years
No release in over 3 years
Create new VM and apply an opinionated set of commands to them, using vcloud API. The vcloud-box-spinner is a thin wrapper around fog, which enables you to be able to configure VMs with static IPs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
~> 2.11.0

Runtime

~> 1.15.0
~> 1.5.0
 Project Readme

This project is no longer under active development. We had a number of issues with it, in particular with using the Fog vCloud client rather than the vCloud Director client, such as timing out when provisioning vApps.

Please take a look at our new vCloud provisioning project: vCloud Tools.

vCloud Box Spinner

This is a wrapper around the vCloud director API that should allow for easy provisioning of VMs.

Installation

gem install vcloud-box-spinner

Usage

You should be able to do vcloud-box-spinner --help

Usage: vcloud-box-spinner [options] <org_config> <machine_config>

Provision a machine described by the JSON template `machine_config` in the vCloud organisation
described in the JSON config file `org_config`

e.g. vcloud-box-spinner -u username orgs/staging.json machines/frontend-1.json

    -c, --credential=GROUP           fog credential group
    -u, --user=USERNAME              vCloud username
    -p, --password=PASSWORD          vCloud password
    -F, --ssh-config=FILENAME        SSH config file(s) to use (can be specified multiple times)
    -s, --setup-script=SETUP-SCRIPT  path to setup script that should run after machine is brought up
    -d, --debug                      Enable debugging output
    -v, --verbose                    Enable verbose output
    -h, --help                       Show usage instructions

To provision a machine you will need to specify at least two JSON files:

  1. A JSON config file which tells the provisioner about the vCloud organisation into which it is to provision a vApp
  2. A JSON config file which defines the machine-specific setup

Options:

  • user is the username on your "vmware vcloud director" page (usually in the top right corner).

  • setup-script allows you to pass a script file path (shell), which would be loaded as guest customization script. The purpose of providing this option, is to let user do some basic bootstraping. The script is not for the purpose of encouraging configuration management and that should be done separately. A particular example of how you can use the script is - You can set ssh configuration for a user(eg ci), which can ssh in the system later and run the config management script/tool. On how to write this script please refer the following links:

The best way to understand the formats of the json files, read the docs here

Once you have an org and machine config, you can invoke the provisioner as follows:

vcloud-box-spinner -u username -p password org_config.json machine_config.json

Environment Variables

  • FOG_RC specifies the fog credentials file if not ~/.fog.
  • FOG_CREDENTIAL specifies the credential group if not default.

Hacking

refer here

Testing

You can run the tests with:

bundle exec rake