Skip to content

Instantly share code, notes, and snippets.

@alexcos78
Created January 31, 2021 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexcos78/42419c20ce0f993dfb14e347086584ee to your computer and use it in GitHub Desktop.
Save alexcos78/42419c20ce0f993dfb14e347086584ee to your computer and use it in GitHub Desktop.
2021-01-31 00:44:48,996 - InfrastructureManager - DEBUG - TOSCA: tosca_definitions_version: tosca_simple_yaml_1_0
metadata:
template_name: template
template_version: 1.0.0-SNAPSHOT
template_author: orchestrator
description: "Launch a compute node getting the IP and SSH credentials to access via ssh"
imports:
- indigo_custom_types: https://raw.githubusercontent.com/indigo-dc/tosca-types/master/custom_types.yaml
topology_template:
inputs:
num_cpus:
type: integer
required: true
default: 1
constraints:
- valid_values: [1, 2, 4]
description: "Number of virtual cpus for the VM"
mem_size:
type: scalar-unit.size
required: true
default: "2 GB"
constraints:
- valid_values: ["2 GB", "4 GB"]
description: "Amount of memory for the VM"
num_instances:
type: integer
required: true
default: 1
description: "Number of VMs to be spawned"
os_distribution:
type: string
required: true
default: ubuntu
constraints:
- valid_values: [ubuntu, centos]
description: "Operating System distro - valid values ubuntu, centos"
os_version:
type: version
required: true
default: 16.04
constraints:
- valid_values: [16.04, 7]
description: "Operating System distribution version"
node_templates:
simple_node:
type: tosca.nodes.indigo.Compute
properties:
os_users: []
capabilities:
scalable:
properties:
min_instances: 1
max_instances: 1
count: 1
os:
properties:
distribution: ubuntu
version: 16.04
image: "ost://cloud-api-pub.cr.cnaf.infn.it/94a76d1e-cacb-48ce-ad69-c0b26fd9bb53"
endpoint:
properties:
private_ip: true
protocol: tcp
secure: false
network_name: PUBLIC
initiator: source
host:
properties:
num_cpus: 1
mem_size: "2 GB"
instance_type: "iotwins.small"
artifacts:
os_users_role:
file: indigo-dc.os_users
type: tosca.artifacts.AnsibleGalaxy.role
policies:
- deploy_on_specific_site:
type: tosca.policies.indigo.SlaPlacement
properties:
sla_id: 6013f27e0cd218be4664cb43
outputs:
node_creds:
value: { get_attribute: [ simple_node, endpoint, credential, 0 ] }
node_ip:
value: { get_attribute: [ simple_node, public_address, 0 ] }
2021-01-31 00:44:50,553 - InfrastructureManager - WARNING - Policy tosca.policies.indigo.SlaPlacement not supported. Ignoring it.
2021-01-31 00:44:50,553 - InfrastructureManager - DEBUG - User requested 1 instances of type simple_node and there are 0
2021-01-31 00:44:50,553 - InfrastructureManager - WARNING - Policy tosca.policies.indigo.SlaPlacement not supported. Ignoring it.
2021-01-31 00:44:50,905 - InfrastructureManager - INFO - Creating new Inf ID: 86c0700e-635d-11eb-94be-0242ac110004
2021-01-31 00:44:50,905 - InfrastructureManager - DEBUG - Inf ID: 86c0700e-635d-11eb-94be-0242ac110004 created Async.
2021-01-31 00:44:50,909 - InfrastructureManager - INFO - Inf ID:86c0700e-635d-11eb-94be-0242ac110004: Successfully created
2021-01-31 00:44:51,082 - InfrastructureManager - INFO - Adding resources to Inf ID: 86c0700e-635d-11eb-94be-0242ac110004
2021-01-31 00:44:51,102 - InfrastructureManager - DEBUG - Inf ID: 86c0700e-635d-11eb-94be-0242ac110004:
network private_net ( outbound = 'no' )
network public_net ( outbound = 'yes' )
system simple_node (
instance_name = 'simple_node' and
disk.0.os.flavour = 'ubuntu' and
disk.0.os.version = '16.04' and
disk.0.image.url = 'ost://cloud-api-pub.cr.cnaf.infn.it/94a76d1e-cacb-48ce-ad69-c0b26fd9bb53' and
cpu.count >= 1 and
memory.size >= 2000000000B and
instance_type = 'iotwins.small' and
disk.0.applications contains (name = 'ansible.modules.indigo-dc.os_users') and
net_interface.0.connection = 'private_net' and
net_interface.1.connection = 'public_net'
)
configure simple_node_conf (
@begin
---
- roles:
- role: indigo-dc.os_users
vars:
os_users: []
@end
)
contextualize (
system simple_node configure simple_node_conf step 1
)
deploy simple_node 1
2021-01-31 00:44:57,428 - InfrastructureManager - INFO - Getting state of the Inf ID: 86c0700e-635d-11eb-94be-0242ac110004
2021-01-31 00:44:57,448 - InfrastructureManager - INFO - Inf ID: 86c0700e-635d-11eb-94be-0242ac110004 is in state: pending
2021-01-31 00:45:38,983 - InfrastructureManager - INFO - Getting state of the Inf ID: 86c0700e-635d-11eb-94be-0242ac110004
2021-01-31 00:45:39,003 - InfrastructureManager - INFO - Inf ID: 86c0700e-635d-11eb-94be-0242ac110004 is in state: pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment