tliron / puccini

Cloud topology management and deployment tools based on TOSCA
https://puccini.cloud
Apache License 2.0
88 stars 20 forks source link

Incorrect Type URI for BlockStorage node type #105

Closed philippemerle closed 2 years ago

philippemerle commented 2 years ago

For the following service template

tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
  node_templates:
    storage1:
      type: BlockStorage # Shorthand Name
      properties:
        name: storage1
    storage2:
      type: tosca.nodes.Storage.BlockStorage # Correct Type URI
      properties:
        name: storage2
    storage3:
      type: tosca.nodes.BlockStorage # Undefined Type URI!
      properties:
        name: storage3

puccini raises an error

$ puccini-tosca puccini-blockstorage.yaml 
PROBLEMS (1)
  file:/.../puccini-blockstorage.yaml
    @10,7 topology_template.node_templates["storage2"].type: reference to unknown node type: tosca.nodes.Storage.BlockStorage

According to Section 5.9.11 of TOSCA 1.3, tosca.nodes.Storage.BlockStorage is a correct Type URI. tosca.nodes.BlockStorage is not defined in TOSCA 1.3.

The issue seems to come from https://github.com/tliron/puccini/blob/main/assets/tosca/profiles/simple/1.3/nodes.yaml. tosca.nodes.BlockStorage shall be replaced by tosca.nodes.Storage.BlockStorage. Note that tosca.nodes.ObjectStorage shall be replaced by tosca.nodes.Storage.ObjectStorage according to Section 5.9.10 of TOSCA 1.3.

tliron commented 2 years ago

Thank you for this. Apparently the change happened in TOSCA 1.1 and I missed it...

By the way, I am certain there is an error in the "Shorthand Name" and "Type Qualified Name" for these. It says "tosca:BlockStorage". However, if we are consistent with other changes in the spec, it should be "tosca:Storage.BlockStorage". I believe this was an omission when they made the change in TOSCA 1.1. See, for example, "tosca:Container.Runtime". For Puccini I have decided to use a heuristic for calculating the shorthand and type qualified name and so I am using "Storage.BlockStorage".