worker321 发表于 2016-1-8 09:21:56

vSphere部署Cloud Foundry V2 (3) ---- micro bosh 部署

Cloud Foundry V2 的文章目录在 Cloud Foundry V2 相关文章目录
我会不定期的做一些文章的更改,如有不便之处还要谅解。
在部署中遇到了什么问题可以在下面留言。
本博客的所有yml stemcell 和 release 都能在百度云上下载 http://pan.baidu.com/s/1pJHkPYV
 
如果你有对配置文件或者CF运维有什么更好的想法请联系我,我非常需要你的帮助

1、下载 stemcells
  创建2个文件夹 deployments 和 stemcells。

mkdir -p deployments
mkdir -p stemcells
  进入stemcells文件夹下载 stemcell

cd ~/stemcells
  显示stemcell 版本 

bosh public stemcells
| Name |
+-----------------------------------------------------------------+
| bosh-stemcell-2427-aws-xen-ubuntu.tgz |
| bosh-stemcell-2652-aws-xen-centos.tgz |
| bosh-stemcell-2739-aws-xen-centos-go_agent.tgz |
| bosh-stemcell-2427-aws-xen-ubuntu-go_agent.tgz |
| bosh-stemcell-2710-aws-xen-ubuntu-lucid-go_agent.tgz |
| bosh-stemcell-2652-aws-xen-ubuntu-lucid.tgz |
| bosh-stemcell-2739-aws-xen-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.1-aws-xen-centos-go_agent.tgz |
| bosh-stemcell-2719.1-aws-xen-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.2-aws-xen-centos-go_agent.tgz |
| bosh-stemcell-2719.2-aws-xen-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.3-aws-xen-ubuntu-trusty-go_agent.tgz |
| light-bosh-stemcell-2427-aws-xen-ubuntu.tgz |
| light-bosh-stemcell-2652-aws-xen-centos.tgz |
| light-bosh-stemcell-2739-aws-xen-centos-go_agent.tgz |
| light-bosh-stemcell-2427-aws-xen-ubuntu-go_agent.tgz |
| light-bosh-stemcell-2710-aws-xen-ubuntu-lucid-go_agent.tgz |
| light-bosh-stemcell-2652-aws-xen-ubuntu-lucid.tgz |
| light-bosh-stemcell-2739-aws-xen-ubuntu-trusty-go_agent.tgz |
| light-bosh-stemcell-2719.1-aws-xen-centos-go_agent.tgz |
| light-bosh-stemcell-2719.1-aws-xen-ubuntu-trusty-go_agent.tgz |
| light-bosh-stemcell-2719.2-aws-xen-centos-go_agent.tgz |
| light-bosh-stemcell-2719.2-aws-xen-ubuntu-trusty-go_agent.tgz |
| light-bosh-stemcell-2719.3-aws-xen-ubuntu-trusty-go_agent.tgz |
| light-bosh-stemcell-2739-aws-xen-hvm-centos-go_agent.tgz |
| light-bosh-stemcell-2739-aws-xen-hvm-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2427-openstack-kvm-ubuntu.tgz |
| bosh-stemcell-2624-openstack-kvm-centos.tgz |
| bosh-stemcell-2624-openstack-kvm-ubuntu-lucid.tgz |
| bosh-stemcell-2739-openstack-kvm-centos-go_agent.tgz |
| bosh-stemcell-2739-openstack-kvm-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2652-openstack-kvm-ubuntu-lucid-go_agent.tgz |
| bosh-stemcell-2719.1-openstack-kvm-centos-go_agent.tgz |
| bosh-stemcell-2719.1-openstack-kvm-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.2-openstack-kvm-centos-go_agent.tgz |
| bosh-stemcell-2719.2-openstack-kvm-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.3-openstack-kvm-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2427-vcloud-esxi-ubuntu.tgz |
| bosh-stemcell-2652-vcloud-esxi-ubuntu-lucid.tgz |
| bosh-stemcell-2732-vcloud-esxi-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2710-vcloud-esxi-ubuntu-lucid-go_agent.tgz |
| bosh-stemcell-2427-vsphere-esxi-ubuntu.tgz |
| bosh-stemcell-2624-vsphere-esxi-centos.tgz |
| bosh-stemcell-2739-vsphere-esxi-centos-go_agent.tgz |
| bosh-stemcell-2427-vsphere-esxi-ubuntu-go_agent.tgz |
| bosh-stemcell-2710-vsphere-esxi-ubuntu-lucid-go_agent.tgz |
| bosh-stemcell-2624-vsphere-esxi-ubuntu-lucid.tgz |
| bosh-stemcell-2739-vsphere-esxi-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.1-vsphere-esxi-centos-go_agent.tgz |
| bosh-stemcell-2719.1-vsphere-esxi-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.2-vsphere-esxi-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-2719.2-vsphere-esxi-centos-go_agent.tgz |
| bosh-stemcell-2719.3-vsphere-esxi-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-370-warden-boshlite-ubuntu-trusty-go_agent.tgz |
| bosh-stemcell-53-warden-boshlite-ubuntu.tgz |
| bosh-stemcell-370-warden-boshlite-centos-go_agent.tgz |
| bosh-stemcell-64-warden-boshlite-ubuntu-lucid-go_agent.tgz |
+-----------------------------------------------------------------+
  选择合适的版本下载

