# In a recipe -- how to get ram?

**URL:** <https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355>\
**Category:** Chef Infra (archive)\
**Created:** [November 20, 2015, 8:26am UTC](https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355 "2015-11-20T08:26:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Montgomery](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@David\_Montgomery](https://discourse.chef.io/u/David_Montgomery)\
**Post date:** [November 20, 2015, 8:26am UTC](https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355/1 "2015-11-20T08:26:24Z")

</div>

How do I get server memory (ram) in gigs?

Thanks

---

<div class="post-metadata">

**Author:** ![Tensibai](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tensibai/32/29_2.png) [@Tensibai](https://discourse.chef.io/u/Tensibai)\
**Post date:** [November 20, 2015, 8:37am UTC](https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355/2 "2015-11-20T08:37:28Z")

</div>

You can base on `node['memory']['total'] / 1024` as the ohai attribute is in kB.

[more about ohai here](https://docs.chef.io/ohai.html)

And to see all attributes on a node: `knife node show 'node fqdn' -l`.  
Usually it’s better to redirect this to a file and search in the file.

---

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [November 20, 2015, 2:01pm UTC](https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355/3 "2015-11-20T14:01:56Z")

</div>

On 11/20/2015 3:37 AM, Tensibai wrote:

---

<div class="post-metadata">

**Author:** ![Tensibai](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tensibai/32/29_2.png) [@Tensibai](https://discourse.chef.io/u/Tensibai)\
**Post date:** [November 20, 2015, 2:05pm UTC](https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355/4 "2015-11-20T14:05:30Z")

</div>

@Jeff_Blaine You should top answer for now, Discourse does not parse properly inline answers 😕

---

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [November 20, 2015, 2:08pm UTC](https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355/5 "2015-11-20T14:08:31Z")

</div>

Bah. I replied via email only to correct ‘2014’ --\> ‘1024’. It looks like that’s corrected here in Discourse by an edit probably, which doesn’t get sent through as an email “correction” message.

Thanks for the heads-up. Yay software.

---

<div class="post-metadata">

**Author:** ![Tensibai](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tensibai/32/29_2.png) [@Tensibai](https://discourse.chef.io/u/Tensibai)\
**Post date:** [November 20, 2015, 2:11pm UTC](https://discourse.chef.io/t/in-a-recipe-how-to-get-ram/7355/6 "2015-11-20T14:11:31Z")

</div>

Ooops, yes Mike did correct me.
