190 likes | 843 Views
Bosh CPI Introduction. 邢 舟 xingzhou@cn.ibm.com IBM Open Source and Open Standard 2014.10. Bosh Bosh CPI Bosh External CPI External CPI Interface Bosh Warden External CPI Bosh Micro CLI SoftLayer External CPI. Agenda. Bosh 简介( 1/3 ). Bosh BOSH 用于在各种云基础设施平台上部署分布式软件
E N D
Bosh CPI Introduction 邢舟xingzhou@cn.ibm.com IBM Open Source and Open Standard 2014.10
Bosh • Bosh CPI • Bosh External CPI • External CPI Interface • Bosh Warden External CPI • Bosh Micro CLI • SoftLayer External CPI Agenda
Bosh简介(1/3) • Bosh • BOSH用于在各种云基础设施平台上部署分布式软件 • A CloudFoundry tool, A release tool • Development • Product • Bosh: Bosh-lite Micro-Bosh Full-Bosh • Stemcells • CF-Releases
Bosh简介(2/3) 2 1 3 创建Release 上传Release/Stemcell 构建/部署Release 4 编译Package/运行Jobs
Bosh简介(3/3) • Bosh Dev • https://github.com/cloudfoundry/bosh • https://github.com/cloudfoundry/bosh-agent • Ruby & Shell & Golang • Testings: • Unit • Integration • BAT • CPI Tests Director CLI CPI Stemcell
Bosh CPI(1/5) • CPI == Cloud Provider Interface • 一组Bosh操作IaaS的API • vs Bosh Agent • Bosh通过CPI的帮助完成: • 软件包编译 • 软件包部署 Bosh-Micro Deployment Manifest:
Bosh CPI(2/5) Warden
Bosh CPI(3/5) • Bosh CPI Projects • github.com/cloudfoundry/bosh/bosh-cpi • CPI Interfaces • CPI factory • Built-in CPI and Internal CPI • github.com/cloudfoundry/bosh/bosh-xxx-cpi
Bosh CPI (5/5) Bosh REST CPI Bosh External CPI Bosh Built-in CPI 仅少数官方支持 CPI 采用程序内直接调用方式 与BOSH一起部署 1个BOSH Director对应一个CPI实例 基于JSON的标准接口 跨程序调用 使用独立的CPI Release 1个BOSH Director对应一个CPI实例 基于JSON格式和REST风格的标准接口 跨服务器调用 使用独立的CPI Release 1个BOSH Director对应多个CPI实例
Bosh External CPI(1/6) • Deployment Manifest Config • <external_cpi><enabled> • CPI program exec path • 程序调用方式 • Open3.capture3 • stdin stdout stderr • JSON Format • 程序接口 • 标准化CPI接口 • 标准化错误类型
Bosh External CPI(3/6) JSON传入参数 JSON返回值 { 'result' => <any>, 'error' => enum(nil, { 'type' => <string>, 'message' => <string>, 'ok_to_retry' => <bool> } ), 'log' => <string> } { 'method' => <string>, 'arguments' => <array>, 'context' => { 'director_uuid' => <string> } }
Bosh External CPI(4/6) • 错误类型: • Bosh::Clouds::CpiError • Bosh::Clouds::NotSupported • Bosh::Clouds::NotImplemented • Bosh::Clouds::CloudError • Bosh::Clouds::VMNotFound • Bosh::Clouds::NoDiskSpace • Bosh::Clouds::DiskNotAttached • Bosh::Clouds::DiskNotFound • Bosh::Clouds::VMCreationFailed
Bosh External CPI(5/6) • Bosh Warden CPI: • External CPI样例 • Golang • https://github.com/cppforlife/bosh-warden-cpi
Bosh External CPI(6/6) • Bosh-Micro-CLI • 完全支持External CPI接口的Bosh CLI • Golang • 目前正在积极开发中 • Deployment • Deploy • Step1: Compile CPI Release • Step2: Deploy CPI • Step3: Deploy micro bosh based on the CPI • https://github.com/cloudfoundry/bosh-micro-cli
SoftLayer CPI • Bosh SoftLayer CPI工作: • Ruby CPI • Golang CPI • 完全支持External CPI • 目前在开发项目: • Bosh-SoftLayer-CPI • SoftLayer-Go
References • Bosh文档 • http://docs.cloudfoundry.org/bosh/ • Bosh Repo • https://github.com/cloudfoundry/bosh • Bosh Micro CLI • https://github.com/cloudfoundry/bosh-micro-cli • Bosh Warden External CPI • https://github.com/cppforlife/bosh-warden-cpi
谢谢 xingzhou@cn.ibm.com