使用bosh 安装cpi (director)虚机从而实现对vcenter的管理
1、下载已经制作好的客户端环境docker镜像并运行并进入
docker pull registry.cn-shenzhen.aliyuncs.com/shine_fei/bosh:6.4.3.2
docker run -d --name boshclient registry.cn-shenzhen.aliyuncs.com/shine_fei/bosh:6.4.3.2
docker exec -it boshclient /bin/bash
cd /root/bosh-1
2、根据自己的vcenter信息修改并执行,从而创建cpi 机器来管理vcenter
bosh create-env bosh-deployment/bosh.yml \
--state=state.json \
--vars-store=creds.yml \
-o bosh-deployment/vsphere/cpi.yml \
-v director_name=bosh-1 \
-v internal_cidr=192.168.0.0/24 \
-v internal_gw=192.168.0.1 \
-v internal_ip=192.168.0.162 \
-v network_name="portgoup1" \
-v vcenter_dc=Datacenter \
-v vcenter_ds=datastore1 \
-v vcenter_ip=192.168.0.204 \
-v vcenter_user=administrator@vsphere.local \
-v vcenter_password='password' \
-v vcenter_templates=bosh-1-templates \
-v vcenter_vms=bosh-1-vms \
-v vcenter_disks=bosh-1-disks \
-v vcenter_cluster=ruichang
3、连接bosh cpi
# Configure local alias
bosh alias-env bosh-1 -e 192.168.0.162 --ca-cert <(bosh int ./creds.yml --path /director_ssl/ca)
# Log in to the Director
export BOSH_CLIENT=admin
export BOSH_CLIENT_SECRET=`bosh int ./creds.yml --path /admin_password`
# Query the Director for more info
bosh -e bosh-1 env
4、卸载安装
注意:如果使用该cpi部署过deployment,请先通过该cpi删除掉相关的deployment。
bosh delete-env bosh-deployment/bosh.yml \
--state=state.json \
--vars-store=creds.yml \
-o bosh-deployment/vsphere/cpi.yml \
-v director_name=bosh-1 \
-v internal_cidr=192.168.0.0/24 \
-v internal_gw=192.168.0.1 \
-v internal_ip=192.168.0.162 \
-v network_name="portgoup1" \
-v vcenter_dc=Datacenter \
-v vcenter_ds=datastore1 \
-v vcenter_ip=192.168.0.204 \
-v vcenter_user=administrator@vsphere.local \
-v vcenter_password='password' \
-v vcenter_templates=bosh-1-templates \
-v vcenter_vms=bosh-1-vms \
-v vcenter_disks=bosh-1-disks \
-v vcenter_cluster=ruichang
参考官方文档
https://bosh.io/docs/init-vsphere/