Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

maestrodev/maestro-fog-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maestro-fog-plugin

Code Climate

Maestro plugin providing tasks to provision instances with fog. This plugin is a Ruby-based deployable that gets delivered as a ZIP file.

Currently supporting

After the VMs/instances are started, the plugin can execute SSH commands on them. For that to happen sometimes public/private SSH keys need to be configured in the VM or in the plugin fields if possible.

Requirements

Requires Maestro 4.20+ and Maestro Agent 2.3+

Common parameters

  • number_of_vms: number of vms/instances to start (defaults to 1)
  • name: if set it will assign a name to the VM when possible, otherwise the name will be random. If number_of_vms > 1, then the a random id will be appended (ie. vm_qwert, vm_asdfg, vm_zxcvb,...)
  • ssh_commands: commands to execute on each vm after started, they are executed as one script, so task will only fail if the last one does, or use bash set -e appropiately
  • ssh_user: username to use when connecting to the vm using ssh (defaults to root)
  • ssh_password: password to use for ssh connections if not using the ssh key (keys take precedence)
  • private_key: SSH private key content (if not using private_key_path)
  • private_key_path: SSH private key path (if not using private_key). The file must exist in the agents and path must be accessible from the agents that run the task.

Outputs

All provision tasks will set some fields that can be reused in later tasks using Ruby syntax.

  • fields[:cloud_ips]: array with the ips of the servers started in all providers in current composition
  • fields[:cloud_ips]: array with the ips of the servers started in all providers in current composition
  • fields[:cloud_names]: array with the names of the servers started in all providers in current composition
  • fields[:provider_name_ips]: array with the ips of the servers started (ie. fields[:rackspace_ips])
  • fields[:provider_name_ids]: array with the ids of the servers started (ie. fields[:rackspace_ids])
  • fields[:provider_name_names]: array with the name of the servers started (ie. fields[:rackspace_ids])

For instance you can add a confirmation task that will display the ips of the vms using ruby syntax

Servers started at #{fields[:rackspace_ips].join(', ')}

Or to display urls to those vms

Servers available at #{fields[:rackspace_ips].map { |ip| 'http://' + ip + ':8080'}.join(', ')}

You can ssh to the first vm started using the ssh execute task and this hostname

#{fields[:cloud_ips].first}

Rackspace

You can find the image_id and flavor_id by adding a server from the Rackspace UI or using the API for images and flavors.

Some image ids for v1

100Arch 2011.10
114CentOS 5.6
121CentOS 5.8
118CentOS 6.0
122CentOS 6.2
103Debian 5 (Lenny)
104Debian 6 (Squeeze)
116Fedora 15
120Fedora 16
126Fedora 17
108Gentoo 11.0
110Red Hat Enterprise Linux 5.5
111Red Hat Enterprise Linux 6
112Ubuntu 10.04 LTS
115Ubuntu 11.04
119Ubuntu 11.10
125Ubuntu 12.04 LTS
85Windows Server 2008 R2 (64-bit)
86Windows Server 2008 R2 (64-bit) + SQL Server 2008 R2 Standard
89Windows Server 2008 R2 (64-bit) + SQL Server 2008 R2 Web
91Windows Server 2008 R2 (64-bit) + SQL Server 2012 Standard
92Windows Server 2008 R2 (64-bit) + SQL Server 2012 Web
31Windows Server 2008 SP2 (32-bit)
56Windows Server 2008 SP2 (32-bit) + SQL Server 2008 R2 Standard
24Windows Server 2008 SP2 (64-bit)
57Windows Server 2008 SP2 (64-bit) + SQL Server 2008 R2 Standard
109openSUSE 12

Some flavor ids for v1

1256 server
2512 server
31GB server
42GB server
54GB server
68GB server
715.5GB server
830GB server

Some image ids for v2

