VMware Aria Automation Tools

 View Only
  • 1.  Cloud Template with a dynamic number of networks in Aria Automation 8.18.1

    Posted Dec 11, 2024 11:21 AM
    Hi everyone,
     
    Some time ago, I implemented a cloud template that allowed configuring the number of VM networks dynamically. I used the following post as a guide: https://ssh.guru/posts/230413-vra8-choosing-nic-number/.
     
    This cloud template worked in Aria Automation 8.14 and 8.16.2; however, after upgrading to 8.18.1, it stopped working.
     
    The Cloud_vSphere_Machine object in the canvas now shows the following warning:
     
    Cloud_vSphere_Machine_1.properties.networks: The entries under the networks array must reference either clustered or non-clustered resources only. You can either use the map_to_object expression or add count: 1 to convert a non-clustered to a clustered resource, or you can remove the count to convert a clustered resource to non-clustered.
     
    When I attempt to deploy using the cloud template, I receive the following error:
     
    Cannot deserialize value of type ArrayList<string> from Array value (token JsonToken.START_ARRAY) at [source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: com.vmware.admiral.compute.content.TemplateComputeDescription["networks"]->ArrayList[0])
     
    Additionally, when I edit the cloud template after the failed deployment, I see that the networks attribute is now an array like the one in the following image:
    I found a related KB article about this issue: https://knowledge.broadcom.com/external/article/371106/the-entries-under-the-networks-array-mus.html, but the proposed solution does not work for me.
     
    Has anyone encountered this issue? Is there another way to implement dynamic network creation?
     
    Best regards, and thanks.


  • 2.  RE: Cloud Template with a dynamic number of networks in Aria Automation 8.18.1

    Broadcom Employee
    Posted Jan 10, 2025 01:51 PM

    Could you review Lucho's blog post here? https://luchodelorenzi.com/2021/09/09/configuring-a-dynamic-multi-nic-cloud-template-in-vra-8-x/




  • 3.  RE: Cloud Template with a dynamic number of networks in Aria Automation 8.18.1

    Posted Feb 10, 2025 11:08 AM

    Hi, I'm on the same situation as you. Did you find any solution to the problem?




  • 4.  RE: Cloud Template with a dynamic number of networks in Aria Automation 8.18.1
    Best Answer

    Posted Feb 11, 2025 04:24 AM

    Hi Alvaro,

    You need to add count atribute set to 1 in all networks objects that will always be present. Here is an example:

    Cloud_vSphere_Network_0:
        type: Cloud.vSphere.Network
        properties:
          networkType: existing
          deviceIndex: 0
          count: 1
          constraints:
            - tag: network:${input.network-1}
      Cloud_vSphere_Network_1:
        type: Cloud.vSphere.Network
        properties:
          networkType: existing
          deviceIndex: 1
          count: ${to_lower(input.network-2) == 'none' ? 0:1}
          constraints:
            - tag: network:${input.network-2}
      Cloud_vSphere_Network_2:
        type: Cloud.vSphere.Network
        properties:
          networkType: existing
          deviceIndex: 2
          count: ${to_lower(input.network-3) == 'none' ? 0:1}
          constraints:
            - tag: network:${input.network-3}

    This solution worked for me.

    Regards,




  • 5.  RE: Cloud Template with a dynamic number of networks in Aria Automation 8.18.1

    Posted Feb 11, 2025 04:48 AM
    Edited by Alvaro Leon Murillo Feb 11, 2025 05:25 AM

    Thanks, that removed the warning from my Cloud Template, but I still get the same "cannot deserialize" error when trying to deploy a VM...

    Did you change anything on the "networks" property of the VM resource? After the upgrade it transformed into an array, same as the picture you included in your original post

    EDIT: I changed the "networks" property back to how it was previous to the upgrade and now it works, thank you very much!!




  • 6.  RE: Cloud Template with a dynamic number of networks in Aria Automation 8.18.1

    Posted Feb 11, 2025 09:43 AM
    Edited by DizzyMurloc Feb 11, 2025 09:43 AM

    Hi Álvaro,

    No, I didn't change anything in the network property. Here's what I currently have:

    networks: ${map_by(resource.Cloud_vSphere_Network_0[*].* + resource.Cloud_vSphere_Network_1[*].* + resource.Cloud_vSphere_Network_2[*].*, net => {"network":net.id, "deviceIndex":net.deviceIndex, "assignment":"static", "domain":input.domain})}

    You don't need to define the network property as an array, because the map_by() function automatically converts it into an array during deserialization.

    Regards,