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().