bosh download public stemcell bosh-stemcell-2427-vsphere-esxi-ubuntu.tgz
  等待下载完成 

bosh-stemcell: 9% |ooo             | 35.9MB 128.5KB/s ETA: 00:46:51
  

2、配置vSphere
  1、新建文件夹对虚拟机分组: 从 vCenter 的导航栏中,选择“主页”(Home) ->“清单”(Inventory) ->“虚拟机和模板”(VMs and Templates) 视图,然后按如下所示创建文件夹:
http://zhangqiaoqi588.github.io/blog/images/cf/cf02-01.png
http://zhangqiaoqi588.github.io/blog/images/cf/cf02-02.png
  这些文件夹随后将用来对 BOSH 和 Cloud Foundry 的虚拟机进行分组。在上例中,“templatefolderbosh”用来存放 BOSH stemcell。“vmfolderbosh”用来存放 BOSH 节点。“templatefolder”用来存放 Cloud Foundry stemcell。“vmfolder”用来存放 Cloud Foundry 节点。
  
  2、从“主页”(Home) ->“清单”(Inventory) ->“数据存储”(Datastores) 视图中,选择NFSDataStore数据存储,并浏览该存储。
http://zhangqiaoqi588.github.io/blog/images/cf/cf02-03.png
  创建一个用来存储虚拟机的子文件夹。在本例中,我们将此子文件夹命名为“boshdeployer”。此文件夹名称将成为我们部署清单中的“disk_path”参数的值
http://zhangqiaoqi588.github.io/blog/images/cf/cf02-04.png
  

3、配置bosh模板
  进入deployments目录创建micro01的文件夹

cd ~/deployments/
mkdir micro01
  编写micro_bosh的配置文件

vim micro_bosh.yml
  一下内容可以参考

---
name: micro
network:
ip: 192.168.1.100
netmask: 255.255.255.0
gateway: 192.168.1.1
dns:
- 8.8.8.8
cloud_properties:
name: VM Network
resources:
persistent_disk: 16384
cloud_properties:
ram: 2048
disk: 16384
cpu: 2
cloud:
plugin: vsphere
properties:
agent:
ntp:
- time.bnu.edu.cn
- ntp02.las01.emcatmos.com
vcenters:
- host: 192.168.1.6
user: administrator
password: ******
datacenters:
- name: vDataCenter
vm_folder: zhangqiaoqi_CF/vm_folder
template_folder: zhangqiaoqi_CF/template_folder
disk_path: boshdeployer
datastore_pattern: NFSDataStore
persistent_datastore_pattern: NFSDataStore
allow_mixed_datastores: true
clusters:
- vCluster
  检测配置文件是否正确

bosh micro deployment ~/deployments/micro01
WARNING! Your target has been changed to `https://192.168.1.203:25555'!
Deployment set to '/home/base/deployments/micro01/micro_bosh.yml'
  

3、部署 micro—bosh

bosh micro deploy ~/stemcells/bosh-stemcell-2427-vsphere-esxi-ubuntu.tgz
Deploying new micro BOSH instance `micro01/micro_bosh.yml' to `https://192.168.1.203:25555' (type 'yes' to continue): yes
Verifying stemcell...
File exists and readable OK
Verifying tarball...
Read tarball OK
Manifest exists OK
Stemcell image file OK
Stemcell properties OK
Stemcell info
-------------
Name: bosh-vsphere-esxi-ubuntu
Version: 2427
Started deploy micro bosh
Started deploy micro bosh > Unpacking stemcell. Done (00:00:05)
Started deploy micro bosh > Uploading stemcellat depth 0 - 20: unable to get local issuer certificate
at depth 0 - 20: unable to get local issuer certificate
. Done (00:00:38)
Started deploy micro bosh > Creating VM from sc-10f0b41d-d477-49b7-a9bd-d4ac150d5549at depth 0 - 20: unable to get local issuer certificate
at depth 0 - 20: unable to get local issuer certificate
. Done (00:03:57)
Started deploy micro bosh > Waiting for the agentat depth 0 - 20: unable to get local issuer certificate
. Done (00:00:49)
Started deploy micro bosh > Updating persistent disk
Started deploy micro bosh > Create disk. Done (00:00:00)at depth 0 - 20: unable to get local issuer certificate
at depth 0 - 20: unable to get local issuer certificate
at depth 0 - 20: unable to get local issuer certificate
Started deploy micro bosh > Mount disk. Done (00:00:11)
Done deploy micro bosh > Updating persistent disk (00:00:27)
Started deploy micro bosh > Stopping agent services. Done (00:00:01)
Started deploy micro bosh > Applying micro BOSH specat depth 0 - 20: unable to get local issuer certificate
. Done (00:00:57)
Started deploy micro bosh > Starting agent services. Done (00:00:00)
Started deploy micro bosh > Waiting for the directorat depth 0 - 20: unable to get local issuer certificate
. Done (00:00:17)
Done deploy micro bosh (00:07:11)
Deployed `micro01/micro_bosh.yml' to `https://192.168.1.203:25555', took 00:07:11 to complete
  
  
页: [1]
查看完整版本: vSphere部署Cloud Foundry V2 (3) ---- micro bosh 部署