Active IQ Unified Manager Discussions

Snapshot timestamp in cm_storage_smsv scheme

bjones_ea
8,778 Views

I'm working on some customer workflows and leveraging the "Manage snapmirror-snapvault cascade relationships" Pack version 1.0.0 as certified by NetApp. What I'm seeing is an interesting problem with snapshot reservations.  I'm using this pack as it provided a framework for retreiving snapshot information into WFA. (I'm not sure why this functionality is missing from the core product.) I've created a "create snapshot" command, and borrowing heavily from other examples, the reservation insert SQL is:

 

INSERT
INTO
    cm_storage_smsv.snapshot
    (volume, name, cluster, vserver, timestamp)
VALUES
    ('${Volume}', '${Snapshot}', '${Cluster}', '${Vserver}', CURRENT_TIMESTAMP);

I have created a filter that allows me to get snapshots by volume including those created by reservation:

 

SELECT
    snapshot.name as 'name',
    snapshot.volume as 'volume',
    snapshot.vserver as 'vserver',
    snapshot.cluster as 'cluster',
    snapshot.timestamp as 'timestamp',
    unix_timestamp(snapshot.timestamp) as 'unix_timestamp'
FROM
    cm_storage.cluster,
    cm_storage_smsv.snapshot
WHERE
    (
        cluster.name = '${cluster}'
        OR cluster.primary_address = '${cluster}'
    )
    AND snapshot.volume = '${volume}'
    AND snapshot.vserver = '${vserver}'
    AND (
        cluster.primary_address = snapshot.cluster
        OR cluster.name = snapshot.cluster
    )
ORDER BY
    snapshot.timestamp DESC

This works appropriately for all snapshots that are on the volume and picked up by the snapshot data source. However, any new snapshots recorded by reservations do not show the correct timestamp. They report the timestamp of now() and not the actual timestamp of the snapshot. This is causing problems in my testing. I'm unable to see on the WFA database side exactly how the snapshot reservation data is stored, but the filter and reservation SQL works properly for data in the cm_storage_smsv.snapshot table.

 

Has anyone else seen this issue?  Is this a problem with the management pack itself, or something screwy with my SQL code?  For grins I replaced CURRENT_TIMESTAMP in the snapshot command reservation SQL with a static date, and there was no effect.  It is as if the reservation table definition forces the timestamp to now(). 

 

 

 

1 ACCEPTED SOLUTION

shailaja
8,344 Views

Hi Brian,

 

In WFA, if a reservation script has dynamic value generation, it cannot work seamlessly.

 

Reservation scripts run at the time of need. If a filter has to include reservation data or a workflow planning has to include reservation data, it runs those reservation SQL statements at that point of time and returns data. In this case, the reservation script had dynamic data i.e “CURRENT_TIMESTAMP” whose value will keep differing every time a filter or planning runs.

Unfortunately, this is a limitation in the WFA platform currently.

 

Now, there are three things I can think of:

 

a. As you probably noticed, making the timestamp value static will work. So, would it be feasible to modify the command you are using to take timestamp as a parameter and use that in the reservation script. In the workflow, you could fill up the parameter using a MVEL expression to get the current timestamp.  That way the timestamp value will be generated during planning and then the same value will be used during every run of that reservation script. This is better than dynamic issue that is happening currently, but there will be a time difference between the actual snapshot creation time and the timestamp value. This difference will be equivalent to planning time versus the time the command actually got executed

 

Note: This is not a great solution per say, it is a workaround to reduce the problem

 

b. You did mention this already. If frequency of data source acquisition can increase or is run at the end of the workflow, then the problem is reduced.

 

c. We will file an enhancement request to support a mode where the reservation script can get values from the execution of a command. If that was possible, then the command execution could update the timestamp value and after that whenever reservation script ran, it could have the accurate value.

 

Hope this helps..

 

 

Thanks,

Shailaja

View solution in original post

11 REPLIES 11
Public