From c8201c119ec686e79797721156767685fe848aca Mon Sep 17 00:00:00 2001 From: shangxdy Date: Thu, 7 Apr 2016 14:08:49 -0400 Subject: Update tosca lib to version 0.5 Use tosca-parser and heat-translator to analyze to the basic nfv-tosca type definitions, and use simple tosca new feature such as policy, group and trigger, which are now supported by the latest version of tosca-parser and heat-translator. JIRA:PARSER-18 Change-Id: I797bcacbb5b32005d0aeb0f3f32851ac96e30f01 Signed--off-by: shangxdy Signed-off-by: shangxdy --- .../tests/data/hot_output/hot_artifact.yaml | 30 ++ .../tests/data/hot_output/hot_custom_type.yaml | 34 ++ .../hot_output/hot_custom_type_with_override.yaml | 34 ++ .../hot_custom_type_with_param_override.yaml | 34 ++ .../translator/tests/data/hot_output/hot_elk.yaml | 551 +++++++++++++++++++++ .../tests/data/hot_output/hot_elk_from_csar.yaml | 551 +++++++++++++++++++++ .../data/hot_output/hot_flavor_and_image.yaml | 18 + .../hot_output/hot_flavor_and_image_params.yaml | 18 + .../tests/data/hot_output/hot_hello_world.yaml | 14 + .../data/hot_output/hot_hello_world_userkey.yaml | 19 + .../tests/data/hot_output/hot_host_assignment.yaml | 135 +++++ .../tests/data/hot_output/hot_nfv_sample.yaml | 35 ++ .../hot_nodejs_mongodb_two_instances.yaml | 185 +++++++ .../tests/data/hot_output/hot_policies.yaml | 25 + .../hot_output/hot_single_instance_wordpress.yaml | 209 ++++++++ .../hot_single_instance_wordpress_from_csar.yaml | 207 ++++++++ .../data/hot_output/hot_single_object_store.yaml | 21 + .../tests/data/hot_output/hot_single_server.yaml | 36 ++ ...hot_single_server_with_defaults_with_input.yaml | 36 ++ ..._single_server_with_defaults_without_input.yaml | 36 ++ ...hot_single_server_without_tosca_os_version.yaml | 17 + .../data/hot_output/hot_software_component.yaml | 58 +++ .../tests/data/hot_output/hot_web_application.yaml | 100 ++++ .../network/hot_custom_network_nodes.yaml | 33 ++ .../network/hot_one_server_one_network.yaml | 44 ++ .../network/hot_one_server_three_networks.yaml | 71 +++ .../network/hot_server_on_existing_network.yaml | 27 + .../network/hot_two_servers_one_network.yaml | 72 +++ .../storage/hot_blockstorage_with_attachment.yaml | 71 +++ ...lockstorage_with_attachment_notation1_alt1.yaml | 92 ++++ ...lockstorage_with_attachment_notation1_alt2.yaml | 92 ++++ ...lockstorage_with_attachment_notation2_alt1.yaml | 96 ++++ ...lockstorage_with_attachment_notation2_alt2.yaml | 96 ++++ ...blockstorage_with_custom_relationship_type.yaml | 72 +++ ...ot_blockstorage_with_relationship_template.yaml | 65 +++ ...multiple_blockstorage_with_attachment_alt1.yaml | 109 ++++ ...multiple_blockstorage_with_attachment_alt2.yaml | 109 ++++ 37 files changed, 3452 insertions(+) create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_artifact.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_override.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_param_override.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image_params.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world_userkey.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_policies.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_object_store.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_without_tosca_os_version.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_software_component.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/hot_web_application.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_custom_network_nodes.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_one_network.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_three_networks.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_server_on_existing_network.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_two_servers_one_network.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml create mode 100644 tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml (limited to 'tosca2heat/heat-translator/translator/tests/data/hot_output') diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_artifact.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_artifact.yaml new file mode 100644 index 0000000..7284116 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_artifact.yaml @@ -0,0 +1,30 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test artifact usage + +parameters: {} +resources: + customwebserver_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver_create_config + input_values: + content: + get_file: http://www.mycompany.org/content.tgz + server: + get_resource: server + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + customwebserver_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: install.sh + group: script +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type.yaml new file mode 100644 index 0000000..9f722cc --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type.yaml @@ -0,0 +1,34 @@ + +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test custom type with an interface defined on it + +parameters: + install_path: + type: string + default: /home/custom/other +resources: + customwebserver_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver_create_config + input_values: + path: + get_param: install_path + server: + get_resource: server + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + customwebserver_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: install.sh + group: script +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_override.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_override.yaml new file mode 100644 index 0000000..24a2893 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_override.yaml @@ -0,0 +1,34 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test custom type with an interface defined on it, + and an interface overriding the type's one on the template itself + +parameters: + install_path: + type: string + default: /home/custom/other +resources: + customwebserver_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver_create_config + input_values: + path: + get_param: install_path + server: + get_resource: server + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + customwebserver_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: install_override.sh + group: script +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_param_override.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_param_override.yaml new file mode 100644 index 0000000..b166d7c --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_custom_type_with_param_override.yaml @@ -0,0 +1,34 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test custom type with an interface defined on it, + and an interface overriding the type's one on the template itself + +parameters: + install_path: + type: string + default: /home/custom/from/cli +resources: + customwebserver_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver_create_config + input_values: + path: + get_param: install_path + server: + get_resource: server + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + customwebserver_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: install_override.sh + group: script +outputs: {} \ No newline at end of file diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml new file mode 100644 index 0000000..a298745 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml @@ -0,0 +1,551 @@ +heat_template_version: 2013-05-23 + +description: > + This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash and + kibana each on a separate server with monitoring enabled for nodejs server where + a sample nodejs application is running. The rsyslog and collectd are installed + on a nodejs server. + +parameters: + github_url: + type: string + description: The URL to download nodejs. + default: http://github.com/paypal/rest-api-sample-app-nodejs.git + + my_cpus: + type: number + description: Number of CPUs for the server. + default: 4 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + + nodejs_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: nodejs_create_config + server: + get_resource: app_server + + nodejs_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: nodejs/create.sh + group: script + + paypal_pizzastore_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: paypal_pizzastore_configure_config + input_values: + github_url: + get_param: github_url + mongodb_ip: + get_attr: + - mongo_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - nodejs_create_deploy + - mongo_db_create_deploy + + paypal_pizzastore_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: nodejs/config.sh + group: script + + paypal_pizzastore_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: paypal_pizzastore_start_config + server: + get_resource: app_server + depends_on: + - paypal_pizzastore_configure_deploy + + paypal_pizzastore_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: nodejs/start.sh + group: script + + + mongo_dbms_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_create_config + server: + get_resource: mongo_server + + mongo_dbms_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/create.sh + group: script + + mongo_dbms_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_configure_config + input_values: + mongodb_ip: + get_attr: + - mongo_server + - networks + - private + - 0 + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_create_deploy + + mongo_dbms_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/config.sh + group: script + + mongo_dbms_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_start_config + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_configure_deploy + + mongo_dbms_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/start.sh + group: script + + mongo_db_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_db_create_config + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_start_deploy + + mongo_db_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/create_database.sh + group: script + + + app_collectd_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_create_config + server: + get_resource: app_server + depends_on: + - logstash_start_deploy + + app_collectd_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: collectd/create.sh + group: script + + app_collectd_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_configure_config + input_values: + logstash_ip: + get_attr: + - logstash_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - app_collectd_create_deploy + + app_collectd_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: collectd/config.py + group: script + + app_collectd_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_start_config + server: + get_resource: app_server + depends_on: + - app_collectd_configure_deploy + + app_collectd_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: collectd/start.sh + group: script + + app_collectd_logstash_connect_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_logstash_connect_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + app_collectd_logstash_connect_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/configure_collectd.py + group: script + + + app_rsyslog_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_create_config + server: + get_resource: app_server + depends_on: + - logstash_start_deploy + + app_rsyslog_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: rsyslog/create.sh + group: script + + app_rsyslog_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_start_config + server: + get_resource: app_server + depends_on: + - app_rsyslog_configure_deploy + + app_rsyslog_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: rsyslog/start.sh + group: script + + app_rsyslog_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_configure_config + input_values: + logstash_ip: + get_attr: + - logstash_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - app_rsyslog_create_deploy + + app_rsyslog_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: rsyslog/config.sh + group: script + + app_rsyslog_logstash_connect_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_logstash_connect_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + app_rsyslog_logstash_connect_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/configure_rsyslog.py + group: script + + + logstash_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_create_config + server: + get_resource: logstash_server + depends_on: + - elasticsearch_start_deploy + + logstash_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/create.sh + group: script + + logstash_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_start_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + logstash_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/start.sh + group: script + + logstash_elasticsearch_connect_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_elasticsearch_connect_config + input_values: + elasticsearch_ip: + get_attr: + - elasticsearch_server + - networks + - private + - 0 + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + logstash_elasticsearch_connect_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/configure_elasticsearch.py + group: script + + + elasticsearch_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: elasticsearch_create_config + server: + get_resource: elasticsearch_server + + elasticsearch_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: elasticsearch/create.sh + group: script + + elasticsearch_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: elasticsearch_start_config + server: + get_resource: elasticsearch_server + depends_on: + - elasticsearch_create_deploy + + elasticsearch_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: elasticsearch/start.sh + group: script + + + kibana_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: kibana_create_config + server: + get_resource: kibana_server + depends_on: + - elasticsearch_start_deploy + + kibana_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: kibana/create.sh + group: script + + kibana_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: kibana_configure_config + input_values: + elasticsearch_ip: + get_attr: + - elasticsearch_server + - networks + - private + - 0 + kibana_ip: + get_attr: + - kibana_server + - networks + - private + - 0 + server: + get_resource: kibana_server + depends_on: + - kibana_create_deploy + + kibana_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: kibana/config.sh + group: script + + kibana_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: kibana_start_config + server: + get_resource: kibana_server + depends_on: + - kibana_configure_deploy + + kibana_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: kibana/start.sh + group: script + + + app_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + mongo_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + logstash_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + elasticsearch_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + kibana_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + +outputs: + nodejs_url: + description: URL for the nodejs server, http://:3000 + value: + get_attr: + - app_server + - networks + - private + - 0 + + mongodb_url: + description: URL for the mongodb server. + value: + get_attr: + - mongo_server + - networks + - private + - 0 + + logstash_url: + description: URL for the logstash server. + value: + get_attr: + - logstash_server + - networks + - private + - 0 + + elasticsearch_url: + description: URL for the elasticsearch server. + value: + get_attr: + - elasticsearch_server + - networks + - private + - 0 + + kibana_url: + description: URL for the kibana server. + value: + get_attr: + - kibana_server + - networks + - private + - 0 + diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml new file mode 100644 index 0000000..5eb1701 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml @@ -0,0 +1,551 @@ +heat_template_version: 2013-05-23 + +description: > + This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash and + kibana each on a separate server with monitoring enabled for nodejs server where + a sample nodejs application is running. The rsyslog and collectd are installed + on a nodejs server. + +parameters: + github_url: + type: string + description: The URL to download nodejs. + default: http://github.com/paypal/rest-api-sample-app-nodejs.git + + my_cpus: + type: number + description: Number of CPUs for the server. + default: 4 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + + nodejs_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: nodejs_create_config + server: + get_resource: app_server + + nodejs_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/nodejs/create.sh + group: script + + paypal_pizzastore_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: paypal_pizzastore_configure_config + input_values: + github_url: + get_param: github_url + mongodb_ip: + get_attr: + - mongo_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - nodejs_create_deploy + - mongo_db_create_deploy + + paypal_pizzastore_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/nodejs/config.sh + group: script + + paypal_pizzastore_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: paypal_pizzastore_start_config + server: + get_resource: app_server + depends_on: + - paypal_pizzastore_configure_deploy + + paypal_pizzastore_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/nodejs/start.sh + group: script + + + mongo_dbms_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_create_config + server: + get_resource: mongo_server + + mongo_dbms_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/mongodb/create.sh + group: script + + mongo_dbms_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_configure_config + input_values: + mongodb_ip: + get_attr: + - mongo_server + - networks + - private + - 0 + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_create_deploy + + mongo_dbms_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/mongodb/config.sh + group: script + + mongo_dbms_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_start_config + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_configure_deploy + + mongo_dbms_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/mongodb/start.sh + group: script + + mongo_db_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_db_create_config + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_start_deploy + + mongo_db_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/mongodb/create_database.sh + group: script + + + app_collectd_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_create_config + server: + get_resource: app_server + depends_on: + - logstash_start_deploy + + app_collectd_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/collectd/create.sh + group: script + + app_collectd_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_configure_config + input_values: + logstash_ip: + get_attr: + - logstash_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - app_collectd_create_deploy + + app_collectd_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Python/collectd/config.py + group: script + + app_collectd_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_start_config + server: + get_resource: app_server + depends_on: + - app_collectd_configure_deploy + + app_collectd_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/collectd/start.sh + group: script + + app_collectd_logstash_connect_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_logstash_connect_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + app_collectd_logstash_connect_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Python/logstash/configure_collectd.py + group: script + + + app_rsyslog_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_create_config + server: + get_resource: app_server + depends_on: + - logstash_start_deploy + + app_rsyslog_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/rsyslog/create.sh + group: script + + app_rsyslog_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_start_config + server: + get_resource: app_server + depends_on: + - app_rsyslog_configure_deploy + + app_rsyslog_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/rsyslog/start.sh + group: script + + app_rsyslog_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_configure_config + input_values: + logstash_ip: + get_attr: + - logstash_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - app_rsyslog_create_deploy + + app_rsyslog_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/rsyslog/config.sh + group: script + + app_rsyslog_logstash_connect_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_rsyslog_logstash_connect_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + app_rsyslog_logstash_connect_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Python/logstash/configure_rsyslog.py + group: script + + + logstash_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_create_config + server: + get_resource: logstash_server + depends_on: + - elasticsearch_start_deploy + + logstash_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/logstash/create.sh + group: script + + logstash_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_start_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + logstash_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/logstash/start.sh + group: script + + logstash_elasticsearch_connect_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_elasticsearch_connect_config + input_values: + elasticsearch_ip: + get_attr: + - elasticsearch_server + - networks + - private + - 0 + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + logstash_elasticsearch_connect_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Python/logstash/configure_elasticsearch.py + group: script + + + elasticsearch_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: elasticsearch_create_config + server: + get_resource: elasticsearch_server + + elasticsearch_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/elasticsearch/create.sh + group: script + + elasticsearch_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: elasticsearch_start_config + server: + get_resource: elasticsearch_server + depends_on: + - elasticsearch_create_deploy + + elasticsearch_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/elasticsearch/start.sh + group: script + + + kibana_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: kibana_create_config + server: + get_resource: kibana_server + depends_on: + - elasticsearch_start_deploy + + kibana_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/kibana/create.sh + group: script + + kibana_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: kibana_configure_config + input_values: + elasticsearch_ip: + get_attr: + - elasticsearch_server + - networks + - private + - 0 + kibana_ip: + get_attr: + - kibana_server + - networks + - private + - 0 + server: + get_resource: kibana_server + depends_on: + - kibana_create_deploy + + kibana_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/kibana/config.sh + group: script + + kibana_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: kibana_start_config + server: + get_resource: kibana_server + depends_on: + - kibana_configure_deploy + + kibana_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/kibana/start.sh + group: script + + + app_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + mongo_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + logstash_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + elasticsearch_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + kibana_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + +outputs: + nodejs_url: + description: URL for the nodejs server, http://:3000 + value: + get_attr: + - app_server + - networks + - private + - 0 + + mongodb_url: + description: URL for the mongodb server. + value: + get_attr: + - mongo_server + - networks + - private + - 0 + + logstash_url: + description: URL for the logstash server. + value: + get_attr: + - logstash_server + - networks + - private + - 0 + + elasticsearch_url: + description: URL for the elasticsearch server. + value: + get_attr: + - elasticsearch_server + - networks + - private + - 0 + + kibana_url: + description: URL for the kibana server. + value: + get_attr: + - kibana_server + - networks + - private + - 0 + diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image.yaml new file mode 100644 index 0000000..da8285e --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image.yaml @@ -0,0 +1,18 @@ +heat_template_version: 2013-05-23 + +description: > + Template for deploying a server with custom properties for image, flavor and key_name. + +parameters: + key_name: + type: string + default: inputkey +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + key_name: {get_param: key_name} + user_data_format: SOFTWARE_CONFIG +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image_params.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image_params.yaml new file mode 100644 index 0000000..679461c --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_flavor_and_image_params.yaml @@ -0,0 +1,18 @@ +heat_template_version: 2013-05-23 + +description: > + Template for deploying a server with custom properties for image, flavor and key_name. + +parameters: + key_name: + type: string + default: paramkey +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + key_name: {get_param: key_name} + user_data_format: SOFTWARE_CONFIG +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world.yaml new file mode 100644 index 0000000..8cb4081 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: > + Template for deploying a single server with predefined properties. + +parameters: {} +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + user_data_format: SOFTWARE_CONFIG +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world_userkey.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world_userkey.yaml new file mode 100644 index 0000000..e5fadb0 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_hello_world_userkey.yaml @@ -0,0 +1,19 @@ +heat_template_version: 2013-05-23 + +description: > + Template for deploying a single server with predefined properties. + +parameters: + key_name: + type: string + default: userkey + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + key_name: { get_param: key_name } + user_data_format: SOFTWARE_CONFIG +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml new file mode 100644 index 0000000..33f3059 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml @@ -0,0 +1,135 @@ +heat_template_version: 2013-05-23 + +description: > + A template to test host assignment for translated hot resources. + It makes sure if a resource depends on multiple hosts only the + one with the "HostedOn" relationship is picked as the host. In + this template, the translated resource 'app_collectd_create_deploy' + would depend on 'logstash_server' and 'app_server'. But it would + have "HostedOn" relationship with 'app_server', and that server + would be its host. + +parameters: {} +resources: + app_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + logstash_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + app_collectd_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: collectd/create.sh + group: script + + app_collectd_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_create_config + server: + get_resource: app_server + depends_on: + - logstash_start_deploy + + app_collectd_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: collectd/config.py + group: script + + app_collectd_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_configure_config + input_values: + logstash_ip: + get_attr: + - logstash_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - app_collectd_create_deploy + + app_collectd_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: collectd/start.sh + group: script + + app_collectd_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_start_config + server: + get_resource: app_server + depends_on: + - app_collectd_configure_deploy + + logstash_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/create.sh + group: script + + logstash_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_create_config + server: + get_resource: logstash_server + + logstash_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/start.sh + group: script + + logstash_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: logstash_start_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + + app_collectd_logstash_connect_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: logstash/configure_collectd.py + group: script + + app_collectd_logstash_connect_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: app_collectd_logstash_connect_config + server: + get_resource: logstash_server + depends_on: + - logstash_create_deploy + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml new file mode 100644 index 0000000..2103d43 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml @@ -0,0 +1,35 @@ +heat_template_version: 2013-05-23 + +description: > + Template for deploying a single server with predefined properties. + +parameters: {} +resources: + VDU1: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + networks: + - port: { get_resource: CP1 } + user_data_format: SOFTWARE_CONFIG + CP1: + type: OS::Neutron::Port + properties: + fixed_ips: + - ip_address: '192.168.0.55' + network: { get_resource: VL1 } + VL1: + type: OS::Neutron::Net + VL1_subnet: + type: OS::Neutron::Subnet + properties: + ip_version: 4 + allocation_pools: + - end: 192.168.0.200 + start: 192.168.0.50 + gateway_ip: 192.168.0.1 + cidr: 192.168.0.0/24 + network: { get_resource: VL1 } +outputs: {} + diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml new file mode 100644 index 0000000..b95120b --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml @@ -0,0 +1,185 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with nodejs and mongodb. + +parameters: + github_url: + type: string + description: The URL to download nodejs. + default: http://github.com/paypal/rest-api-sample-app-nodejs.git + + my_cpus: + type: number + description: Number of CPUs for the server. + default: 4 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + mongo_dbms_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_create_config + server: + get_resource: mongo_server + + mongo_dbms_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/create.sh + group: script + + mongo_dbms_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_configure_config + input_values: + mongodb_ip: + get_attr: + - mongo_server + - networks + - private + - 0 + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_create_deploy + + mongo_dbms_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/config.sh + group: script + + mongo_dbms_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_dbms_start_config + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_configure_deploy + + mongo_dbms_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/start.sh + group: script + + mongo_db_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mongo_db_create_config + server: + get_resource: mongo_server + depends_on: + - mongo_dbms_start_deploy + + mongo_db_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mongodb/create_database.sh + group: script + + nodejs_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: nodejs_create_config + server: + get_resource: app_server + + nodejs_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: nodejs/create.sh + group: script + + paypal_pizzastore_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: paypal_pizzastore_configure_config + input_values: + github_url: http://github.com/paypal/rest-api-sample-app-nodejs.git + mongodb_ip: + get_attr: + - mongo_server + - networks + - private + - 0 + server: + get_resource: app_server + depends_on: + - mongo_db_create_deploy + - nodejs_create_deploy + + paypal_pizzastore_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: nodejs/config.sh + group: script + + paypal_pizzastore_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: paypal_pizzastore_start_config + server: + get_resource: app_server + depends_on: + - paypal_pizzastore_configure_deploy + + paypal_pizzastore_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: nodejs/start.sh + group: script + + mongo_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + app_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + +outputs: + mongodb_url: + description: URL for the mongodb server. + value: + get_attr: + - mongo_server + - networks + - private + - 0 + nodejs_url: + description: URL for the nodejs server, http://:3000 + value: + get_attr: + - app_server + - networks + - private + - 0 diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_policies.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_policies.yaml new file mode 100644 index 0000000..c7cfa44 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_policies.yaml @@ -0,0 +1,25 @@ +heat_template_version: 2013-05-23 + +description: > + Template for deploying the nodes based on given policies. + +parameters: {} + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + scheduler_hints: + group: + get_resource: my_compute_placement_policy + user_data_format: SOFTWARE_CONFIG + my_compute_placement_policy: + type: OS::Nova::ServerGroup + properties: + name: my_compute_placement_policy + policies: + - affinity + +outputs: {} \ No newline at end of file diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml new file mode 100644 index 0000000..8c10a93 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml @@ -0,0 +1,209 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with wordpress, web server and mysql on the same server. + +parameters: + db_name: + type: string + description: The name of the database. + default: wordpress + db_user: + type: string + description: The user name of the DB user. + default: wp_user + db_pwd: + type: string + description: The WordPress database admin account password. + default: wp_pass + cpus: + type: number + description: Number of CPUs for the server. + default: 8 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + db_root_pwd: + type: string + description: Root password for MySQL. + default: passw0rd + db_port: + type: number + description: Port for the MySQL database. + default: 3366 + +resources: + + mysql_dbms_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mysql/mysql_dbms_install.sh + group: script + + mysql_dbms_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_dbms_create_config + input_values: + db_root_password: + get_param: db_root_pwd + server: + get_resource: server + + mysql_dbms_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mysql/mysql_dbms_start.sh + group: script + + mysql_dbms_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_dbms_start_config + server: + get_resource: server + depends_on: + - mysql_dbms_configure_deploy + + mysql_dbms_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mysql/mysql_dbms_configure.sh + group: script + + mysql_dbms_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_dbms_configure_config + input_values: + db_port: 3366 + server: + get_resource: server + depends_on: + - mysql_dbms_create_deploy + + mysql_database_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mysql/mysql_database_configure.sh + group: script + + mysql_database_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_database_configure_config + input_values: + db_name: + get_param: db_name + db_password: + get_param: db_pwd + db_root_password: + get_param: db_root_pwd + db_user: + get_param: db_user + server: + get_resource: server + depends_on: + - mysql_dbms_start_deploy + + webserver_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: webserver/webserver_install.sh + group: script + + webserver_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: webserver_create_config + server: + get_resource: server + + webserver_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: webserver/webserver_start.sh + group: script + + webserver_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: webserver_start_config + server: + get_resource: server + depends_on: + - webserver_create_deploy + + wordpress_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: wordpress/wordpress_install.sh + group: script + + wordpress_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: wordpress_create_config + server: + get_resource: server + depends_on: + - webserver_start_deploy + - mysql_database_configure_deploy + + wordpress_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: wordpress/wordpress_configure.sh + group: script + + wordpress_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: wordpress_configure_config + input_values: + wp_db_name: + get_param: db_name + wp_db_password: + get_param: db_pwd + wp_db_user: + get_param: db_user + server: + get_resource: server + depends_on: + - wordpress_create_deploy + + server: + type: OS::Nova::Server + properties: + flavor: m1.xlarge + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + +outputs: + website_url: + description: URL for Wordpress wiki. + value: + get_attr: + - server + - networks + - private + - 0 diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml new file mode 100644 index 0000000..3598540 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml @@ -0,0 +1,207 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with wordpress, web server and mysql on the same server. + +parameters: + db_name: + type: string + description: The name of the database. + default: wordpress + db_user: + type: string + description: The user name of the DB user. + default: wp_user + db_pwd: + type: string + description: The WordPress database admin account password. + default: wp_pass + cpus: + type: number + description: Number of CPUs for the server. + default: 8 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + db_root_pwd: + type: string + description: Root password for MySQL. + default: passw0rd + db_port: + type: number + description: Port for the MySQL database. + default: 3366 + +resources: + + mysql_dbms_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/MYSQLDBMS/install.sh + group: script + + mysql_dbms_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_dbms_create_config + server: + get_resource: server + + mysql_dbms_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/MYSQLDBMS/start.sh + group: script + + mysql_dbms_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_dbms_start_config + server: + get_resource: server + depends_on: + - mysql_dbms_configure_deploy + + mysql_dbms_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/MYSQLDBMS/configure.sh + group: script + + mysql_dbms_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_dbms_configure_config + input_values: + db_root_password: + get_param: db_root_pwd + server: + get_resource: server + depends_on: + - mysql_dbms_create_deploy + + mysql_database_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/MYSQLDatabase/configure.sh + group: script + + mysql_database_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: mysql_database_configure_config + input_values: + db_name: + get_param: db_name + db_password: + get_param: db_pwd + db_root_password: + get_param: db_root_pwd + db_user: + get_param: db_user + server: + get_resource: server + depends_on: + - mysql_dbms_start_deploy + + webserver_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/WebServer/install.sh + group: script + + webserver_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: webserver_create_config + server: + get_resource: server + + webserver_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/WebServer/start.sh + group: script + + webserver_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: webserver_start_config + server: + get_resource: server + depends_on: + - webserver_create_deploy + + wordpress_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/WordPress/install.sh + group: script + + wordpress_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: wordpress_create_config + server: + get_resource: server + depends_on: + - webserver_start_deploy + - mysql_database_configure_deploy + + wordpress_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: ../Scripts/WordPress/configure.sh + group: script + + wordpress_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: wordpress_configure_config + input_values: + wp_db_name: + get_param: db_name + wp_db_password: + get_param: db_pwd + wp_db_user: + get_param: db_user + server: + get_resource: server + depends_on: + - wordpress_create_deploy + + server: + type: OS::Nova::Server + properties: + flavor: m1.xlarge + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + +outputs: + website_url: + description: IP address for Wordpress wiki. + value: + get_attr: + - server + - networks + - private + - 0 diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_object_store.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_object_store.yaml new file mode 100644 index 0000000..91491e3 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_object_store.yaml @@ -0,0 +1,21 @@ +heat_template_version: 2013-05-23 + +description: > + Tosca template for creating an object storage service. + +parameters: + objectstore_name: + type: string + default: myobjstore + +resources: + obj_store_server: + type: OS::Swift::Container + properties: + X-Container-Meta: + Quota-Bytes: 1000000000 + X-Container-Read: ".r:*" + name: + get_param: objectstore_name + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml new file mode 100644 index 0000000..5cffb43 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml @@ -0,0 +1,36 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile that just defines a single compute instance and selects a + (guest) host Operating System from the Compute node's properties. Note, this + example does not include default values on inputs properties. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + +outputs: + private_ip: + description: The private IP address of the deployed server instance. + value: + get_attr: + - my_server + - networks + - private + - 0 diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml new file mode 100644 index 0000000..1eb88a7 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml @@ -0,0 +1,36 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile that just defines a single compute instance and selects a + (guest) host Operating System from the Compute node's properties. Note, this + example includes default values on inputs properties. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + +outputs: + private_ip: + description: The private IP address of the deployed server instance. + value: + get_attr: + - my_server + - networks + - private + - 0 diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml new file mode 100644 index 0000000..4e7e6b5 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml @@ -0,0 +1,36 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile that just defines a single compute instance and selects a + (guest) host Operating System from the Compute node's properties. Note, this + example includes default values on inputs properties. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 4 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.large + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + +outputs: + private_ip: + description: The private IP address of the deployed server instance. + value: + get_attr: + - my_server + - networks + - private + - 0 diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_without_tosca_os_version.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_without_tosca_os_version.yaml new file mode 100644 index 0000000..d2828cf --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_without_tosca_os_version.yaml @@ -0,0 +1,17 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile that just defines a single compute instance and selects a + flavor and host Operating System for the Compute node. Note, this is just a test + template showing Compute without optional 'version' property of OS capability. + In general, you should have version to narrow down your image selection. + +parameters: {} +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + user_data_format: SOFTWARE_CONFIG +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_software_component.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_software_component.yaml new file mode 100644 index 0000000..b1bbe49 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_software_component.yaml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with a software component. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + my_software_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: my_software_create_config + server: + get_resource: server + + my_software_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: software_install.sh + group: script + + my_software_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: my_software_start_config + server: + get_resource: server + depends_on: + - my_software_create_deploy + + my_software_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: software_start.sh + group: script + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_web_application.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_web_application.yaml new file mode 100644 index 0000000..38f12e6 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_web_application.yaml @@ -0,0 +1,100 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with a web application. + +parameters: + context_root: + type: string + description: Context root for installing the application. + default: my_web_app + + cpus: + type: number + description: Number of CPUs for the server. + default: 2 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + +resources: + server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: ubuntu-software-config-os-init + user_data_format: SOFTWARE_CONFIG + + web_server_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: web_server_create_config + server: + get_resource: server + + web_server_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: web_server_install.sh + group: script + + web_server_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: web_server_start_config + server: + get_resource: server + depends_on: + - web_server_create_deploy + + web_server_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: web_server_start.sh + group: script + + web_app_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: web_app_create_config + input_values: + context_root: + get_param: context_root + server: + get_resource: server + depends_on: + - web_server_start_deploy + + web_app_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: web_app_install.sh + group: script + + web_app_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: web_app_start_config + server: + get_resource: server + depends_on: + - web_app_create_deploy + + web_app_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: web_app_start.sh + group: script + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_custom_network_nodes.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_custom_network_nodes.yaml new file mode 100644 index 0000000..556dcf4 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_custom_network_nodes.yaml @@ -0,0 +1,33 @@ +heat_template_version: 2013-05-23 + +description: > + Template for deploying a single server with predefined properties. + +parameters: {} +resources: + VDU1: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: rhel-6.5-test-image + networks: + - port: { get_resource: CP1 } + user_data_format: SOFTWARE_CONFIG + CP1: + type: OS::Neutron::Port + properties: + network: { get_resource: VL1 } + VL1: + type: OS::Neutron::Net + VL1_subnet: + type: OS::Neutron::Subnet + properties: + ip_version: 4 + allocation_pools: + - end: 192.168.0.200 + start: 192.168.0.50 + gateway_ip: 192.168.0.1 + cidr: 192.168.0.0/24 + network: { get_resource: VL1 } +outputs: {} + diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_one_network.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_one_network.yaml new file mode 100644 index 0000000..cfcd290 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_one_network.yaml @@ -0,0 +1,44 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with 1 server bound to a new network + +parameters: + network_name: + type: string + description: Network name + default: private_net + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: cirros-0.3.2-x86_64-uec + networks: + - port: { get_resource: my_port } + user_data_format: SOFTWARE_CONFIG + + my_network: + type: OS::Neutron::Net + properties: + name: + get_param: network_name + + my_network_subnet: + type: OS::Neutron::Subnet + properties: + allocation_pools: + - end: 192.168.0.200 + start: 192.168.0.50 + cidr: 192.168.0.0/24 + gateway_ip: 192.168.0.1 + ip_version: 4 + network: { get_resource: my_network } + + my_port: + type: OS::Neutron::Port + properties: + network: { get_resource: my_network } + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_three_networks.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_three_networks.yaml new file mode 100644 index 0000000..f8674e1 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_one_server_three_networks.yaml @@ -0,0 +1,71 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with 1 server bound to 3 networks + +parameters: {} + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: cirros-0.3.2-x86_64-uec + networks: + - port: { get_resource: my_port1 } + - port: { get_resource: my_port2 } + - port: { get_resource: my_port3 } + user_data_format: SOFTWARE_CONFIG + + my_network1: + type: OS::Neutron::Net + properties: + name: net1 + + my_network2: + type: OS::Neutron::Net + properties: + name: net2 + + my_network3: + type: OS::Neutron::Net + properties: + name: net3 + + my_network1_subnet: + type: OS::Neutron::Subnet + properties: + cidr: 192.168.1.0/24 + ip_version: 4 + network: { get_resource: my_network1 } + + my_network2_subnet: + type: OS::Neutron::Subnet + properties: + cidr: 192.168.2.0/24 + ip_version: 4 + network: { get_resource: my_network2 } + + my_network3_subnet: + type: OS::Neutron::Subnet + properties: + cidr: 192.168.3.0/24 + ip_version: 4 + network: { get_resource: my_network3 } + + my_port1: + type: OS::Neutron::Port + properties: + network: { get_resource: my_network1 } + + my_port2: + type: OS::Neutron::Port + properties: + network: { get_resource: my_network2 } + + my_port3: + type: OS::Neutron::Port + properties: + network: { get_resource: my_network3 } + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_server_on_existing_network.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_server_on_existing_network.yaml new file mode 100644 index 0000000..b8282b5 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_server_on_existing_network.yaml @@ -0,0 +1,27 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with 1 server bound to an existing network + +parameters: + network_name: + type: string + description: Network name + default: private_net + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: cirros-0.3.2-x86_64-uec + networks: + - port: { get_resource: my_port } + user_data_format: SOFTWARE_CONFIG + + my_port: + type: OS::Neutron::Port + properties: + network: {get_param: network_name} + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_two_servers_one_network.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_two_servers_one_network.yaml new file mode 100644 index 0000000..21157bb --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/network/hot_two_servers_one_network.yaml @@ -0,0 +1,72 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with 2 servers bound to the 1 network + +parameters: + network_name: + type: string + description: Network name + default: my_private_net + network_cidr: + type: string + description: CIDR for the network + default: 10.0.0.0/24 + network_start_ip: + type: string + description: Start IP for the allocation pool + default: 10.0.0.100 + network_end_ip: + type: string + description: End IP for the allocation pool + default: 10.0.0.150 + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: cirros-0.3.2-x86_64-uec + networks: + - port: { get_resource: my_port } + user_data_format: SOFTWARE_CONFIG + + my_server2: + type: OS::Nova::Server + properties: + flavor: m1.small + image: cirros-0.3.2-x86_64-uec + networks: + - port: { get_resource: my_port2 } + user_data_format: SOFTWARE_CONFIG + + my_network: + type: OS::Neutron::Net + properties: + name: + get_param: network_name + + my_network_subnet: + type: OS::Neutron::Subnet + properties: + allocation_pools: + - end: + get_param: network_end_ip + start: + get_param: network_start_ip + cidr: + get_param: network_cidr + ip_version: 4 + network: { get_resource: my_network } + + my_port: + type: OS::Neutron::Port + properties: + network: { get_resource: my_network } + + my_port2: + type: OS::Neutron::Port + properties: + network: { get_resource: my_network } + +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml new file mode 100644 index 0000000..5ff5382 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml @@ -0,0 +1,71 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with server and attached block storage using the normative + AttachesTo Relationship Type. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_location: + type: string + description: Block storage mount point (filesystem path). + default: /dev/vdc + storage_size: + type: number + description: Size of the storage to be created. + default: 2 + storage_snapshot_id: + type: string + description: "Optional identifier for an existing snapshot to use when creating storage." + default: ssid + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + attachesto_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_server + mountpoint: + get_param: storage_location + volume_id: + get_resource: my_storage + +outputs: + private_ip: + description: The private IP address of the newly created compute instance. + value: + get_attr: + - my_server + - networks + - private + - 0 + volume_id: + description: The volume id of the block storage instance. + value: + get_resource: my_storage diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml new file mode 100644 index 0000000..9ffaf23 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml @@ -0,0 +1,92 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with a Single Block Storage node shared by 2-Tier + Application with custom AttachesTo Type and implied relationships. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + storage_snapshot_id: + type: string + description: Optional identifier for an existing snapshot to use when creating storage. + default: ssid + +resources: + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + my_web_app_tier_1: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + myattachesto_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_1 + mountpoint: /default_location + volume_id: + get_resource: my_storage + + my_web_app_tier_2: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + myattachesto_2: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_2 + mountpoint: /some_other_data_location + volume_id: + get_resource: my_storage + +outputs: + private_ip_1: + description: The private IP address of the applications first tier. + value: + get_attr: + - my_web_app_tier_1 + - networks + - private + - 0 + private_ip_2: + description: The private IP address of the applications second tier. + value: + get_attr: + - my_web_app_tier_2 + - networks + - private + - 0 + volume_id: + description: The volume id of the block storage instance. + value: + get_resource: my_storage diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml new file mode 100644 index 0000000..9b5e71c --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml @@ -0,0 +1,92 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with a Single Block Storage node shared by 2-Tier + Application with custom AttachesTo Type and implied relationships. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + storage_snapshot_id: + type: string + description: Optional identifier for an existing snapshot to use when creating storage. + default: ssid + +resources: + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + my_web_app_tier_1: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + myattachesto_2: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_1 + mountpoint: /default_location + volume_id: + get_resource: my_storage + + my_web_app_tier_2: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + myattachesto_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_2 + mountpoint: /some_other_data_location + volume_id: + get_resource: my_storage + +outputs: + private_ip_1: + description: The private IP address of the applications first tier. + value: + get_attr: + - my_web_app_tier_1 + - networks + - private + - 0 + private_ip_2: + description: The private IP address of the applications second tier. + value: + get_attr: + - my_web_app_tier_2 + - networks + - private + - 0 + volume_id: + description: The volume id of the block storage instance. + value: + get_resource: my_storage diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml new file mode 100644 index 0000000..1b4eb73 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml @@ -0,0 +1,96 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with a single Block Storage node shared by 2-Tier + Application with custom AttachesTo Type and explicit Relationship Templates. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_location: + type: string + description: Block storage mount point (filesystem path). + default: /dev/vdc + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + storage_snapshot_id: + type: string + description: Optional identifier for an existing snapshot to use when creating storage. + default: ssid + +resources: + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + my_web_app_tier_1: + type: OS::Nova::Server + properties: + flavor: m1.small + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + storage_attachesto_1_2: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_1 + mountpoint: /my_data_location + volume_id: + get_resource: my_storage + + my_web_app_tier_2: + type: OS::Nova::Server + properties: + flavor: m1.small + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + storage_attachesto_2_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_2 + mountpoint: /some_other_data_location + volume_id: + get_resource: my_storage + +outputs: + private_ip_1: + description: The private IP address of the applications first tier. + value: + get_attr: + - my_web_app_tier_1 + - networks + - private + - 0 + private_ip_2: + description: The private IP address of the applications second tier. + value: + get_attr: + - my_web_app_tier_2 + - networks + - private + - 0 + volume_id: + description: The volume id of the block storage instance. + value: + get_resource: my_storage diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml new file mode 100644 index 0000000..0311a55 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml @@ -0,0 +1,96 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with a single Block Storage node shared by 2-Tier + Application with custom AttachesTo Type and explicit Relationship Templates. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_location: + type: string + description: Block storage mount point (filesystem path). + default: /dev/vdc + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + storage_snapshot_id: + type: string + description: Optional identifier for an existing snapshot to use when creating storage. + default: ssid + +resources: + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + my_web_app_tier_1: + type: OS::Nova::Server + properties: + flavor: m1.small + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + storage_attachesto_1_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_1 + mountpoint: /my_data_location + volume_id: + get_resource: my_storage + + my_web_app_tier_2: + type: OS::Nova::Server + properties: + flavor: m1.small + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + storage_attachesto_2_2: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_web_app_tier_2 + mountpoint: /some_other_data_location + volume_id: + get_resource: my_storage + +outputs: + private_ip_1: + description: The private IP address of the applications first tier. + value: + get_attr: + - my_web_app_tier_1 + - networks + - private + - 0 + private_ip_2: + description: The private IP address of the applications second tier. + value: + get_attr: + - my_web_app_tier_2 + - networks + - private + - 0 + volume_id: + description: The volume id of the block storage instance. + value: + get_resource: my_storage diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml new file mode 100644 index 0000000..bce4603 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml @@ -0,0 +1,72 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with server and attached block storage using a custom + AttachesTo Relationship Type. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_location: + type: string + description: Block storage mount point (filesystem path). + default: /dev/vdc + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + storage_snapshot_id: + type: string + description: Optional identifier for an existing snapshot to use when creating storage. + default: ssid + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + mycustomattachesto_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_server + volume_id: + get_resource: my_storage + mountpoint: + get_param: storage_location + + +outputs: + private_ip: + description: The private IP address of the newly created compute instance. + value: + get_attr: + - my_server + - networks + - private + - 0 + volume_id: + description: The volume id of the block storage instance. + value: + get_resource: my_storage diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml new file mode 100644 index 0000000..e17dff9 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml @@ -0,0 +1,65 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with server and attached block storage using a named + Relationship Template for the storage attachment. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_location: + type: string + description: Block storage mount point (filesystem path). + default: /dev/vdc + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + + storage_attachment_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_server + mountpoint: + get_input: storage_location + volume_id: + get_resource: my_storage + +outputs: + private_ip: + description: The private IP address of the newly created compute instance. + value: + get_attr: + - my_server + - networks + - private + - 0 + volume_id: + description: The volume id of the block storage instance. + value: + get_resource: my_storage diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml new file mode 100644 index 0000000..55ada08 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml @@ -0,0 +1,109 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with 2 servers each with different attached block storage. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_location: + type: string + description: Block storage mount point (filesystem path). + default: /dev/vdc + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + storage_snapshot_id: + type: string + description: Optional identifier for an existing snapshot to use when creating storage. + default: ssid + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + attachesto_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_server + mountpoint: + get_param: storage_location + volume_id: + get_resource: my_storage + + my_server2: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage2 + + my_storage2: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + attachesto_2: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_server2 + mountpoint: + get_param: storage_location + volume_id: + get_resource: my_storage2 + +outputs: + server_ip_1: + description: The private IP address of the applications first server. + value: + get_attr: + - my_server + - networks + - private + - 0 + server_ip_2: + description: The private IP address of the applications second server. + value: + get_attr: + - my_server2 + - networks + - private + - 0 + volume_id_1: + description: The volume id of the first block storage instance. + value: + get_resource: my_storage + volume_id_2: + description: The volume id of the second block storage instance. + value: + get_resource: my_storage2 diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml new file mode 100644 index 0000000..3386d79 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml @@ -0,0 +1,109 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA simple profile with 2 servers each with different attached block storage. + +parameters: + cpus: + type: number + description: Number of CPUs for the server. + default: 1 + constraints: + - allowed_values: + - 1 + - 2 + - 4 + - 8 + storage_location: + type: string + description: Block storage mount point (filesystem path). + default: /dev/vdc + storage_size: + type: number + description: Size of the storage to be created. + default: 1 + storage_snapshot_id: + type: string + description: Optional identifier for an existing snapshot to use when creating storage. + default: ssid + +resources: + my_server: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage + + my_storage: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + attachesto_2: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_server + mountpoint: + get_param: storage_location + volume_id: + get_resource: my_storage + + my_server2: + type: OS::Nova::Server + properties: + flavor: m1.medium + image: fedora-amd64-heat-config + user_data_format: SOFTWARE_CONFIG + depends_on: + - my_storage2 + + my_storage2: + type: OS::Cinder::Volume + properties: + size: + get_param: storage_size + snapshot_id: + get_param: storage_snapshot_id + + attachesto_1: + type: OS::Cinder::VolumeAttachment + properties: + instance_uuid: + get_resource: my_server2 + mountpoint: + get_param: storage_location + volume_id: + get_resource: my_storage2 + +outputs: + server_ip_1: + description: The private IP address of the applications first server. + value: + get_attr: + - my_server + - networks + - private + - 0 + server_ip_2: + description: The private IP address of the applications second server. + value: + get_attr: + - my_server2 + - networks + - private + - 0 + volume_id_1: + description: The volume id of the first block storage instance. + value: + get_resource: my_storage + volume_id_2: + description: The volume id of the second block storage instance. + value: + get_resource: my_storage2 -- cgit 1.2.3-korg