Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSI Snapshot create time not populated #10670

Closed
ggriffiths opened this issue May 29, 2021 · 2 comments · Fixed by #12352
Closed

CSI Snapshot create time not populated #10670

ggriffiths opened this issue May 29, 2021 · 2 comments · Fixed by #12352
Assignees
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/storage type/bug
Milestone

Comments

@ggriffiths
Copy link
Contributor

Nomad version

Output from nomad version

[root]# nomad version
Nomad v1.1.0 (2678c3604bc9530014208bc167415e167fd440fc)

Operating system and Environment details

Centos 7

Issue

It seems that CSI volume snapshots do not retrieve the CreationTime for a snapshot.

Reproduction steps

Portworx CSI Driver:

[root]# nomad volume snapshot create pxvol2 snap5
Snapshot ID   Volume ID     Size    Create Time           Ready?
311380734057  453305181908  10 GiB  1970-01-01T00:00:01Z  true
[root]#nomad volume snapshot list -verbose
Snapshot ID         Volume ID           Size    Create Time  Ready?
667120900816550989  985157419660361822  10 GiB  <none>       true
311380734057675387  453305181908192527  10 GiB  <none>       true

Cross-checked w/ the hostpath driver to see if this was a driver problem, but it seems to happen there too:

[root@ip-70-0-14-127 ~]# nomad volume status
Container Storage Interface
ID      Name      Plugin ID         Schedulable  Access Mode
hpvol   hpvol     hostpath-plugin0  true         <none>
pxvol2  database  portworx          true         <none>
[root@ip-70-0-14-127 ~]# nomad volume snapshot create hpvol hpsnap
Snapshot ID   Volume ID     Size     Create Time           Ready?
b29cfd92-c01  954752c5-c01  977 KiB  1970-01-01T00:00:01Z  true
[root@ip-70-0-14-127 ~]# nomad volume snapshot list
Snapshot ID   Volume ID     Size     Create Time  Ready?
b29cfd92-c01  954752c5-c01  977 KiB  <none>       true

Expected Result

Create time should be retrieved from the CSI Snapshot "CreationTime" response field.

Actual Result

Create time is the zero value.

Job file (if appropriate)

n/a

Nomad Server logs (if appropriate)

n/a

Nomad Client logs (if appropriate)

n/a

@tgross
Copy link
Member

tgross commented Jun 1, 2021

Hi @ggriffiths! Nomad doesn't store any metadata about the snapshots, and the snapshot creation time comes from the storage provider. We have to plumb that through from the plugin to the client endpoint to the Nomad RPC endpoint to the Nomad HTTP endpoint and then to the CLI.

At first glance it looks like there's an incorrect units conversion happening: we're converting the plugin response to seconds in client.go#L592 but formatting that from nanoseconds in volume_snapshot_list.go#L160 (which is shared code between the create/list commands). But that doesn't explain why we'd get a zero value on the create and nil on the list commands. In any case, will fix.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/storage type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants