From 79acf823a99c5a74c16aa3434c87bfc3579e75d9 Mon Sep 17 00:00:00 2001 From: adamlavie Date: Tue, 28 Jul 2015 00:52:44 +0300 Subject: [PATCH] CFY-3188 added nodecellar bp for vsphere --- .travis.yml | 1 + vsphere-blueprint.yaml | 161 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 vsphere-blueprint.yaml diff --git a/.travis.yml b/.travis.yml index 67e84d5..d70462b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/vsphere-blueprint.yaml b/vsphere-blueprint.yaml new file mode 100644 index 0000000..74ddf66 --- /dev/null +++ b/vsphere-blueprint.yaml @@ -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 ] }