7 Replies Latest reply on Jul 7, 2020 1:05 AM by mmonkman

    vRA8 disk and nic count

    dbis7575 Enthusiast

      I am trying to create a vRA8 blueprint in which I can select either (1 or 2) NIC's and have the option to add additional drives to a blueprint.  Requests will be consumed through the API, not through Service Broker.

       

      I was hoping the "count" property for the disks or network cards could help, but I get errors during deployment if I try to use them.

       

      Is there another way to add a NIC or drive through an ABX action prior to allocation? Any recommendations are greatly appreciated.

        • 1. Re: vRA8 disk and nic count
          thegrumpyengineer Novice

          The count property does work within a blueprint. I have a couple of custom inputs where the user inputs the number and size of additional disks and it builds.

           

          The key bits of the blueprint are as follows:

           

          inputs:

            additionalDiskCount:

              type: integer

              title: Additional Disk Count

            additionalDiskSize:

              type: integer

              title: Additional Disk Size (GB))

          resources:

            demo-machine:

              type: Cloud.vSphere.Machine

              properties:

                name: demo-machine

                customizationSpec: Linux_Custom_Spec

                count: '${input.instances}'

                resourceGroupName: '${"VRM/" + to_upper(env.projectName)}'

                attachedDisks: '${map_to_object(resource.Cloud_vSphere_Disk_1[*].id, "source")}'

                networks:

                  - network: '${resource.Cloud_vSphere_Network_1.id}'

                tags:

                  - key: Backup

                    value: '${input.backupLevel}'

            Cloud_vSphere_Disk_1:

              type: Cloud.vSphere.Disk

              properties:

                capacityGb: '${input.additionalDiskSize}'

                count: '${input.additionalDiskCount}'

                name: Disk_XXX

                provisioningType: thin

           

          Hope it helps!

          1 person found this helpful
          • 2. Re: vRA8 disk and nic count
            dbis7575 Enthusiast

            This gets me a little bit further, but I want to get to the option where we have additional drives of different sizes and either 1 or 2 network interfaces on different networks.

             

            A couple of things I notices:

            1. I copied the syntax from your example and it did not work. If I first create a disk or network object and add the count parameter before linking it to the machine it works even tough the syntax is the same.

            2. If I create multiple disk or network objects that have a count property, I am only able to link one of them through the canvas and have not been able to get any yaml code working to get around this.

            • 3. Re: vRA8 disk and nic count
              okeedokee Enthusiast

                Cloud_vSphere_Disk_1:

                  type: Cloud.vSphere.Disk

                  properties:

                    capacityGb: '${input.additionalDiskSize}'

                    count: '${input.additionalDiskCount}'

                    name: Disk_XXX

                    provisioningType: thin

              How do you get this to iterdate through the number of disks specified?

               

              Disk_XXX

              • 4. Re: vRA8 disk and nic count
                dbis7575 Enthusiast

                I did get an answer from VMWare engineering that resolves this issue for the disk count. You would create your disks with a count property, but you do not link them through the canvas instead add the following to your machine properties (below example is for two additional drives):

                 

                attachedDisks: '${map_to_object(resource.Cloud_vSphere_Disk_1[*].id + resource.Cloud_vSphere_Disk_2[*].id, "source")}'

                 

                This syntax works fine with a count of 0 or 1 but not for counts larger, but this is all I need for my use case.

                 

                 

                Similar syntax works for network resources with a count property, but it is not very useful as the following dos not work:

                - Cannot apply a constraint tag to the network resource (no error if the constraint tags are the same on all resources, but the deployment will show an error that the resources are missing even tough the machine gets build correctly)

                - Cannot specify network profile within the machine properties

                - Cannot specify static assignment for the network resources within the machine properties.

                 

                • 5. Re: vRA8 disk and nic count
                  dbis7575 Enthusiast

                  A little progress, the option to select networks is functional by using constraint tags. I was using networks from different network profiles and this is an issue listed in the 8.0.1 release notes. This means that if you have multiple networks on a machine, they all need to be part of the same network profile.

                   

                  Still trying to get the static assignment to work using the integrated IPAM but haven't found any functional syntax yet.

                   

                  In order to add multiple NICs with count property use the following syntax:

                   

                  networks: '${map_to_object(resource.Cloud_vSphere_Network_1[*].id + resource.Cloud_vSphere_Network_2[*].id, "network")}'

                  • 6. Re: vRA8 disk and nic count
                    itrudeau Novice

                    Hello Dbis7575.

                     

                    I have try the networks: '${map_to_object(resource.Cloud_vSphere_Network_1[*].id + resource.Cloud_vSphere_Network_2[*].id, "network")}' for dynamic network assignment.

                     

                    The Yaml code seams to be fine but I got error at the deployment provisionning network layer.

                    Create Failed - com.vmware.xenon.common.ServiceHost$ServiceNotFoundException: Service not found: http://XX.XX.XX.XX:8282/provisioning/resources/compute-networks/3c148adf-556e-427f-ae19-7d8bdebe9db5

                     

                    Here the code I have:

                     

                    # Created by Quickstart wizard.

                    formatVersion: 1

                    inputs:

                      netCount:

                        type: integer

                        default: 1

                        minimum: 1

                        maximum: 6

                      network:

                        type: string

                        default: null

                      network2:

                        type: string

                        default: null

                      network3:

                        type: string

                        default: null

                      network4:

                        type: string

                        default: null

                     

                    resources:

                     

                    Cloud_vSphere_Network_1:

                        type: Cloud.vSphere.Network

                        properties:

                          networkType: existing

                          constraints:

                            - tag: 'vdsp:${input.network}'

                          count: '${input.netCount >= 1 ? 1 : 0}'

                     

                    Cloud_vSphere_Network_2:

                        type: Cloud.vSphere.Network

                        properties:

                          networkType: existing

                          count: '${input.netCount >= 2 ? 1 : 0}'

                          constraints:

                            - tag: 'vdsp:${input.network2}'

                     

                    Cloud_vSphere_Network_3:

                        type: Cloud.vSphere.Network

                        properties:

                          networkType: existing

                          constraints:

                            - tag: 'vdsp:${input.network3}'

                          count: '${input.netCount >= 3 ? 1 : 0}'

                     

                    Cloud_vSphere_Network_4:

                        type: Cloud.vSphere.Network

                        properties:

                          networkType: existing

                          count: '${input.netCount >= 4 ? 1 : 0}'

                          constraints:

                            - tag: 'vdsp:${input.network4}'

                     

                      vSphere_Machine:

                        type: Cloud.vSphere.Machine

                          networks: '${map_to_object(resource.Cloud_vSphere_Network_1[*].id + resource.Cloud_vSphere_Network_2[*].id, "network")}'

                     

                    Do you got any idea what i am doing wrong ?

                     

                    Regards.

                     

                     

                    • 7. Re: vRA8 disk and nic count
                      mmonkman Novice

                      Any luck with the static IPAM assignment?