VMware Cloud Community
DavidCsv
Contributor
Contributor

cloud network resource name overwrite the custom name

Hi

My network profile is set for one of the Azure VNET's subnet

Below are the yml code,  I want the name specified under properties to be used as resource name of the NIC(network) created on Azure

But everytime, it creates as the subnet name+'_unique string' on azure.

Is there any way to overwrite and use the name under properties?

resources:

  Cloud_Network_1:

    type: Cloud.Network

    properties:

      networkType: existing

      name: '${input.Hostname + "nic01"}'

      tags: '${input.Tags}'

      constraints:

        - tag: '${input.Cloud}'

        - tag: '${input.Region}'

        - tag: '${input.Environment}'

        - tag: '${input.Tenant}'

        - tag: '${input.Tier}'

Thanks

0 Kudos
2 Replies
xian_
Expert
Expert

According to the deployment API the property name should be "resourceName" but it does not seem to be passed to Azure. Tried with 

azurevm:
  type: Cloud.Azure.Machine
  properties:
  count: '${input.count}'
  image: rhel7
  flavor: small
  resourceGroupName: vra8
  networks:
    - network: '${resource.azurenetwork.id}'
      assignPublicIpAddress: false
      name: mynicname
      resourceName: 'myresname'

Result:

$ curl -s -k -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" 'https://vra8.corp.local/deployment/api/deployments/6d6ac153-d5cf-455a-b336-72efd5b22f47/resources/3d...' | jq .properties.networks

[
{
"id": "/resources/network-interfaces/086da1a6-20d6-41d6-a69d-06d2d05a4bd5",
"name": "mynicname",
"address": "192.168.8.4",
"network": "/provisioning/resources/compute-networks/1a233e65-7ab9-43e7-b0a4-ceb645053822",
"assignment": "dynamic",
"deviceIndex": 0,
"resourceName": "subnet1_wSRrQSFh",
"assignPublicIpAddress": false
}
]

Only vRA internal name used:

xian__0-1617708431262.png

 

 

 

 

0 Kudos
xian_
Expert
Expert

vRA 8.5 provides a new IaaS API that allows custom naming of NICs. I wrote a vRO workflow to update the name, but you could use ABX as well if you prefer.

See Rename Azure NIC in vRA8 blog post.

0 Kudos