10 Replies Latest reply: Oct 17, 2013 10:13 AM by kofchur RSS

Selecting an Aggregate based on Least Used %

kofchur
Currently Being Moderated

Hello,

I have a workflow for creating a cMode snapmirror relationship.  The problem I have is that the workflow keeps selecting the same destination aggregate.  I want it to select the destination aggregate based on least used percentage.  Here is the code for the filter:

 

 

SELECT
    aggr.name,
    (((aggr.used_size_mb + '${used_space}')/ aggr.size_mb) * 100) AS used_percentage,
    node.name AS 'node.name',
    cluster.primary_address AS 'node.cluster.primary_address'
FROM
    cm_storage.aggregate AS aggr
JOIN
    cm_storage.node AS node
        ON aggr.node_id = node.id
JOIN
    cm_storage.cluster AS cluster
        ON cluster.id = node.cluster_id
WHERE
    (
        (
            aggr.used_size_mb + '${used_space}'
        ) / aggr.size_mb
    ) * 100 <= '${used_size_threshold}'
ORDER BY
    used_percentage

 

Now, when I test this, it does in fact order the aggregates from least to greatest usage, but it keeps selecting the same one, eventhough that aggregate is not even close to being the least used.  Any suggestions would be great. 

 

 

 

-todd

 

 

 

More Like This

  • Retrieving data ...