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

node-status outputs volumename instead of 0B utilization when non-physical volume is used #1538

Merged
merged 1 commit into from
Aug 10, 2016
Merged

node-status outputs volumename instead of 0B utilization when non-physical volume is used #1538

merged 1 commit into from
Aug 10, 2016

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Aug 7, 2016

Issue

nomad node-status outputs Disk 0 B/0 B.

$ nomad node-status 11f9838e
  ...
Host Resource Utilization
CPU        Memory          Disk
1122/7396  4.1 GiB/15 GiB  0 B/0 B

This is one of the issues reported in #1374.

Root cause

nomad client collects disk data from physical partitions only. So, tmpfs is not collected. Ref -
disk.Partitions(false) and shirou/gopsutil's code

Change

This PR changes nomad to output only volume name instead of 0 B when non-physical volume is used.

(e.g)

$ nomad node-status 11f9838e
  ...
Host Resource Utilization
CPU         Memory          Disk
1153/13056  4.0 GiB/15 GiB  (tmpfs)

@nak3 nak3 changed the title node-status stops showing volumename instead of 0B utilization when non-physical volume is used node-status outputs volumename instead of 0B utilization when non-physical volume is used Aug 7, 2016
@@ -53,6 +53,8 @@ func (f *StorageFingerprint) Fingerprint(cfg *config.Config, node *structs.Node)
node.Attributes["unique.storage.bytestotal"] = strconv.FormatUint(total, 10)
node.Attributes["unique.storage.bytesfree"] = strconv.FormatUint(free, 10)

f.logger.Printf("[DEBUG] fingerprint.storage: volume: %s, total: %d Byte, free: %d Byte", volume, total, free)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the node attributes can be queried from the cli and api, we don't need a debug message here.

@dadgar
Copy link
Contributor

dadgar commented Aug 8, 2016

Nice this is cool!

@nak3
Copy link
Contributor Author

nak3 commented Aug 8, 2016

Thank you! I updated by deleting the debug message.

@diptanu diptanu merged commit d8dd52c into hashicorp:master Aug 10, 2016
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants