How to develop an "External CPI"

89 views
Skip to first unread message

Chaos Eternal

unread,
Oct 9, 2014, 2:05:17 AM10/9/14
to bosh...@cloudfoundry.org
Hi,

 I am trying to connect bosh with my own cloud, but i found that documents for external cpi are rare.

Where can i find documents covering these topics:
1. how bosh communicates with external cpi programs
    i. protocols
    ii. interfaces to be implemented
2. how to use the new developed cpi

great thanks
--
Chaos Eternal
挖掘机学校到底哪里强?

Alexander Lomov

unread,
Oct 9, 2014, 7:50:23 AM10/9/14
to bosh...@cloudfoundry.org
Hi, 

I haven't seen comprehensive and complete guide on how to create BOSH CPI for any cloud vendor. As I see external CPI module is evolving now and there is no other way to learn about it then looking into sources or writing to this mailing list.

Answering your questions short: 

1. - protocols: not sure I got a question
    - interfaces: you can find functions you need to implement in bosh_cpi/cloud.rb file: https://github.com/cloudfoundry/bosh/blob/83f2882e887c7d243a28c932d4da78e737cd9ddd/bosh_cpi/lib/cloud.rb
    - other: you will need to build stemcell: take a look at https://github.com/cloudfoundry/bosh/tree/master/bosh-stemcell

2. after implementing everything is needed, you will be able to deploy MicroBOSH, then BOSH and etc using BOSH CLI, it is described in docs: http://docs.cloudfoundry.org/bosh/deploy-microbosh-to-openstack.html

I would recommend to dig following topics:
- [bosh-dev] azure CPI discussion can give you a clew of what you need https://groups.google.com/a/cloudfoundry.org/forum/#!topic/bosh-dev/Kh1XMshWCYY
- sometime ago I've described my experience in this blog post: http://blog.altoros.com/cloud-foundry-bosh-cpi-for-gce.html

Chaos Eternal

unread,
Oct 9, 2014, 12:53:04 PM10/9/14
to bosh...@cloudfoundry.org
Hi, 
Thanks for your information, it's useful

Dmitriy Kalinin

unread,
Oct 9, 2014, 1:10:05 PM10/9/14
to bosh...@cloudfoundry.org
Just to clarify we are not done changing BOSH to support external CPIs. For example microbosh does not have support to run external CPIs. It only has support for working with gem-ified CPIs.

To unsubscribe from this group and stop receiving emails from it, send an email to bosh-dev+u...@cloudfoundry.org.

tobe

unread,
Oct 9, 2014, 9:57:07 PM10/9/14
to bosh...@cloudfoundry.org
Hi @kalinin. Do you mean it's not possible to deploy Bosh in external CPI now? We're working to deploy CloudFoundry in Kingsoft Cloud and we should not deploy CF with Bosh, right?

Dmitriy Kalinin

unread,
Oct 9, 2014, 10:02:13 PM10/9/14
to bosh...@cloudfoundry.org, bosh...@cloudfoundry.org
It's possible to use a custom CPI. I would recommend to do an approach taken by other non official CPIs: to fork bosh repo and create a custom CPI plugin.

"External CPI" term is a bit more than just custom CPIs. We are working on separating CPIs even further into their own bosh releases such that you wouldn't have to fork bosh to use a custom cpi.

-dmitriy

Chaos Eternal

unread,
Oct 10, 2014, 8:26:57 AM10/10/14
to bosh...@cloudfoundry.org
I've read this article: http://blog.smartcore.net.au/integrating-bosh-cloud-foundry-and-fifo/ 
said there is a patch.

Chaos Eternal

unread,
Oct 10, 2014, 9:06:18 AM10/10/14
to bosh...@cloudfoundry.org
still a question:
bosh external cpi will call external program to communicate with cloud provider, and actions like create_stemcell, create_vm  will be taken when deploy.
but what are the orders of these actions?  there must be dependence , for example:
vm must be created before attach a disk
 what about others ?
this is what i mean about 'protocol'

Dmitriy Kalinin

unread,
Oct 10, 2014, 1:36:42 PM10/10/14
to bosh...@cloudfoundry.org
I see. There is a document that describes that currently. I'm trying to write all of that stuff down as a [wiki page](https://github.com/cloudfoundry/bosh/wiki/BOSH-CPI-API-v1-(WIP)) for now. Once that matures a bit I will place that in the docs site.

One way to find out order of all those things is to run bosh-lite and look at the logs. All cpi methods act on some resources that have cloud ids. e.g. attach_disk for example takes vm_cid and disk_cid which means that create_vm and create_disk would be called at some point before this. 

Important thing to note is that bosh may call any of those methods in a different order depending on the situation as long as bosh is able to provide needed arguments to the methods.

Chaos Eternal

unread,
Oct 12, 2014, 3:07:56 PM10/12/14
to bosh...@cloudfoundry.org
Great Job.

but what if the IaaS can not assign a network configuration manually?

Dmitriy Kalinin

unread,
Oct 13, 2014, 2:46:03 PM10/13/14
to bosh...@cloudfoundry.org
Bosh has different types of networking: manual, dynamic, and vip.

Dynamic networking indicates to BOSH to delegate all ip management to the IaaS (e.g. aws and openstack support this option).
Reply all
Reply to author
Forward
0 new messages