Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ script:
- cfy blueprints validate -p openstack-haproxy-blueprint.yaml
- cfy blueprints validate -p singlehost-blueprint.yaml
- cfy blueprints validate -p softlayer-blueprint.yaml
- cfy blueprints validate -p vsphere-blueprint.yaml
- cfy blueprints validate -p cloudstack-blueprint.yaml
- cfy blueprints validate -p cloudstack-vpc-blueprint.yaml
- cfy blueprints validate -p host-pool-blueprint.yaml
Expand Down
161 changes: 161 additions & 0 deletions vsphere-blueprint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
tosca_definitions_version: cloudify_dsl_1_0

imports:
- http://www.getcloudify.org/spec/cloudify/3.3m3/types.yaml
- http://www.getcloudify.org/spec/vsphere-plugin/1.3m3/plugin.yaml
- http://www.getcloudify.org/spec/diamond-plugin/1.3m3/plugin.yaml
- types/nodecellar.yaml

inputs:

template_name:
description: >
Template to clone VMs from

agent_user:
description: >
User for connecting to application VMs

management_network:
description: >
Which network to deploy the VM on

external_network:
description: >
Which network to deploy the VM on

node_types:

nodecellar.nodes.MonitoredServer:
derived_from: cloudify.vsphere.nodes.Server
properties:
cloudify_agent:
default:
user: { get_input: agent_user }
server:
default:
template: { get_input: template_name }
cpus: 1
memory: 2048
networking:
default:
connect_networks:
- name: { get_input: management_network }
switch_distributed: True
management: True
- name: { get_input: external_network }
switch_distributed: True
external: True

interfaces:

###########################################################
# We are infact telling cloudify to install a diamond
# monitoring agent on the server.
#
# (see https://github.com/BrightcoveOS/Diamond)
###########################################################

cloudify.interfaces.monitoring_agent:
install:
implementation: diamond.diamond_agent.tasks.install
inputs:
diamond_config:
default:
interval: 1
start: diamond.diamond_agent.tasks.start
stop: diamond.diamond_agent.tasks.stop
uninstall: diamond.diamond_agent.tasks.uninstall

###########################################################
# Adding some collectors. These collectors are necessary
# for the Cloudify UI to display the deafult metrics.
###########################################################

cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
default:
CPUCollector: {}
MemoryCollector: {}
LoadAverageCollector: {}
DiskUsageCollector:
config:
devices: x?vd[a-z]+[0-9]*$
NetworkCollector: {}

node_templates:

mongod_host:
type: nodecellar.nodes.MonitoredServer

nodejs_host:
type: nodecellar.nodes.MonitoredServer

mongod:
type: nodecellar.nodes.MongoDatabase
properties:
port: 27017
interfaces:
cloudify.interfaces.lifecycle:

###########################################################
# The MongoDBCollector depends on a python library called
# pymongo. We install this library in the 'configure'
# lifecycle hook of this node.
###########################################################

configure: scripts/mongo/install-pymongo.sh

###########################################################
# Notice that this node defines an additional collector
# to collect data on the MongoDB.
###########################################################

cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
MongoDBCollector:
config:
hosts: "localhost:27017"
relationships:
- type: cloudify.relationships.contained_in
target: mongod_host

nodejs:
type: nodecellar.nodes.NodeJSServer
relationships:
- type: cloudify.relationships.contained_in
target: nodejs_host

nodecellar:
type: nodecellar.nodes.NodecellarApplicationModule
properties:
port: 8080
relationships:

################################
# Setting the mongo connection
################################

- type: node_connected_to_mongo
target: mongod

################################
# Setting the nodejs connection
################################

- type: node_contained_in_nodejs
target: nodejs

outputs:

endpoint:
description: Web application endpoint
value:
ip_address: { get_attribute: [ nodejs_host, public_ip ] }
port: { get_property: [ nodecellar, port ] }