{"id":380,"date":"2013-06-04T14:32:39","date_gmt":"2013-06-04T14:32:39","guid":{"rendered":"http:\/\/corneliadavis.com\/blog\/?p=380"},"modified":"2013-06-04T14:32:39","modified_gmt":"2013-06-04T14:32:39","slug":"the-intuition-installing-bosh","status":"publish","type":"post","link":"https:\/\/corneliadavis.com\/blog\/2013\/06\/04\/the-intuition-installing-bosh\/","title":{"rendered":"The Intuition of Installing BOSH"},"content":{"rendered":"<p>We have Cloud Foundry running in the lab, BOSH deployed, in a vSphere environment.\u00a0 While I worked with a colleague to deploy that Cloud Foundry, and I focused on understanding what was going on with services deployments, I was perfectly content to have him get us to the point where we could do that Cloud Foundry install.\u00a0 In other words, he installed BOSH itself.\u00a0 Recently, however, when he and I were trying to track down an issue we were having with BOSH, I found I really wanted to understand how BOSH is installed.\u00a0 The short answer is, as reported on many blogs, that it\u2019s just like installing Cloud Foundry \u2013 that you install BOSH using BOSH.\u00a0 But what does that really mean? What are the details?\u00a0 In this blog I\u2019m aiming to explain WHAT happens when you go through the install steps. You can find those steps <a href=\"http:\/\/www.think-foundry.com\/\">here<\/a> or <a href=\"http:\/\/docs.cloudfoundry.com\/docs\/running\/deploying-cf\/vsphere\/\">here<\/a>, and my goal is not to repeat those instructions, but rather to explain a bit further what\u2019s going on.<\/p>\n<p>The first thing that you do is do some setup on the IaaS, in our case vSphere; networks, folders, etc.\u00a0 The folders will be used by various installation processes to hold files used during the install. That is, the IaaS itself is used to facilitate the installation, not just host the installed system.\u00a0 This is a key point that I haven\u2019t found stated elsewhere, but if you watch what is going on in your IaaS (i.e. watching your vSphere console) during a \u201cbosh deploy\u201d you\u2019ll see machines getting created and ultimately deleted \u2013 they are in service of the deploy itself.<\/p>\n<p>Okay, so now you have an IaaS environment ready that you can install BOSH onto.\u00a0 BOSH is itself a distributed application, running on a multitude of machines working in cooperation.\u00a0 In theory you could create the VMs you need (<a href=\"#http:\/\/www.think-foundry.com\/build-cloud-foundry-vsphere-bosh\/\">here<\/a> it says you\u2019ll need 6) and install the appropriate bits onto each of those machines \u2013 put the bosh director on one, the health monitor on another, the message bus on another, and so on. But wait, isn\u2019t that what BOSH is meant to do, provision VMs and install a distributed application onto them?\u00a0 It is, and that is why the BOSH team has provided something that allows you to install BOSH using BOSH.\u00a0 The trick then, is how to bootstrap the thing.<\/p>\n<div id=\"attachment_381\" style=\"width: 308px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/vimeo.com\/12871218\"><img data-recalc-dims=\"1\" decoding=\"async\" aria-describedby=\"caption-attachment-381\" loading=\"lazy\" class=\"size-full wp-image-381 \" title=\"ChickenEgg\" src=\"https:\/\/i0.wp.com\/corneliadavis.com\/blog\/wp-content\/uploads\/2013\/06\/ChickenEgg.png?resize=298%2C255\" alt=\"\" width=\"298\" height=\"255\" \/><\/a><p id=\"caption-attachment-381\" class=\"wp-caption-text\">Check out the video behind this image - very cute<\/p><\/div>\n<p>This is done with two things.\u00a0 First, the BOSH team has essentially created a virtual machine that has all of BOSH already preinstalled on it. That\u2019s right, BOSH director, the health manager, workers, message bus, etc \u2013 all of it on a single VM.\u00a0 And second, they have given you a tool to install that virtual machine into the IaaS environment that you set up in the first step.\u00a0 So the next few steps in the instructions have you download the micro-BOSH stemcell (essentially the VM) and install a bosh cli &amp; deployer. The cli has the protocol for interacting with the IaaS built into it, so you can just issue a few cli commands and it does the micro-bosh deployment for you. Some instructions have you create a virtual machine from which you do these steps, but this isn\u2019t strictly necessary; you just need an Ubuntu machine with ruby, git and a few other things on it.\u00a0 I personally always have Ubuntu VMs I am using for various development activities and are perfectly suited to this set of steps.\u00a0 So after you\u2019ve installed micro-BOSH following the instructions <a href=\"http:\/\/www.think-foundry.com\/build-cloud-foundry-vsphere-bosh-part-3\/\">here<\/a> or <a href=\"http:\/\/docs.cloudfoundry.com\/docs\/running\/deploying-cf\/vsphere\/deploying_micro_bosh.htmlhttp:\/\/docs.cloudfoundry.com\/docs\/running\/deploying-cf\/vsphere\/deploying_micro_bosh.html\">here<\/a>, you actually have a BOSH up and running.\u00a0 You can now take \u201creleases\u201d which contain things like packages, jobs and deployment manifests and deploy them with BOSH. And that install was really easy!<\/p>\n<p>But, hang on, the instructions go on \u2013 they have me install BOSH.\u00a0 But, didn\u2019t I just install BOSH? Yes, you just installed (micro) BOSH. And yes, you now need to install (full-blown) BOSH.<\/p>\n<p>Remember that micro-BOSH is deployed on a single VM.\u00a0 If you are deploying (and monitoring!! \u2013 but I\u2019ll talk about that more some other time) a distributed application that isn\u2019t too big or complicated, you could use micro-BOSH and it would work reasonably well.\u00a0 But ultimately our goal is to deploy more significant applications, like Cloud Foundry, and for that a single VM BOSH just couldn\u2019t cut it.\u00a0 But the good news is that we now have micro-BOSH to help us install the more sophisticated BOSH deployment.<\/p>\n<p>One of the components in that micro-BOSH deployment is something called the BOSH director, which, as the name implies, orchestrates all of the things that BOSH does for you. So to deploy anything with BOSH you basically tell the BOSH director what you want to do, where it can find the bits it needs for the job, and what environment you want to install those bits into. Let\u2019s take those things in reverse.<\/p>\n<p>Remember that BOSH will stand up VMs onto which it then installs things.\u00a0 What does that VM look like?\u00a0 This is where stemcells come in again.\u00a0 The instructions have you download, and then upload via micro-BOSH, the bosh stemcell.\u00a0 The BOSH stemcell is different from the micro-BOSH stemcell in that it contains only a base operating system plus a BOSH agent.\u00a0 Recall that the micro-BOSH stemcell has all of BOSH on it.\u00a0 I find it a bit ironic that the micro-BOSH stemcell is actually much \u201cbigger\u201d than the (full) BOSH stemcell.\u00a0 Really! Have a look at the file sizes for the two stemcells you\u2019ve downloaded.<\/p>\n<p>The bits that are needed for the application installation are bundled in a release.\u00a0 You find the BOSH release in the <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\">bosh repository<\/a> on git.\u00a0 The structure of a BOSH release has been covered in numerous blogs and videos, and I won\u2019t cover the details here. The instructions will have you git clone this repository to get all the bits you need; you\u2019ll have to modify a few settings for your vSphere environment.<\/p>\n<p>Finally, you need to tell the BOSH director what you want to do, and this is accomplished with a series of bosh cli commands, as covered in the installation documents.\u00a0 What is important to note in the instructions is that <span style=\"text-decoration: underline;\">when you are installing BOSH<\/span> (using micro-BOSH) you target the BOSH director that is a part of micro-BOSH.\u00a0 Once the (full) BOSH install is done you need to change which BOSH director you are targeting.\u00a0 If you don\u2019t and you try to do something like a Cloud Foundry deployment you\u2019ll be attempting that with the micro-BOSH and that is not likely to go well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have Cloud Foundry running in the lab, BOSH deployed, in a vSphere environment.\u00a0 While I worked with a colleague to deploy that Cloud Foundry, and I focused on understanding what was going on with services deployments, I was perfectly content to have him get us to the point where we could do that Cloud [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_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":""},"categories":[21],"tags":[53],"class_list":["post-380","post","type-post","status-publish","format-standard","hentry","category-paas","tag-cloudfoundry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts\/380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/comments?post=380"}],"version-history":[{"count":0,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts\/380\/revisions"}],"wp:attachment":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/media?parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/categories?post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/tags?post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}