Hi,
As I understand, you are referring to display of the aggregate list when executing the workflow and
allowing the user to choose one of them where to place the volume.
Check if you could write a query in the lines of:
SELECT
aggr.name AS 'Aggregate',
aggr.size_mb AS 'Total Size (MB)',
aggr.used_size_mb AS 'Used Size (MB)',
aggr.available_size_mb AS 'Available Size (MB)'
FROM
cm_storage.aggregate AS aggr
JOIN
cm_storage.node AS node
ON node.id = aggr.node_id
JOIN
cm_storage.cluster AS cluster
ON cluster.id = node.cluster_id
JOIN
cm_storage.vserver_allowed_aggregate AS vserver_allowed_aggregate
ON vserver_allowed_aggregate.aggregate_id = aggr.id
JOIN
cm_storage.vserver AS mapped_vserver
ON vserver_allowed_aggregate.vserver_id = mapped_vserver.id
WHERE
mapped_vserver.restricted_aggregate_count > 0
AND mapped_vserver.name = '${VserverName}'
AND (cluster.name = '${ClusterName}'
OR cluster.primary_address = '${ClusterName}'
)
AND aggr.name LIKE '%${DiskType}%'
UNION
SELECT
aggr.name AS 'Aggregate',
aggr.size_mb AS 'Total Size (MB)',
aggr.used_size_mb AS 'Used Size (MB)',
aggr.available_size_mb AS 'Available Size (MB)'
FROM
cm_storage.aggregate AS aggr
JOIN
cm_storage.node AS node
ON node.id = aggr.node_id
JOIN
cm_storage.cluster AS cluster
ON cluster.id = node.cluster_id
JOIN
cm_storage.vserver AS mapped_vserver
ON cluster.id = mapped_vserver.cluster_id
WHERE
mapped_vserver.restricted_aggregate_count = 0
AND mapped_vserver.name = '${VserverName}'
AND (cluster.name = '${ClusterName}'
OR cluster.primary_address = '${ClusterName}'
)
AND aggr.name LIKE '%${DiskType}%'
- Above query selects aggregates that have been assigned to a SVM or all aggregates in case a SVM is not assigned any i.e it is allowed to use any aggregate in the cluster.
- Last part in the query above "AND aggr.name LIKE '%${DiskType}%'" should be changed to refer to the naming conventions used by you for disk type.
- $DiskType would be a user input similar to $ClusterName and $VserverName
Hope this helps.
Thanks,
Shailaja