tag:blogger.com,1999:blog-534724342082307142.post5655512982748686441..comments2023-02-22T18:30:17.187+02:00Comments on Cloud Developer Tips: Mount an EBS Volume Created from Snapshot at StartupShlomohttp://www.blogger.com/profile/10469902663120418195noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-534724342082307142.post-57585252369169961742009-09-01T08:53:56.740+03:002009-09-01T08:53:56.740+03:00Thanks for the clarification, Shlomo, and - more t...Thanks for the clarification, Shlomo, and - more to the point - thanks for pointing me to http://clouddevelopertips.blogspot.com/2009/07/boot-ec2-instances-from-ebs.html, which is a more thorough way of dealing with hibernation for development environments. The approach you have in this article is great for scaling out production environments.Rob Staveley (Tom)https://www.blogger.com/profile/12685264964545576535noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-4108849632345817322009-08-29T22:29:39.577+03:002009-08-29T22:29:39.577+03:00@rstaveley,
The SSH key is not related to the use...@rstaveley,<br /><br />The SSH key is not related to the use of the EBS snapshot here. It's also not necessarily related to the use of an Elastic IP. Let me explain.<br /><br />This article presents a way to mount an EBS volume created at startup time from a snapshot. That's not like hibernating because the snapshot is a copy of an existing drive, while in hibernating there is no copying of drives, only creating a faster bootup next time the power is restored. So, in this article the newly-launched instance should be regarded as a "different" computer, and it should get a different SSH host key than the instance from which the AMI was bundled.<br /><br />The SSH host key is also not necessarily related to the use of an Elastic IP. An IP address can be transferred from one computer to another (via DHCP or Elastic IPs or reconfiguring the network properties) and it is different than the SSH identity of the machine. A single machine may have many IP addresses with a single host key (not in EC2, but in general), and a single SSH host key can be shared by many machines with different IP addresses. If you're using SSH host keys and IP addresses to determine the "identity" of an instance then you need to consider each use case and decide on the definition of "identity" you want to employ.<br /><br />In my article about booting an instance from an EBS volume http://clouddevelopertips.blogspot.com/2009/07/boot-ec2-instances-from-ebs.html I present a technique to "hibernate" an instance. In that case, the SSH host key should not change between boots from the EBS volume, and therefore the instructions there do not cause the SSH host key to be regenerated each time a new instance boots from the EBS volume. The only question is, should the instances that boot from the EBS volume have the same SSH host key as the instance that was used to create the AMI in the first place. The instructions in that article to create the AMI do not include chmod +x'ing ec2-ssh-host-key-gen, but that is definitely something to be considered when preparing that AMI. Here too the use of an Elastic IP is not necessarily related to booting an instance from an EBS volume.<br /><br />Let me know if that explanation clarifies things.Shlomohttps://www.blogger.com/profile/10469902663120418195noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-67137282089647106052009-08-29T12:01:19.878+03:002009-08-29T12:01:19.878+03:00Got it - so you probably wouldn't want do to t...Got it - so you probably wouldn't want do to that if you were hibernating an instance using an elastic IP.Rob Staveley (Tom)https://www.blogger.com/profile/12685264964545576535noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-13980946065990956782009-08-28T16:57:31.234+03:002009-08-28T16:57:31.234+03:00@rstaveley,
The ec2-ssh-host-key-gen is a script ...@rstaveley,<br /><br />The ec2-ssh-host-key-gen is a script on most public linux AMIs that generates a new SSH host key for the instance. It is executed only on the first boot - since you don't want the host key to change after a reboot. After it is executed in the first boot, the startup sequence prevents it from running again by chmod -x'ing it.<br /><br />When I bundle a new AMI I don't want it to have the same SSH host key as the instance it was bundled from. So I chmod +x that script to allow it to run again when the AMI is launched.<br /><br />It's not strictly necessary to do this, but it's a good idea I think.Shlomohttps://www.blogger.com/profile/10469902663120418195noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-50221754452169421722009-08-28T16:26:34.683+03:002009-08-28T16:26:34.683+03:00I'm puzzled about the chmod +x on:
ec2-ssh-h...I'm puzzled about the chmod +x on:<br /><br /> ec2-ssh-host-key-gen<br /><br />Why is that needed and where is that found?<br /><br />[Otherwise this follows nicely.]Rob Staveley (Tom)https://www.blogger.com/profile/12685264964545576535noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-91262089215095184802009-08-14T09:00:04.544+03:002009-08-14T09:00:04.544+03:00@MarkV,
Thanks for the pointer to Chef. I had loo...@MarkV,<br /><br />Thanks for the pointer to Chef. I had looked at it a while back but didn't use it. I shall look at it again.Shlomohttps://www.blogger.com/profile/10469902663120418195noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-64584860447094806432009-08-14T06:10:07.472+03:002009-08-14T06:10:07.472+03:00Shlomo,
Another very interesting post - I have yet...Shlomo,<br />Another very interesting post - I have yet to work through it fully... Nonetheless, thnank you!<br /><br />I do wonder if Chef doesn't provide a way to do what you want? I looked at RightScale's approach but, to my mind, Chef offered a more attractive route and community experiences wider than just EC2.<br /><br />I don't /think/ Chef would provide a proxy service in exactly the way you describe. However, I am hoping a Chef recipe, or sequence of recipes, can be coerced to have an AMI boot from an EBS volume. <br />Chef seems to be making rapid progress so the community/wiki documentation/how-to is a little out of synch:<br /><br />http://wiki.opscode.com/display/chef/Chef+0.7.0+on+EC2+Rails+Infrastructure+Notes<br /><br />Do you use Chef at all?Unknownhttps://www.blogger.com/profile/05904620802165220948noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-47776210820998782962009-08-08T21:05:08.219+03:002009-08-08T21:05:08.219+03:00@Edward,
Thanks for the encouragement!
I am also...@Edward,<br /><br />Thanks for the encouragement!<br /><br />I am also not too happy about keeping account credentials on the instances.<br /><br />I've been thinking about a web service that acts as a proxy for AWS (so existing libraries will work with a simple change of endpoint URL). Such a thing would allow your instances to be free of credentials, and the proxy service would, after authenticating the instance, sign the request with your AWS credentials, execute it, and pass back the result.<br /><br />[I imagine that RightScale's functionality is implemented in a similar manner.]<br /><br />If anyone is interested in collaborating on such an open-source project, please contact me.Shlomohttps://www.blogger.com/profile/10469902663120418195noreply@blogger.comtag:blogger.com,1999:blog-534724342082307142.post-32699071809812511592009-08-08T04:01:19.987+03:002009-08-08T04:01:19.987+03:00Shlomo,
Great post. I work with AWS and EBS all ...Shlomo,<br /><br />Great post. I work with AWS and EBS all of the time and like your ideas. Keep up the great work.<br /><br />You may want to look at the http://RightScale.com/ interface. They have an Attach Volume at boot feature that does not require you to have any information about the AWS account on the server. This is a nice feature.<br /><br />Edward M. Goldberg<br />http://myCloudWatcher.com/Edward M. Goldberghttps://www.blogger.com/profile/02999499470005206580noreply@blogger.com