Tacker need to create the flavor with these properties. But a few unknowns in this spec:
1)What if the user specify only one property like "num_cpus"? Do we need to provide default values to other properties or raise an error?
2)Syntax to specify the memory unit. For example disk size is always in GB, so just provide number instead <num><unit>?. But if we want to use this approach, the TOSCA template become openstack biased. So I prefer to use <num><unit>. And allow specific units to limit.
3)If the user specify both 'instance_type' and 'properties' in VNFD, do we need to go with 'instance_type' or 'properties'?
And coming to implementation, I think we need a novaclient in tacker. Using novaclient we need to create a flavor. Life cycle of tacker created flavor is same as VNFD associated with it. We can have DB migration to store flavor name/ID in and 'devicetemplateattributes' table or we can add flavor name to template itself.
Currently users specify the flavor name in VNFD using 'instance_type' attribute. For example:
vdus: 0.3.4-x86_ 64-uec
vdu1:
id: vdu1
vm_image: cirros-
instance_type: m1.tiny
But if the user specify the VDU properties like:
vdus: 0.3.4-x86_ 64-uec
vdu1:
id: vdu1
vm_image: cirros-
properties:
num_cpus: 1
disk_size: 10 GB
mem_size: 1024 MB
Tacker need to create the flavor with these properties. But a few unknowns in this spec:
1)What if the user specify only one property like "num_cpus"? Do we need to provide default values to other properties or raise an error?
2)Syntax to specify the memory unit. For example disk size is always in GB, so just provide number instead <num><unit>?. But if we want to use this approach, the TOSCA template become openstack biased. So I prefer to use <num><unit>. And allow specific units to limit.
3)If the user specify both 'instance_type' and 'properties' in VNFD, do we need to go with 'instance_type' or 'properties'?
And coming to implementation, I think we need a novaclient in tacker. Using novaclient we need to create a flavor. Life cycle of tacker created flavor is same as VNFD associated with it. We can have DB migration to store flavor name/ID in and 'devicetemplate attributes' table or we can add flavor name to template itself.