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: ''
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:
- 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. - 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:
- Instantiating a VNF.
- Scaling or scaling to level a VNF.
Scaling VDUs with Instance Count is applicable only to VNFs.