You can perform the following advanced operations with vRealize Orchestrator Workflows.

Referencing Default Values Using the get_attribute Method

You can use get_attribute to get the attribute values of each VDU from the JSON file that you upload when designing a Network Function. In a scenario where you create multiple VDUs, each VDU requires a different IP address and a host name. You can parameterize these values in the OVF Properties tab using the get_attribute method. For example, to get the host name for each VDU, add the following command in the Default column when configuring the OVF properties of the VDU.
get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU1-HOSTNAME)

In this command, VMware Telco Cloud Automation checks for those VNF instances that are in the pre-instantiation state and populates their host names.

You can add the get_attribute method in the OVF Properties tab when designing a Network Function Descriptor. For information about designing a Network Function Descriptor, see Designing a Network Function Descriptor.

To view the Workflow reference, go to Catalog > Network Function, click the network function, and click the Metadata tab.

Examples
The following example is a snippet of a pre-instantiation workflow in the TOSCA YAML file:
interfaces:
      Vnflcm:
        instantiate_start:
          implementation: ../Artifacts/workflows/get-env-details.json
          description: Hostname and IP per environment
          inputs:
            type: tosca.datatypes.nfv.VMware.Interface.InstantiateStartInputParameters
            ENVIRONMENT: RDC
          outputs:
            type: tosca.datatypes.nfv.VMware.Interface.InstantiateStartOutputParameters
            VDU1_HOSTNAME: ''
            VDU1_IP: ''
            VDU2_HOSTNAME: ''
            VDU2_IP: ''
            VDU3_HOSTNAME: ''
            VDU3_IP: ''
The following example is a snippet of the VMware Telco Cloud Automation - Workflow JSON file:
{
  "id":"generate-hostnames-and-ips",
  "name": "Generate Hostnames and IPs",
  "description":"Hostname and IP per environment",
  "version":"1.0",
  "startStep":"step0",
  "variables": [
    {"name":"vnfId", "type": "string"}
  ],
  "input": [
    {"name": "ENVIRONMENT", "description": "Deployment Environment", "type": "string", "default": "CDC"}
  ],
  "output": [
    {"name":"VDU1_HOSTNAME", "description": "VDU1 Hostname", "type": "string"},
    {"name":"VDU1_IP", "description": "VDU1 IP Address", "type": "string"},
    {"name":"VDU2_HOSTNAME", "description": "VDU2 Hostname", "type": "string"},
    {"name":"VDU2_IP", "description": "VDU2 IP Address", "type": "string"},
    {"name":"VDU3_HOSTNAME", "description": "VDU3 Hostname", "type": "string"},
    {"name":"VDU3_IP", "description": "VDU3 IP Address", "type": "string"}
  ],
  "steps":[
    {
      "stepId":"step0",
      "workflow":"VRO_CUSTOM_WORKFLOW",
      "namespace": "nfv",
      "type":"task",
      "description": "Get Environment Details",
      "inBinding":[
         {"name": "vroWorkflowName", "type": "string", "default": "Get-Environment-Details"},
		 {"name": "envName", "type": "string", "exportName": "ENVIRONMENT"}
      ],
      "outBinding": [
         {"name": "vdu1_hostname", "type": "string", "exportName": "VDU1_HOSTNAME"},
         {"name": "vdu1_ip", "type": "string", "exportName": "VDU1_IP"},
         {"name": "vdu2_hostname", "type": "string", "exportName": "VDU2_HOSTNAME"},
         {"name": "vdu2_ip", "type": "string", "exportName": "VDU2_IP"},
         {"name": "vdu3_hostname", "type": "string", "exportName": "VDU3_HOSTNAME"},
         {"name": "vdu3_ip", "type": "string", "exportName": "VDU3_IP"}
      ],
      "nextStep":"END"
    }
  ]
}
The following example is a snippet of how VMware Telco Cloud Automation uses the variables from the instantiate_start workflow as reference within the TOSCA YAML file:
vdu1:
      type: tosca.nodes.nfv.Vdu.Compute.vdu1
      properties:
        name: vdu1
        ...
        configurable_properties:
          additional_vnfc_configurable_properties:
            type: tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties.vdu1
            hostname: get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU1_HOSTNAME)
            ip.0: get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU1_IP)
      ...
    vdu2:
      type: tosca.nodes.nfv.Vdu.Compute.vdu2
      properties:
        name: vdu2
        ...
        configurable_properties:
          additional_vnfc_configurable_properties:
            type: tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties.vdu2
            hostname: get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU2_HOSTNAME)
            ip.0: get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU2_IP)
      ...
    vdu3:
      type: tosca.nodes.nfv.Vdu.Compute.vdu3
      properties:
        name: vdu3
        ...
        configurable_properties:
          additional_vnfc_configurable_properties:
            type: tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties.vdu3
            hostname: get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU3_HOSTNAME)
            ip.0: get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU3_IP)

Referencing default values using the get_attribute method is applicable to VNFs and CNFs.

Scaling VDUs with Instance Count

Take a scenario where you want to scale a VDU to five instances. OVF properties such as Host Name and IP address that are assigned must be different for each of these VDUs. To ensure that unique OVF properties are assigned to each of the VDUs, you can use the INSTANCE_COUNT variable in the following ways:
  1. INSTANCE_COUNT in references or variables - If you have a pre-instantiated workflow that generates OVF properties such as host name for each VDU instance, you can reference it using the following command.
    get_attribute(self.interfaces.Vnflcm.instantiate_start.outputs.VDU-HOSTNAME-{{INSTANCE_COUNT}})
    In this command, VMware Telco Cloud Automation replaces INSTANCE_COUNT with the corresponding instance count of the VDU.
  2. Use INSTANCE_COUNT directly in OVF Properties - If you have defined the OVF properties and want the host names and IP addresses to increase by one based on the number of scale instances, use the following command.
    hostname: centos-{{INSTANCE_COUNT}}
    ipAddress: 192.168.10.{{INSTANCE_COUNT}}
    When the VDU is deployed or scaled, the actual instance number replaces INSTANCE_COUNT. The values of the hostname and IP address in the OVF properties are updated to:
    Instance 1
    hostname: centos-1
    ipAddress: 192.168.10.1
    Instance 2
    hostname: centos-2
    ipAddress: 192.168.10.2
    Instance 3
    hostname: centos-3
    ipAddress: 192.168.10.3
    Instance 4
    hostname: centos-4
    ipAddress: 192.168.10.4
    Instance 5
    hostname: centos-5
    ipAddress: 192.168.10.5
Note:
You can add the INSTANCE_COUNT reference on OVF properties when performing the following operations:
  1. Instantiating a VNF.
  2. Scaling or scaling to level a VNF.

Scaling VDUs with Instance Count is applicable only to VNFs.