0

A long time back on a production server of mine I had created a few virtual machines. On Ubuntu using virt-manager I have forgotten their configurations i.e. How much RAM did I allocate to those VM's can some one help me to figure that out.I have no clue as how to detect that part.

edit after some replies I am using KVM not Xen

free -m has following output

             total       used       free     shared    buffers     cached
Mem:          1002        956         45          0         30        151
-/+ buffers/cache:        774        228
Swap:         2015          0       2015

and the config file virtual_machine.xml has following entry which I think is the right line for RAM specification

 <memory>1048576</memory>
 <currentMemory>1048576</currentMemory>

but I am not able to understand what is that no in GB equal to.Here is the output of top command on the Virtual Machine

Mem:   1026868k total,   980080k used,    46788k free,    31508k buffers
Swap:  2064376k total,      104k used,  2064272k free,   155040k cached

For another virtual machine free -m has following

             total       used       free     shared    buffers     cached
Mem:          2009       1848        161          0        235        792
-/+ buffers/cache:        820       1189
Swap:         5847          1       5846

and its config file has

 <memory>2097152</memory>
  <currentMemory>2097152</currentMemory>

Now output of top -b -d 1 > top.txt command on host where all such guests are running is

top - 14:40:43 up 8 days,  4:01,  1 user,  load average: 0.68, 0.58, 0.55
Tasks: 259 total,   2 running, 256 sleeping,   0 stopped,   1 zombie
Cpu(s):  1.3%us,  4.2%sy,  0.0%ni, 94.4%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8181868k total,  8059876k used,   121992k free,   388564k buffers
Swap: 15624184k total,    63012k used, 15561172k free,  1596052k cached

How much is the memory Host has and how much is given to guest that is what I want to know.

Registered User
  • 1,453
  • 5
  • 18
  • 37

3 Answers3

1

Your host has 8GB of ram:

Mem:   8181868k total

Your first VM has 1GB of ram allocated to it. Your vm config file specifies 1048576, and the units are in kB (I'm assuming that, but it doesn't make any sense in any other units). This is corroborated by the output of top showing 1026868k, which is also close enough to 1GB to back that up.

It gets confusing because those numbers don't match up. This is probably because of RAM being reserved for PCI and BIOS address space mappings - this happens even inside KVM, because KVM presents a fake BIOS which needs to reserve some memory for the BIOS and psuedo PCI space.

The second VM likewise has 2GB of ram allocated to it.

There's a good answer here on how to interpret the output of "free" properly, which is worth reading. I won't replicate it here

Daniel Lawson
  • 5,426
  • 21
  • 27
0

Assuming your using xen, try "grep mem [xen config files]", my config files are in /etc/xen/configs/ so it'd be "grep mem /etc/xen/configs/*"

To find memory on your system (the host) try "free -m"

Sirex
  • 5,447
  • 2
  • 32
  • 54
0

Just as Sirex wrote, in case that you are using Xen, try to use command

xm list

which will show you your virtual machines with memory you assigned them.

EDIT: I noticed that you are using KVM. Try using command virsh like this:

virsh dommemstat DOMAIN_ID

To find out ID of your domain use:

virsh list

I hope it helps.

panaroik
  • 832
  • 5
  • 12