{"id":46092,"date":"2015-07-23T19:35:15","date_gmt":"2015-07-23T16:35:15","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=46092"},"modified":"2019-08-16T14:57:29","modified_gmt":"2019-08-16T11:57:29","slug":"how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/","title":{"rendered":"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs"},"content":{"rendered":"<p><center style=\"margin-bottom: 10px;\"><a href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-1-bosh-components\/\">Part 1<\/a> | <b>Part 2<\/b><\/center><\/p>\n<p>Until recently, all custom BOSH CPIs were forks of the BOSH project. They were hard to maintain and had to be implemented in Ruby. In August 2014, the BOSH team introduced the new external CPI mechanism that has removed these constraints. The second part of our blog series on adding BOSH support to custom clouds will be dedicated to external BOSH CPIs, how they are used, and what it takes to build one.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#What_are_BOSH_CPIs\" >What are BOSH CPIs?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#Why_external_BOSH_CPIs_were_introduced\" >Why external BOSH CPIs were introduced<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#Whats_new_in_external_CPIs\" >What\u2019s new in external CPIs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#The_new_way_to_deploy_MicroBOSH\" >The new way to deploy MicroBOSH<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#How_BOSH_creates_VMs_for_jobs\" >How BOSH creates VMs for jobs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#How_to_build_a_new_CPI\" >How to build a new CPI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#What_else_you_need_to_enable_BOSH_on_your_cloud\" >What else you need to enable BOSH on your cloud<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#Further_reading\" >Further reading<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"What_are_BOSH_CPIs\"><\/span>What are BOSH CPIs?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The BOSH CPI stands between BOSH and the IaaS provider. It encapsulates the cloud API specification and complexities, providing BOSH with a simple interface, which is described in the <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/blob\/main\/bosh_cpi\/lib\/cloud.rb\">BOSH::Cloud<\/a> class. If you look at it, you will see that the list of methods is pretty simple: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">create_vm, delete_vm<\/code>, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">attach_disk<\/code>, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">create_disk<\/code>, and so on. The BOSH CPI also provides BOSH Agent with the information it needs.<\/p>\n<p>BOSH CPIs are used by BOSH Director and during MicroBOSH deployment. They are also used by a new tool called <b>bosh-init<\/b>, which will be described below. To understand CPIs well, you will need to learn how BOSH Director and the bosh-init tool perform deployment of BOSH jobs through the CPI. You also want to understand how the CPI communicates with BOSH Agent, which is built into every BOSH stemcell.<\/p>\n<p>As we have mentioned, there are currently two ways to implement a BOSH CPI: the old fashioned method where the CPI is built into the BOSH project as a gem and the new way, the so-called \u201cexternal CPI.\u201d So, why did the BOSH team go through all the trouble of creating a new CPI mechanism?<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_external_BOSH_CPIs_were_introduced\"><\/span>Why external BOSH CPIs were introduced<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In the beginning, there were only built-in BOSH CPIs. The BOSH team officially supported <a href=\"https:\/\/groups.google.com\/a\/cloudfoundry.org\/forum\/#!searchin\/bosh-dev\/bug$20workarounds$20in$20a$20CPI\/bosh-dev\/Hd4CCvGjoIk\/9dOLfi__CUoJ\">five infrastructure providers<\/a> that were integrated with the BOSH project: <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/tree\/master\/bosh_aws_cpi\">AWS<\/a>, <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/tree\/master\/bosh_openstack_cpi\">OpenStack<\/a>, <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/tree\/master\/bosh_vsphere_cpi\">vSphere<\/a>, <a href=\"https:\/\/github.com\/cloudfoundry-attic\/bosh_vcloud_cpi\">vCloud<\/a>, and <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/tree\/stable-2619\/bosh_warden_cpi\">Warden<\/a>. With this approach, the only way to add BOSH support to a new cloud was to fork the BOSH project and make changes all over its code. This meant that you had to update your CPI every time BOSH was updated, and you could only use Ruby as the implementation language.<\/p>\n<p>You can find a description of these issues in <a href=\"https:\/\/www.altoros.com\/blog\/building-a-custom-bosh-cpi-for-the-cloud-foundry-paas-a-gce-example\/\">our blog post<\/a> that explains how to create a BOSH CPI for GCE using this approach. You may also want to look at this <a href=\"https:\/\/groups.google.com\/a\/cloudfoundry.org\/forum\/#!topic\/bosh-dev\/Kh1XMshWCYY\">interesting discussion<\/a> of the Azure CPI in the bosh-dev group.<\/p>\n<p>Meanwhile, the BOSH team was implementing the new external CPI mechanism that would eliminate all the constraints. Today, we can finally see it starting to roll. In addition, a new modern way to deploy MicroBOSH, called <a href=\"https:\/\/lists.cloudfoundry.org\/g\/cf-bosh\/messages\">bosh-init<\/a>, was introduced. Let\u2019s take a closer look at how they work.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Whats_new_in_external_CPIs\"><\/span>What\u2019s new in external CPIs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The main difference between regular BOSH CPIs, which I have previously <a href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-1-bosh-components\/\">described<\/a>, and the external CPI mechanism is that calls to methods of the <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/blob\/main\/bosh_cpi\/lib\/cloud.rb\">Bosh::Cloud<\/a> Ruby class have been substituted with execution of a binary file. To understand how this works, you need to look inside the implementation of the <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/blob\/main\/bosh_cpi\/lib\/cloud\/external_cpi.rb\">ExternalCpi<\/a> class that is, in fact, a wrapper for this mechanism.<\/p>\n<p>The binary file that implements the CPI functionality is provided to BOSH Director through a separate BOSH release that is deployed on the same VM with BOSH Director. This release contains a binary, which is placed in <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">\/var\/vcap\/jobs\/&lt;cpi-release-name&gt;\/bin\/cpi<\/code>. BOSH finds it using manifest parameters:<\/p>\n<pre>properties:<\/pre>\n<pre>\u00a0director:<\/pre>\n<pre>\u00a0\u00a0\u00a0cpi_job: cloud-specific-cpi<\/pre>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"The_new_way_to_deploy_MicroBOSH\"><\/span>The new way to deploy MicroBOSH<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For a long time, the standard way to deploy MicroBOSH was to use the special <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/tree\/master\/bosh_cli_plugin_micro\">BOSH micro CLI plugin<\/a> from the official BOSH repository. Along with adding an external CPI to BOSH, a new way to deploy MicroBOSH was also released\u2014a project called <a href=\"https:\/\/github.com\/cloudfoundry-attic\/bosh-init\">bosh-init<\/a>. This solution made deployment of MicroBOSH much easier and became the last step in the long way to excluding BOSH CPI functionality from BOSH itself.<\/p>\n<p><a href=\"https:\/\/github.com\/cloudfoundry-attic\/bosh-init\">bosh-init<\/a> compiles the external CPI release on a machine where you run the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">bosh-init<\/code> command. After the CPI binary is ready, bosh-init calls it with the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">create_stemcell<\/code> and <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">create_vm<\/code> parameters, just like BOSH Director does. This makes it possible for bosh-init to launch a VM in a target cloud and send the necessary instructions to the agent. You can find more details in the <a href=\"https:\/\/github.com\/cloudfoundry-attic\/bosh-init\/blob\/master\/docs\/architecture.md\">official documentation<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_BOSH_creates_VMs_for_jobs\"><\/span>How BOSH creates VMs for jobs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A CPI is not just a wrapper around API calls. It also provides BOSH Agent with the settings necessary for initializing communication between the agent and BOSH Director. To implement a functional CPI, you need to understand the principles of this communication. So, let\u2019s see how BOSH creates VMs.<\/p>\n<p>BOSH Agent runs on every VM that contains a BOSH job. It helps to run BOSH requests and handle VM system resources (such as disk partitioning, network setup, etc.). BOSH Agent is placed into every stemcell, too. In fact, the stemcell version defines the version of BOSH Agent. Nevertheless, we can update the agent inside a running VM with the <a href=\"https:\/\/groups.google.com\/a\/cloudfoundry.org\/forum\/#!searchin\/bosh-dev\/bosh-agent$20update\/bosh-dev\/lR9tssaCnZs\/Zlp8fz5UDKcJ\">kickstarter mechanism<\/a>, which makes it possible to upgrade the version of BOSH Director without redeploying every BOSH job.<\/p>\n<p>Before creating a BOSH job, you need to upload the stemcell to the infrastructure. This is done by calling the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">create_stemcell<\/code> CPI method. With this call, the CPI is provided with an \u201cimage file\u201d that will be converted to an IaaS image. For instance, in case of OpenStack, it is a file in the QCOW2 format, vSphere uses VMDK disk format, etc. AWS provides a possibility to use \u201clight\u201d stemcells, where the image file is empty and the stemcell metadata file (<code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">stemcell.MF<\/code>) contains IDs of publicly available AMI images. The CPI uses these IDs to create new instances.<\/p>\n<p>Every CPI treats the \u201cimage file\u201d differently, depending on what IaaS you use. In the most general case, this file is uploaded to the cloud and converted into an image using a cloud API. The ID returned by the cloud API is received by BOSH that uses it to refer to this stemcell later on. See the diagram below for more details.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/creating-a-bosh-stemcell-cloud-foundry.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/creating-a-bosh-stemcell-cloud-foundry.png\" alt=\"\" width=\"640\" class=\"aligncenter size-full wp-image-46104\" \/><\/a><\/center><\/p>\n<p>Once the stemcell has been generated, the CPI proceeds to crating a VM.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/creating-a-virtual-machine-with-bosh-cloudpfoundry.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/creating-a-virtual-machine-with-bosh-cloudpfoundry.png\" alt=\"\" width=\"540\" class=\"aligncenter size-full wp-image-46107\" \/><\/a><\/center><\/p>\n<p>After an image (stemcell) has been created, BOSH executes the CPI binary and tells it to run the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">create_vm method<\/code> (step 1). The stemcell ID is passed to the cloud API together with arguments of the call: the CPI makes an appropriate request to the cloud API to create a VM (step 2).<\/p>\n<p>After the VM has been started, BOSH Agent inside this VM is going to look into the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">\/var\/vcap\/bosh\/settings.json<\/code> file for settings. The <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">settings.json<\/code> file is built into the stemcell and differs depending on what type of cloud you use. It contains information about the disk naming schema and network configuration. Settings from <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">settings.json<\/code> tell BOSH Agent how to fetch the initial settings from the CPI. The initial settings contain information on how it can communicate with BOSH Director and other software that uses the CPI. Usually, initial settings contain URLs for the messaging bus and registry (step 3).<\/p>\n<p>The CPI can pass these options to a VM with BOSH Agent in several different ways. The most common mechanism is based on cloud-specific options, such as metadata service in AWS and OpenStack and CD-ROM in vSphere. BOSH Agent decides what method to use based on the <a href=\"https:\/\/github.com\/cloudfoundry\/bosh\/blob\/ede389a2e112e1b4f2dbc4495c08977da4439483\/stemcell_builder\/stages\/bosh_vsphere_agent_settings\/apply.sh#L19-L20\" target=\"blank\" rel=\"noopener noreferrer\">configuration<\/a> in the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">settings.json<\/code> file, which is supplied within the stemcell. You can also simply <a href=\"https:\/\/github.com\/cloudfoundry\/bosh-agent\/issues\/15\" target=\"blank\" rel=\"noopener noreferrer\">upload<\/a> a file with settings to a VM that runs a BOSH Agent (step 4).<\/p>\n<p>After BOSH Agent gets the initial settings, it will be able find the registry (if it exists) and the messaging bus. In case of a fully functional deployment, BOSH Agent will use NATS to talk to BOSH Director. If the messaging bus is set to use the HTTPS protocol (the URL in the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">mbus<\/code> option starts with \u201chttps:\/\/\u201d), BOSH Agent launches an HTTPS server and treats requests sent to this server as notifications from a messaging bus (step 5).<\/p>\n<p>After that stage, BOSH Agent starts getting instructions through the messaging bus. This means BOSH Director can tell BOSH Agent what blobs to compile and what jobs to run (step 6). At the same time, BOSH Agent can retrieve the Monit status of running services and notify BOSH Director about it.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_build_a_new_CPI\"><\/span>How to build a new CPI<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>First of all, you need to have a programmatic interface to work with the API of the IaaS. If you are considering Ruby as the implementation language, you probably want to use fog. This gem supports many popular IaaSes and its fog-core library implements a convenient DSL for the REST API. Originally, fog-core was designed for the REST API, so it doesn\u2019t support such approaches as HATEOAS out of the box.<\/p>\n<p>Once you have an interface, you can use an API wrapper to implement the CPI binary. The easiest way to find out how this binary should work is to follow the code of existing external CPIs, e.g., for <a href=\"https:\/\/github.com\/cloudfoundry\/bosh-openstack-cpi-release\">OpenStack<\/a>, <a href=\"https:\/\/github.com\/cloudfoundry-attic\/bosh_vcloud_cpi\">vCloud<\/a>, or <a href=\"https:\/\/github.com\/cloudfoundry\/bosh-aws-cpi-release\">AWS<\/a>. Most of them are implemented as separate gems written in Ruby, but some are written in Go, e.g., the <a href=\"https:\/\/github.com\/cppforlife\/bosh-warden-cpi\">Warden CPI<\/a>.<\/p>\n<p>After you have implemented the CPI, you will need to create a CPI release. At this point, you may also find it useful to look at some publicly available CPI releases: for <a href=\"https:\/\/github.com\/cloudfoundry\/bosh-openstack-cpi-release\">OpenStack<\/a>, <a href=\"https:\/\/github.com\/cloudfoundry\/bosh-aws-cpi-release\">AWS<\/a>, or <a href=\"https:\/\/github.com\/cloudfoundry-attic\/bosh-vcloud-cpi-release\">vCloud<\/a>. More useful information about how to create a release can be found in <a href=\"https:\/\/bosh.io\/docs\/\/create-release.html\">BOSH documentation<\/a> or <a href=\"https:\/\/www.altoros.com\/blog\/creating-a-bosh-release-for-admin-ui-a-monitoring-tool-for-cloud-foundry\/\">this blog post<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_else_you_need_to_enable_BOSH_on_your_cloud\"><\/span>What else you need to enable BOSH on your cloud<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>We are glad that it has become a lot easier to build and maintain new BOSH CPIs compared to last year. Still, creating a CPI is only part of what you need to add BOSH support to a custom cloud. You also have to build your own stemcells, which is generally one of the hardest steps in the process. So, the third and last blog post in this series will be dedicated to creating a custom stemcell from scratch. If you have any questions, feel free to comment below.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Further_reading\"><\/span>Further reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-1-bosh-components\/\">How to Add BOSH Support to a Custom Cloud (Part 1): BOSH Components<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/building-a-custom-bosh-cpi-for-the-cloud-foundry-paas-a-gce-example\/\">Building a Custom BOSH CPI for the Cloud Foundry PaaS: A GCE Example<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/creating-a-bosh-release-for-admin-ui-a-monitoring-tool-for-cloud-foundry\/\">Creating a BOSH Release for Admin UI, a Monitoring Tool for Cloud Foundry<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Part 1 | Part 2<\/p>\n<p>Until recently, all custom BOSH CPIs were forks of the BOSH project. They were hard to maintain and had to be implemented in Ruby. In August 2014, the BOSH team introduced the new external CPI mechanism that has removed these constraints. The second part of our [&#8230;]<\/p>\n","protected":false},"author":35,"featured_media":46109,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[873,206],"class_list":["post-46092","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-cloud-native","tag-oss-cloud-foundry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs | Altoros<\/title>\n<meta name=\"description\" content=\"Learn about different ways to deploy MicroBOSH, how to create VMs for jobs using BOSH, and how to build a new CPI from scratch.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs | Altoros\" \/>\n<meta property=\"og:description\" content=\"Part 1 | Part 2 Until recently, all custom BOSH CPIs were forks of the BOSH project. They were hard to maintain and had to be implemented in Ruby. In August 2014, the BOSH team introduced the new external CPI mechanism that has removed these constraints. The second part of our [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-23T16:35:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-16T11:57:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"488\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Alexander Lomov\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexander Lomov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/\",\"name\":\"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif\",\"datePublished\":\"2015-07-23T16:35:15+00:00\",\"dateModified\":\"2019-08-16T11:57:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/32bad30d8a66fbba345c09f5ce9503a6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif\",\"width\":640,\"height\":488},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/32bad30d8a66fbba345c09f5ce9503a6\",\"name\":\"Alexander Lomov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Alexander-Lomov-150x150.jpg\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Alexander-Lomov-150x150.jpg\",\"caption\":\"Alexander Lomov\"},\"description\":\"Alexander Lomov is a Cloud Foundry Engineer at Altoros. With extensive experience in Ruby, Go, and Python, he was involved in development of BOSH CPIs and other Cloud Foundry-related projects for Canonical, IBM, and other companies. Alexander is a frequent speaker at various events\/meetups, mostly sharing his experience with Cloud Foundry. You may also know him as the author of several blog posts about Cloud Foundry internals.\",\"sameAs\":[\"http:\/\/altoros.com\"],\"url\":\"https:\/\/www.altoros.com\/blog\/author\/alexander-lomov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs | Altoros","description":"Learn about different ways to deploy MicroBOSH, how to create VMs for jobs using BOSH, and how to build a new CPI from scratch.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/","og_locale":"en_US","og_type":"article","og_title":"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs | Altoros","og_description":"Part 1 | Part 2 Until recently, all custom BOSH CPIs were forks of the BOSH project. They were hard to maintain and had to be implemented in Ruby. In August 2014, the BOSH team introduced the new external CPI mechanism that has removed these constraints. The second part of our [...]","og_url":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/","og_site_name":"Altoros","article_published_time":"2015-07-23T16:35:15+00:00","article_modified_time":"2019-08-16T11:57:29+00:00","og_image":[{"width":640,"height":488,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif","type":"image\/gif"}],"author":"Alexander Lomov","twitter_misc":{"Written by":"Alexander Lomov","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/","url":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/","name":"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif","datePublished":"2015-07-23T16:35:15+00:00","dateModified":"2019-08-16T11:57:29+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/32bad30d8a66fbba345c09f5ce9503a6"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2015\/07\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis.gif","width":640,"height":488},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/how-to-add-bosh-support-to-a-custom-cloud-part-2-external-bosh-cpis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Add BOSH Support to a Custom Cloud (Part 2): External BOSH CPIs"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/32bad30d8a66fbba345c09f5ce9503a6","name":"Alexander Lomov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Alexander-Lomov-150x150.jpg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Alexander-Lomov-150x150.jpg","caption":"Alexander Lomov"},"description":"Alexander Lomov is a Cloud Foundry Engineer at Altoros. With extensive experience in Ruby, Go, and Python, he was involved in development of BOSH CPIs and other Cloud Foundry-related projects for Canonical, IBM, and other companies. Alexander is a frequent speaker at various events\/meetups, mostly sharing his experience with Cloud Foundry. You may also know him as the author of several blog posts about Cloud Foundry internals.","sameAs":["http:\/\/altoros.com"],"url":"https:\/\/www.altoros.com\/blog\/author\/alexander-lomov\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/46092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=46092"}],"version-history":[{"count":14,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/46092\/revisions"}],"predecessor-version":[{"id":46114,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/46092\/revisions\/46114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/46109"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=46092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=46092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=46092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}