VMware Aria Automation Tools

 View Only
  • 1.  VM disks order

    Posted Dec 05, 2024 10:55 AM

    Hello

    Is there any way how to force order of disks connected to VM?

    If I have simple YAML (below) for VM with four disks, they are connected in random order even though there is DependOn set. This unpredictable behaviour makes it very difficult for post-provision ABX actions (eg mapping disks for different roles in MS SQL server installation)

    Thank you

    formatVersion: 1
    inputs:
      vmName:
        type: string
        title: VM Name
    resources:
      Cloud_vSphere_Network_1:
        type: Cloud.vSphere.Network
        properties:
          networkType: existing
      VM_1:
        type: Cloud.vSphere.Machine
        properties:
          image: Oracle Linux 8.8
          cpuCount: 1
          totalMemoryMB: 2048
          newVmName: ${input.vmName}
          networks:
            - network: ${resource.Cloud_vSphere_Network_1.id}
          attachedDisks:
            - source: ${resource.Disk_1.id}
            - source: ${resource.Disk_2.id}
            - source: ${resource.Disk_3.id}
            - source: ${resource.Disk_4.id}
      Disk_1:
        type: Cloud.vSphere.Disk
        properties:
          capacityGb: 1
      Disk_2:
        type: Cloud.vSphere.Disk
        dependsOn:
          - Disk_1
        properties:
          capacityGb: 2
      Disk_3:
        type: Cloud.vSphere.Disk
        dependsOn:
          - Disk_2
        properties:
          capacityGb: 3
      Disk_4:
        type: Cloud.vSphere.Disk
        dependsOn:
          - Disk_3
        properties:
          capacityGb: 4
    


  • 2.  RE: VM disks order

    Posted Dec 06, 2024 03:00 AM

    Maybe you can just assign them a `name` in the `properties` so you'll be able to differentiate each ones in the ABX which has to finalize configuration




  • 3.  RE: VM disks order

    Posted Dec 06, 2024 03:17 AM

    That's one option (which I wanted to avoid). Another option is to force SCSI controller and LUN ID for disks (below)

    But I don't like it either

    Disk_04:
        type: Cloud.vSphere.Disk
        dependsOn:
          - Disk_03
        properties:
          capacityGb: ${input.disk2size}
          count: '${input.disk2size == 0 ? 0 : 1 }'
          SCSIController: SCSI_Controller_0
          unitNumber: 3
          constraints:
            - tag: ${input.VMEnvironment == 'Prod' ? 'SPtarget:' + input.VMType + '-site-' + to_lower(input.datacenter):'SPtarget:non-production-site-' + to_lower(input.datacenter)}
    



  • 4.  RE: VM disks order

    Posted Dec 06, 2024 03:30 AM

    Ok, so no "name" property. And maybe identify the disk based on its size ?




  • 5.  RE: VM disks order

    Posted Dec 06, 2024 04:13 AM

    I am not against the "name" property, I only don't like the idea of having it managed in post-provision ABX (it is a workaround, not a solution). I would like to have it done during initial provisioning.

    If there is no other solution then "name" property is maybe the best.