Active IQ Unified Manager Discussions

Need help with OCUM 6.4 mySQL Query to select the cluster & vServer based on volume name

KISHOREG15
2,552 Views

Hello Members,

 

Need help with OCUM 6.4 mySQL Query to select the cluster & vServer based on volume name. I have prepared, but getting an error when I an trying to use it in filters.

 

http://www.netapp.com/us/media/tr-4585.pdf

 

From the above article, I found a mySQL query to find the volume based on source ID. This is for OCUM 7.1,

 

SELECT

volume.name AS 'Volume',

cluster.name AS 'Cluster',

svm.name AS 'Svm'

 

FROM

volume,

cluster,

svm

 

WHERE

volume.id=$source_id

AND cluster.id=volume.clusterId

AND svm.id=volume.svmId

 

I have prepared an equivalent for this to work in OCUM 6.4, but it is not working as desired. My query is below,

 

SELECT
 volume.name AS 'Volume',
 cluster.name AS  'Cluster',
 vserver.name AS 'vserver'

 

FROM
 cm_storage.volume,
 cm_storage.cluster,
 cm_storage.vserver

 

WHERE
 volume.id=$'{source_id}'
 AND cluster.id=volume.clusterId
 AND vserver.id=volume.vserverId

 

Request you to please help me with equivalent query which works in OCUM 6.4. Thank You.

 

Regards,

Kishore

2 REPLIES 2

MartinRohrbach
2,452 Views

Hi there,

 

The OCUM version doesn't play into this, your query only depends on if you want to get a volume from the 7Mode tables (storage) or the Cdot tables (cm_storage). It looks like you want to grab the volume from the Cdot tables, in that case your table relations are slightly wrong. Try this one instead:

 

SELECT
 volume.name AS 'name',
 vserver.name AS 'vserver.name',
 cluster.primary_address AS 'vserver.cluster.primary_address'
FROM
 cm_storage.volume,
 cm_storage.cluster,
 cm_storage.vserver
WHERE
 volume.id = ${source_id}
 AND vserver.id = volume.vserver_id
 AND cluster.id = vserver.cluster_id

 

This should work for a "proper" cm_storage volume filter.

KISHOREG15
2,435 Views

Thank you for the help Martin. I will check this query and get back to you.

 

Regards,

Kishore

Public