Discussion Forums
Discussion Forums > Category: Compute > Forum: Amazon Elastic Compute Cloud (EC2) >Thread: /etc/apt/sources.list being replaced by image generation
Advanced search options
/etc/apt/sources.list being replaced by image generation
Posted by: ch3greg
Posted on: May 19, 2010 4:46 PM
  Click to reply to this thread Reply
This question is answered.
Hi,

When I start a new instance of an image (Ubuntu Lucid) I've made, the /etc/apt/sources.list file has been re-set to some default.  This is an issue since my image requires a special /etc/apt/sources.list entries.

My image creation script has the following commands:

<blockquote> rm /etc/mercury/incep
rm -rf /var/lib/varnish/*
rm -f /home/ubuntu/.*hist*
rm -f /var/log/*.gz
rm -rf /tmp/*find /var/log -name mysql -prune -o -type f -print |  while read i; do cp /dev/null $i; done

ec2-bundle-vol -r $ARCH -d /mnt -p $NAME -u $AWS_USER_ID -k /home/ubuntu/ec2-keys/pk-*.pem -c /home/ubuntu/ec2-keys/cert-*.pem -s 10240 -e $EXCLUDE

ec2-upload-bundle -b $BUCKET -m /mnt/$NAME.manifest.xml -a $AWS_ACCESS_KEY_ID -s $AWS_SECRET_ACCESS_KEY
</blockquote>
And I'm seeing (for the first time) the following errors when creating the image:

<blockquote> warning: Unable to get device geometry for /mnt/image_name
Unable to read instance meta-data for ancestor-ami-ids
Unable to read instance meta-data for ramdisk-id
Unable to read instance meta-data for product-codes
</blockquote>Are these errors related?

Thanks!

Greg
Permlink Replies: 2 | Pages: 1 - Last Post: May 20, 2010 10:08 AM by: ch3greg
Replies
Re: /etc/apt/sources.list being replaced by image generation
Posted by: Shlomo Swidler
Posted on: May 19, 2010 5:14 PM
in response to: ch3greg in response to: ch3greg
  Click to reply to this thread Reply
Correct
Those bundling-time errors are not related.

It does seem strange that bundling would overwrite the apt-sources. It's likely not anything in the bundling process, probably something in the initial boot sequence. Have you tried creating an EBS-backed AMI instead?

Also, check out this page on the Ubuntu wiki:
https://wiki.ubuntu.com/ServerLucidCloudConfig
You may be able to control the apt-sources by passing in an appropriate user-data config.
Re: /etc/apt/sources.list being replaced by image generation
Posted by: ch3greg
Posted on: May 19, 2010 7:49 PM
in response to: Shlomo Swidler in response to: Shlomo Swidler
  Click to reply to this thread Reply
Schlomo,

Thanks for the reply.  I have not yet tried an EBS-backed image.

I checked and this is new with Lucid.  The Karmic and Jaunty images I've made have kept the sources.list contents.

Can anyone confirm this behavior in the Lucid images from Ubuntu on AWS?

Update: Confirmed that this is new and intended behavior in Lucid (see http://groups.google.com/group/ec2ubuntu/msg/04cb779849cf2c8b).  Placing the additional sources in /etc/apt/sources.list.d seems to be the way to go.

Greg


Message was edited by: ch3greg