{"id":408,"date":"2010-02-24T15:39:19","date_gmt":"2010-02-24T21:39:19","guid":{"rendered":"http:\/\/www.webadminblog.com\/?p=408"},"modified":"2010-02-24T15:39:19","modified_gmt":"2010-02-24T21:39:19","slug":"a-case-for-images","status":"publish","type":"post","link":"https:\/\/www.webadminblog.com\/index.php\/2010\/02\/24\/a-case-for-images\/","title":{"rendered":"A Case For Images"},"content":{"rendered":"<p>After speaking with Luke Kanies at OpsCamp, and reading his good and oft-quoted article &#8220;<a href=\"http:\/\/madstop.com\/2009\/02\/04\/golden-image-or-foil-ball\/\">Golden Image or Foil Ball?<\/a>&#8220;, I was thinking pretty hard about the use of images in our new automated infrastructure.\u00a0 He&#8217;s pretty against them.\u00a0 After careful consideration, however, I think judicious use of images is the right thing to do.<\/p>\n<p>My top level thoughts on why to use images.<\/p>\n<ol>\n<li><strong>Speed &#8211; <\/strong>Starting a prebuilt image is faster than reinstalling everything on an empty one.\u00a0 In the world of dynamic scaling, there&#8217;s a meaningful difference between a &#8220;couple minute spinup&#8221; and a &#8220;fifteen minute spinup.&#8221;<\/li>\n<li><strong>Reliability<\/strong> &#8211; The more work you are doing at runtime, the more there is to go wrong.\u00a0 I bet I&#8217;m not the only person who has run the same compile and install on three allegedly identical Linux boxen and had it go wrong somehow on one of &#8217;em.\u00a0 And the more stuff you&#8217;re pulling to build your image, the more failure points you have.<\/li>\n<li><strong>Flexibility<\/strong> &#8211; Dynamically building from stem cell kinda makes sense if you&#8217;re using 100% free open source and have everything automated.\u00a0 What if, however, you have something that you need to install that just hasn&#8217;t been scripted &#8211; or is very hard to script?\u00a0 Like an install of some half-baked Windows software that doesn&#8217;t have a command line installer and you don&#8217;t have a tool that can do it?\u00a0 In that case, you really need to do the manual install in non-realtime as part of a image build.\u00a0 And of course many suppliers are providing software as images themselves nowadays.<\/li>\n<li><strong>Traceability<\/strong> &#8211; What happens if you need to replicate a past environment?\u00a0 Having the image is going to be a 100% effective solution to that, even likely to be sufficient for legal reasons.\u00a0 &#8220;I keep a bunch of old software repo versions so I can mostly build a machine like it&#8221; &#8211; somewhat less so.<\/li>\n<\/ol>\n<p>In the end, it&#8217;s a question of using intermediate deliverables.\u00a0 Do you recompile all the code and every third party package every time you build a server?\u00a0 No, you often use binaries &#8211; it&#8217;s faster and more reliable.\u00a0 Binaries are the app guys&#8217; equivalent of &#8220;images.&#8221;<\/p>\n<p>To address Luke&#8217;s three concerns from his article specifically:<\/p>\n<ol>\n<li><strong>Image sprawl <\/strong>&#8211; if you use images, you eventually have a large library of images you have to manage.\u00a0 This is very true &#8211; but you have to manage a lot of artifacts all up and down the chain anyway.\u00a0 Given the &#8220;manual install&#8221; and &#8220;vendor supplied image&#8221; scenarios noted above, if you can&#8217;t manage images as part of your CM system than it&#8217;s just not a complete CM system.<\/li>\n<li><strong>Updating your images<\/strong> &#8211; Here, I think Luke makes some not entirely valid assumptions.\u00a0 He notes that once you&#8217;re done building your images, you&#8217;re still going to have to make changes in the operational environment (&#8220;bootstrapping&#8221;).\u00a0 True.\u00a0 But he thinks you&#8217;re not going to use the same tool to do it.\u00a0 I&#8217;m not sure why not &#8211; our approach is to use automated tooling to build the images &#8211; you don&#8217;t *want* to do it manually for sure &#8211; and Puppet\/Chef\/etc. works just fine to do that.\u00a0 So if you have to update something at the OS level, you do that and let your CM system blow everything on top &#8211; and then burn the image.\u00a0 Image creation and automated CM aren&#8217;t mutually exclusive &#8211; the only reason people don&#8217;t use automation to build their images is the same reason they don&#8217;t always use automation on their live servers, which is &#8220;it takes work.&#8221;\u00a0 But to me, since you DO have to have some amount of dynamic CM for the runtime bootstrap as well, it&#8217;s a good conservation of work to use the same package for both. (Besides bootstrapping, there&#8217;s other stuff like moving content that shouldn&#8217;t go on images.)<\/li>\n<li><strong>Image state vs running state<\/strong> &#8211; This one puzzles me.\u00a0 With images, you do need to do restarts to pull in image-based changes.\u00a0 But with virtually all software and app changes you have to as well &#8211; maybe not a &#8220;reboot,&#8221; but a &#8220;service restart,&#8221; which is virtually as disruptive.\u00a0 Whether you &#8220;reboot\u00a0 your database server&#8221; or &#8220;stop and start your database server, which still takes a couple minutes&#8221;, you are planning for downtime or have redundancy in place.\u00a0 And in general you need to orchestrate the changes (rolling restarts, etc.) in a manner that &#8220;oh, pull that change whenever you want to Mr. Application Server&#8221; doesn&#8217;t really work for.<\/li>\n<\/ol>\n<p>In closing, I think images are useful.\u00a0 You shouldn&#8217;t treat them as a replacement for automated CM &#8211; they should be interim deliverables usually generated by, and always managed by, your automated CM.\u00a0 If you just use images in an uncoordinated way, you do end up with a foil ball.\u00a0 With sufficient automation, however, they&#8217;re more like Russian nesting dolls, and have advantages over starting from scratch with every box.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After speaking with Luke Kanies at OpsCamp, and reading his good and oft-quoted article &#8220;Golden Image or Foil Ball?&#8220;, I was thinking pretty hard about the use of images in our new automated infrastructure.\u00a0 He&#8217;s pretty against them.\u00a0 After careful consideration, however, I think judicious use of images is the right thing to do. My [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[85],"tags":[628,39,398,632,397,623],"class_list":["post-408","post","type-post","status-publish","format-standard","hentry","category-automation","tag-automation","tag-cloud","tag-configuration-management","tag-devops","tag-images","tag-virtualization"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pfI0c-6A","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/posts\/408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=408"}],"version-history":[{"count":2,"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions"}],"predecessor-version":[{"id":410,"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/posts\/408\/revisions\/410"}],"wp:attachment":[{"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webadminblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}