e0ed4adb-3a00-433e-a0ac-a51f1bc1ea3dCentOS 6.4
992ba82c-083b-4eed-9c26-c54473686466Windows Server 2012 + SharePoint Foundation 2013 with SQL Server 2012 Standard
8a3a9f96-b997-46fd-b7a8-a9e740796ffdUbuntu 12.10 (Quantal Quetzal)
a3a2c42f-575f-4381-9c6d-fcd3b7d07d17CentOS 6.0
d6dd6c70-a122-4391-91a8-decb1a356549Red Hat Enterprise Linux 6.1
5cebb13a-f783-4f8c-8058-c4182c724ccdUbuntu 12.04 LTS (Precise Pangolin)
7957e53d-b3b9-41fe-8e0d-5252bf20a5bfWindows Server 2008 R2 SP1 (with updates)
b762ee1d-11b5-4ae7-aa68-dcc1b6f6e24aWindows Server 2012 (with updates) + SQL Server 2012 Web
f86eae6d-09ea-42e6-a5b2-422649edcfa1Windows Server 2012 (with updates) + SQL Server 2012 Standard
057d2670-68bc-4e28-b7b1-b9bc72245683Windows Server 2012 + SQL Server 2012 Web
d226f189-f83f-4569-95b8-622133d71f02Windows Server 2012 + SQL Server 2012 Standard
2748ee06-ff35-4518-9759-4acb57bad4c3Windows Server 2012 (with updates)
acf05b3c-5403-4cf0-900c-9b12b0db0644CentOS 5.8
c94f5e59-0760-467a-ae70-9a37cfa6b94eArch 2012.08
110d5bd8-a0dc-4cf5-8e75-149a58c17bbfGentoo 12.3
9eb71a23-2c7e-479c-a6b1-b38aa64f172eWindows Server 2008 R2 SP1 + SharePoint Foundation 2010 SP1 & SQL Server 2008 R2 SP1 Std
7f7183b0-856c-4894-afae-9e52839ce197Windows Server 2008 R2 SP1 + SharePoint Foundation 2010 SP1 & SQL Server 2008 R2 SP1 Express
ae49b64d-9d68-4b36-98ed-b1ce84944680Windows Server 2012
d531a2dd-7ae9-4407-bb5a-e5ea03303d98Ubuntu 10.04 LTS (Lucid Lynx)
f7d06722-2b30-4c02-b74d-da5a7337f357Windows Server 2008 R2 SP1 + SQL Server 2012 Standard
e7a11eed-d348-44da-8210-f136d4256e81Windows Server 2008 R2 SP1 + SQL Server 2012 Web
e4589dc6-b972-482f-91ef-67feb891b559Windows Server 2008 R2 SP1 (with updates) + SQL Server 2012 Standard
d6153e86-f4e0-4053-a711-d35632e512cdWindows Server 2008 R2 SP1 + SQL Server 2008 R2 Web
80599479-b5a2-49f2-bb46-2bc75a8be98bWindows Server 2008 R2 SP1 (with updates) + SQL Server 2008 R2 SP1 Web
6f8ab5a1-42ff-433b-be40-e17374f2fff4Windows Server 2008 R2 SP1 (with updates) + SQL Server 2012 Web
535d5453-79dd-4635-bbd6-d87b1f1cd717Windows Server 2008 R2 SP1 (with updates) + SQL Server 2008 R2 SP1 Standard
2a4a02aa-523a-4649-9802-3a09de8e5f1bWindows Server 2008 R2 SP1 + SQL Server 2008 R2 Standard
b9ea8426-8f43-4224-a182-7cdb2bb897c8Windows Server 2008 R2 SP1
c79fecf7-2c37-4c51-a240-e9fa913c90a3FreeBSD 9
c195ef3b-9195-4474-b6f7-16e5bd86acd0CentOS 6.3
d42f821e-c2d1-4796-9f07-af5ed7912d0eFedora 17 (Beefy Miracle)
0cab6212-f231-4abd-9c70-608d0d0e04baCentOS 6.2
644be485-411d-4bac-aba5-5f60641d92b5Red Hat Enterprise Linux 5.5
8bf22129-8483-462b-a020-1754ec822770Ubuntu 11.04 (Natty Narwhal)
096c55e5-39f3-48cf-a413-68d9377a3ab6openSUSE 12.1
a10eacf7-ac15-4225-b533-5744f1fe47c1Debian 6 (Squeeze)
bca91446-e60e-42e7-9e39-0582e7e20fb9Fedora 16 (Verne)
03318d19-b6e6-4092-9b5c-4758ee0ada60CentOS 5.6
3afe97b2-26dc-49c5-a2cc-a2fc8d80c001Ubuntu 11.10 (Oneiric Oncelot)

Some flavor ids for v2

2512MB Standard Instance
31GB Standard Instance
42GB Standard Instance
54GB Standard Instance
68GB Standard Instance
715GB Standard Instance
830GB Standard Instance

Openstack

  • auth_url: the URL where the autentication service can be reached (ie. http://hostname:35357/v2.0/tokens)
  • tenant: the OpenStack tenant (aka project)
  • username: username
  • api_key: API key
  • region: region identifier, may be required for some providers
  • image_id: id of the image to use
  • flavor_id: id of the server flavor to use (RAM, CPU,…)
  • key_name: the name of the ssh public key to copy to the server
  • public_key: public key content to copy to the server as authorized key
  • public_key_path: path to public key to copy to the server as authorized key
  • security_group: the name of the security group to add this VM to

Google Compute Engine

To get your authorization key, visit the Google API Console. Once there, go to "API Access". Click "Create another client ID" and select "service account". Download the private key to be used in Maestro and take note of the Service account email address.

Machines are created with persistent disks automatically, based on the image provided.

  • project: Project id
  • client_email: Service account email address
  • key_location: Path in the agent filesystem where the pk12 private key is saved
  • machine_type: VM size in CPU and RAM, ie. n1-standard-1
  • zone_name: GCE zone, ie. us-central1-a
  • image_name: image the disk is created from, ie. centos-6-v20131120
  • disk_size: boot disk size in GB
  • tags: tags associated to the instance. Can be used to create firewall rules automatically

Joyent

  • username: Joyent username
  • password: Joyent password
  • url: API endpoint (ie. https://us-west-1.api.joyentcloud.com)
  • package: Describe the sizes of either a smart machine or a virtual machine
  • dataset: The image of the software on your machine. It contains the software packages that will be available on newly provisioned machines. In the case of virtual machines, the dataset also includes the operating system

InstantServers

Instant Servers is a public cloud offering based on Joyent using specific endpoints, such as https://api-mad.instantservers.es

vSphere

  • host: vSphere host name
  • username: vSphere username
  • password: vSphere password
  • datacenter: datacenter name
  • template_path: path of the vm template to use, relative to the datacenter, ie. FolderNameHere/VMNameHere
  • destination_folder: name of the destination folder for the created vm, relative to the Datacenter. Uses the template folder by default
  • datastore: name of the datastore to use for the vm

License

Apache 2.0 License

http://www.apache.org/licenses/LICENSE-2.0.html

About

Maestro plugin to interact with cloud providers using fog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages