Sanjay Arora
2011-Jan-29 08:36 UTC
[CentOS] Amazon EC2 - building a minimal centOS ebs bootable image
Hello Looking to build CentOS based micro EC2 instance bootable from Amazon EBS. Want that the image be minimal, so that I can add only the rpms I want. Despite looking could not find a way to import a CentOS image from scratch or an existing minimal CentOS image that is bootable from EBS. My server must must persist, as I cannot handle issues with a dynamic server, so I want to use a server that can boot from EBS. Am a EC2 newbie and a follow the instructions kind of a Sys Admin ;-) Please guide me to links, howtos and give experienced advice, in general. With best regards. Sanjay.
John R Pierce
2011-Jan-29 08:53 UTC
[CentOS] Amazon EC2 - building a minimal centOS ebs bootable image
On 01/29/11 12:36 AM, Sanjay Arora wrote:> Hello > > Looking to build CentOS based micro EC2 instance bootable from Amazon > EBS. Want that the image be minimal, so that I can add only the rpms I > want. > > Despite looking could not find a way to import a CentOS image from > scratch or an existing minimal CentOS image that is bootable from EBS. > My server must must persist, as I cannot handle issues with a dynamic > server, so I want to use a server that can boot from EBS.good luck with the persistence part in a cloud. the whole idea of clouds is to distribute your services and separate them from the physical instances. EC2 is *not* a replacement for a conventional static server.
Rainer Traut
2011-Jan-29 14:16 UTC
[CentOS] Amazon EC2 - building a minimal centOS ebs bootable image
Am 29.01.2011 09:36, schrieb Sanjay Arora:> Looking to build CentOS based micro EC2 instance bootable from Amazon > EBS. Want that the image be minimal, so that I can add only the rpms I > want. > > Despite looking could not find a way to import a CentOS image from > scratch or an existing minimal CentOS image that is bootable from EBS. > My server must must persist, as I cannot handle issues with a dynamic > server, so I want to use a server that can boot from EBS.Hi Sanjay, there are plenty of howtos to get centos in the cloud - google is your friend. But one note: since C5.5 you do not need Amazon's kernel+initrd anymore, the Centos shipped xenblk and xennet modules work just fine. And finally amazon ships a thing as "boot kernel" that behaves like pygrub and reads the grub.conf of your image and starts the inside configured kernel. I had to use this cmdline to make the initrd: KVER=$(uname -a|awk '{print $3}')xen mkinitrd --omit-scsi-modules --with=xennet --with=xenblk --preload=xenblk -f /boot/initrd-${KVER}.img ${KVER} and my modprobe.conf: alias eth0 xennet alias scsi_hostadapter xenblk To get an image into the cloud I did: - format a 10GiB file with ext3 - install a minimal centos to it (yum with --installroot option) - put this into S3 as an AMI - start an instance of it - clone this to an EBS file with rsync - make a snapshot of this EBS - convert this snapshot to an EBS AMI - use your EBS instances... Hth Rainer