Showing posts with label xCAT. Show all posts
Showing posts with label xCAT. Show all posts

Tuesday, September 30, 2014

Deleting unnecessary osimages

To get the list of all images use the following and then decide which you don't want to keep around:
lsdef -t osimage
To delete images that you don't need use the following command:
rmdef -t osimage -o <imageName>

xCAT 2.8.5 stateless bug

When trying to create a stateless xCAT image using the following commands:
  1. genimage centos6.5-x86_64-netboot-compute
  2. packimage centos6.5-x86_64-netboot-compute
  3. nodeset n1 osimage=centos6.5-x86_64-netboot-compute
The following error appears when trying to boot the node:
dracut: FATAL: No or empty root= argument
dracut: Refusing to continue
/lib/dracut-lib.sh: line 101: /emergency/01-die.sh: No such file or directory
dracut Warning: Signal caught! (when trying to boot the machine).
The problem is that there is a directory missing, it was skipped by xCAT installation for some reason, therefore, we need to create it manually:
  1. cd /opt/xcat/share/xcat/netboot
  2. ln -s ../rh/dracut dracut
Repeat the three commands above and you all set to go ! 

Modify partitioning in xCAT's images

To modify the partition layout, edit /opt/xcat/share/xcat/install/scripts/pre.rh at line 274:
vi /opt/xcat/share/xcat/install/scripts/pre.rh
echo "part /boot --size 256 --fstype $BOOTFSTYPE --ondisk $instdisk" >> /tmp/partitioning
echo "part swap --recommended --ondisk $instdisk" >> /tmp/partitioning
echo "part / --size 1 --grow --ondisk $instdisk --fstype $FSTYPE" >> /tmp/partitioning

Clearing Auditlog/Auditlog

From time to time, these tables gets pretty big, it is recommended to clear them once a week:
tabprune eventlog -a
tabprune auditlog -a
Also, it is recommended to create a cron job that will do it automatically:
crontab -e
00 00 * * Sun /opt/xcat/sbin/tabprune auditlog -a
00 00 * * Sun /opt/xcat/sbin/tabprune eventlog -a

Backup and Restore xCAT DB

To backup the current xCAT database, run the following command:
dumpxCATdb -p /path/to/save/xcatdb
To restore the database, use the following command:
restorexCATdb -p /path/where/xcatdb/was/saved