dennis henry

ramblings of an IT professional

Follow me on TwitterRSS Feeds

  • Home
  • About
  • Linux Tutorials
  • Code
  • Docs
  • Gallery

Total Memory on a Xen Node

Nov 22nd

Posted by dennis in Linux

2 comments

I ran into an interesting issue the other day that I figured I’d make a post about in order for others. Since my company is getting more into Xen Hosting, I’ve tried to be at the forefront of the virtualization software for the company. We did run into an interesting issue though the other day when it came to determining the total amount of memory on a hardware node. Since we set up the Domain-0 to use only 512MB of memory, we were having a tough time determining how much total RAM is in the server. After googling for awhile and asking some co-workers, I discovered the following command:

xm info

This command shows quite a few interesting metrics including the total memory for the server. Using this I was able to easily discern the total amount of memory and write a quick script to compute total amount of memory:

1
2
3
4
5
6
7
8
9
10
#!/bin/bash
 
total_memory=$(xm info | grep total_memory | awk '{print $3}')
remaining=$(xm info | grep free_memory | awk '{print $3 - 512}')
used_memory=$((total_memory-remaining))
 
 
echo -e 'Total Memory:\t'$total_memory'MB ('$((total_memory/1024))'GB)'
echo -e 'Memory Used:\t'$used_memory'MB ('$((used_memory/1024))'GB)'
echo -e 'Remaining:\t'$remaining'MB ('$((remaining/1024))'GB)'

Hope this helps anyone else trying to figure out accurate Xen Memory usage

Linux, memory usage, xen

Install Xen 3.4.3 on CentOS 5.x

Sep 10th

Posted by dennis in CentOS

4 comments

So I have had to install Xen 3.4.3 recently 3 different times so I thought I’d make a quick post regarding the best route I have found to do this. Please note, this may not be the most optimal route but it has worked well for me 3 times now:

yum install xen PyXML mesa-libGL
yum remove xen python-virtinst libvirt-python libvirt xen-libs
mkdir rpms
cd rpms
wget http://www.gitco.de/repo/xen3.4.3/libvirt-0.7.0-6.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/libvirt-client-0.7.0-6.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/libvirt-python-0.7.0-6.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/python-virtinst-0.500.0-1.el5.noarch.rpm
wget http://www.gitco.de/repo/xen3.4.3/xen-3.4.3-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/xen-libs-3.4.3-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/glusterfs-client-2.0.8-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/glusterfs-common-2.0.8-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/fuse-2.7.4-1.rf.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/libibverbs-1.1-1.x86_64.rpm
rpm -ivh *.rpm

After that block, make sure you edit /etc/grub.conf to set the following lines:

---snip---
default = 0
---snip---
kernel /xen.gz-3.4.3 dom0_mem=512m
---snip---

The first will set the xen kernel as the default and the second will limit dom0 to only be able to use 512m of memory, leaving the rest for your VEs. After these changes, go ahead and reboot. Let me know if this route works for you!

3.4.3, 5.x, centos, xen
« First...«23456»...Last »
    • Recent comments
    • Popular posts
    • Archives
    • Tags
    • Categories
    • Common Issues (7)
    • Linux (18)
      • Apache (1)
      • CentOS (4)
      • cPanel (9)
        • Easyapache (1)
      • Drives (1)
      • Exim (1)
      • IPTables (1)
      • MySQL (1)
      • Networking (2)
      • OpenSSH (1)
      • OpenVZ (4)
      • Subversion (1)
      • Xen (2)
    • PHP (2)
      • CakePHP (1)
      • GeSHI (1)
      • suPHP (1)
    3.4.3 5.x Apache assign ip addresses CakePHP centos Common Issues configuration connections cPanel cpuwatch demo Drives Easyapache exim ftp ftp accounts full GeSHI highlighting interface iptables ip usage libperl Linux memory usage mode MySQL network networking OpenVZ overwriting defaults password pcre perl preg_replace pure-ftpd resolv.conf subversion suPHP syntax upgrade venet0 xen yum
    • July 2011 (1)
    • June 2011 (1)
    • May 2011 (1)
    • March 2011 (1)
    • December 2010 (1)
    • November 2010 (2)
    • September 2010 (1)
    • August 2010 (2)
    • July 2010 (1)
    • April 2010 (2)
    • October 2009 (1)
    • June 2009 (1)
    • April 2009 (2)
    • March 2009 (3)
    • Install Xen 3.4.3 on CentOS 5.x (4)
    • CPUwatch (3)
    • Common Issues – Easyapache failing (2)
    • Total Memory on a Xen Node (2)
    • Common Issues – MySQL Connectivity Issues (1)
    • Simple IPTables OpenVZ Setup (1)
    • Common Issues – Hostname A Record (0)
    • Common Issues – Main Drive Full (Mounting Issues) (0)
    • Allocate x IPs to OpenVZ VEs (0)
    • Common Issues – Maxed out Apache Connections (0)
    • dennis: I'm glad to hear my script could help you! Xen's memory management is indeed odd but, overall, I...
    • Sam: I too was caught out by the Xen hypervisor's method of memory management. The Dom-0 machine is...
    • dennis: CPUWatch completely pauses processes until the load decreases, so its not ideal for services like...
    • victor: I've read several sites that talk about cpuwatch where they use the word Pause or throttled. ...
    • dennis: Hey Ben! Thanks for the comment. That's odd it didn't work for you. I've used this same method...
    • Ben: This did not work as per below: cpan> install Acme::Spork CPAN: Storable loaded ok...
    • dennis: Thanks Jimmy! Glad you enjoyed it.
    • jimmy: finally an upgrade guide that just "works" thanks
  • My latest tweets

    Loading tweets...
    Follow me on Twitter!
  • User Login






    • Lost your password?
RSS Feeds XHTML 1.1 Top