Subscribe

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

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

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

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.

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

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

 

Regards,

Kishore