DISCLAIMER: This code should work on CentOS, RHEL and Ubuntu. See notes at bottom of post before running. This post was written specifically for cleaning RightImages, but should apply to custom images as well. This is alpha code provided with no warranty, YMMV.
That being said, feel free to post questions or issues and I will do what I can to help.
Step 1: configure VM the way you want it
Step 2: clean up the system before image "bundle" using attached script
vagrant@lucid32:/vagrant/data$ sudo cp clean_for_rebundle.tar /root/
vagrant@lucid32:/vagrant/data$ sudo -i
root@lucid32:~# tar xvf clean_for_rebundle.tar
clean.sh
functions.sh
truncate.sh
root@lucid32:~# ./clean.sh
Step 3: rebundle image using cloud API or "bundle" button on rightscale dashboard.
Step 4: ??
Step 5: profit!
Notes
Just some extra info that may be pertainate to the image you are attempting to clean...
RightLink 5.7
The tar file contains a clean.sh file for RightScale RightLink 5.8 images. Replace this file with the contents of clean_rightlink5_7.sh if bundling a VM running on an older rightimage.CentOS/RHEL
you must first have lsb_release utility installed. To install run:> sudo yum install -y redhat-lsb
Good luck!!
Source code project here https://github.com/caryp/clean_for_rebundle
No comments:
Post a Comment