这里首先说明下stemcell和release的版本非常关键
ruby的版本用最新的2.1的,同样的配置都是错误。尽量用1.9.3版本的
首先登录到microbosh上
root@neal-Lenovo-Product:~/deployments# bosh target https://10.0.0.8:25555
Target set to `micro01'
Your username: admin
Enter password: *****
Logged in as `admin'
首先上传stemcells
root@neal-Lenovo-Product:~/deployments# bosh upload stemcell ~/stemcells/bosh-stemcell-2131-vsphere-esxi-ubuntu.tgz
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: 2131
Checking if stemcell already exists...
No
Uploading stemcell...
bosh-stemcell: 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooo| 392.7MB 10.6MB/s Time: 00:00:37
Director task 1
Update stemcell
extracting stemcell archive (00:00:05)
verifying stemcell manifest (00:00:00)
checking if this stemcell already exists (00:00:00)
uploading stemcell bosh-vsphere-esxi-ubuntu/2131 to the cloud (00:01:18)
save stemcell bosh-vsphere-esxi-ubuntu/2131 (sc-e2013817-e635-4583-847b-9b7863419fc6) (00:00:00)
Done 5/5 00:01:23
Task 1 done
Started 2014-03-11 01:37:46 UTC
Finished 2014-03-11 01:39:09 UTC
Duration 00:01:23
Stemcell uploaded and created.
下载boshrelease,create new release并上传
root@neal-Lenovo-Product:~# git clone https://github.com/cloudfoundry/bosh.git
root@neal-Lenovo-Product:~# ls
bosh deployments stemcells
root@neal-Lenovo-Product:~/bosh/release# bosh upload releases/bosh-42.yml
Copying packages
----------------
nginx (3) FOUND REMOTE
Downloading d6fd3f7a-11c7-43e1-a667-a01405011540...
genisoimage (3) FOUND REMOTE
Downloading d1db473c-621a-434d-a3ee-1900dc35ba29...Building tarball
----------------
Generated /tmp/d20140311-9596-r8gtd9/d20140311-9596-1j6l7qa/release.tgz
Release size: 124.1M
Verifying release...
File exists and readable OK
...............
Done 8/8 00:00:01
Release has been created
bosh/42 (00:00:00)
Done 1/1 00:00:00
Task 2 done
Started 2014-03-11 02:41:03 UTC
Duration 00:00:05
查看上传的stemcells和releases的名字和版本,以及micro的uuid。这些将在bosh的配置文件中制定。
root@neal-Lenovo-Product:~/bosh/release# bosh stemcells
+--------------------------+---------+-----------------------------------------+
| Name | Version | CID |
+--------------------------+---------+-----------------------------------------+
| bosh-vsphere-esxi-ubuntu | 2131 | sc-e2013817-e635-4583-847b-9b7863419fc6 |
+--------------------------+---------+-----------------------------------------+
(*) Currently in-use
root@neal-Lenovo-Product:~/bosh/release# bosh releases
+------+----------+-------------+
| Name | Versions | Commit Hash |
+------+----------+-------------+
| bosh | 42 | bee75ed2+ |
+------+----------+-------------+
(+) Uncommitted changes
Releases total: 1
root@neal-Lenovo-Product:~/bosh/release# bosh status
Director
Name micro01
URL https://10.0.0.8:25555
Version 1.2131.0 (release:bee75ed2 bosh:bee75ed2)
User admin
UUID 76a6f66f-0530-47ad-abab-3e68efd7df94
CPI vsphere
dns enabled (domain_name: microbosh)
compiled_package_cache disabled
snapshots disabled
Deployment
not set
Release
dev boshdev
final bosh/43
编写bosh配置文件
root@neal-Lenovo-Product:~/deployments# vi bosh.yml
---
name: bosh
director_uuid: 76a6f66f-0530-47ad-abab-3e68efd7df94
release:
name: bosh
version: 42
networks:
- name: default
subnets:
- reserved:
- 10.0.0.100 - 10.0.0.254
- 10.0.0.21 - 10.0.0.26
static:
- 10.0.0.12 - 10.0.0.20
range: 10.0.0.0/24
gateway: 10.0.0.1
dns:
- 192.168.1.1
cloud_properties:
name: VM Network
resource_pools:
- name: small
stemcell:
name: bosh-vsphere-esxi-ubuntu
version: 2131
network: default
size: 5
cloud_properties:
ram: 512
disk: 20480
cpu: 1
- name: director
stemcell:
name: bosh-vsphere-esxi-ubuntu
version: 2131
network: default
size: 1
cloud_properties:
ram: 1024
disk: 81920
cpu: 2
compilation:
workers: 1
network: default
cloud_properties:
ram: 1024
disk: 4048
cpu: 2
update:
canaries: 1
canary_watch_time: 60000
update_watch_time: 60000
max_in_flight: 1
max_errors: 1
jobs:
- name: nats
template: nats
instances: 1
resource_pool: small
networks:
- name: default
static_ips:
- 10.0.0.17
- name: postgres
template: postgres
instances: 1
resource_pool: small
persistent_disk: 2048
networks:
- name: default
static_ips:
- 10.0.0.12
- name: redis
template: redis
instances: 1
resource_pool: small
networks:
- name: default
static_ips:
- 10.0.0.13
- name: director
template: director
instances: 1
resource_pool: director
persistent_disk: 2048
networks:
- name: default
static_ips:
- 10.0.0.14
- name: blobstore
template: blobstore
instances: 1
resource_pool: small
persistent_disk: 20480
networks:
- name: default
static_ips:
- 10.0.0.15
- name: health_monitor
template: health_monitor
instances: 1
resource_pool: small
networks:
- name: default
static_ips:
- 10.0.0.16
properties:
env:
blobstore:
address: 10.0.0.15
port: 25251
backend_port: 25552
agent:
user: root
password: password
director:
user: root
password: password
networks:
apps: default
management: default
nats:
user: nats
password: NatS
address: 10.0.0.17
port: 4222
postgres:
user: root
password: password
address: 10.0.0.12
port: 5432
database: bosh
redis:
address: 10.0.0.13
port: 25255
password: password
director:
name: bosh_director
address: 10.0.0.14
port: 25555
encryption: false
db:
host: 10.0.0.12
user: root
password: password
hm:
http:
port: 25923
user: root
password: password
director_account:
user: root
password: password
intervals:
poll_director: 60
poll_grace_period: 30
log_stats: 300
analyze_agents: 60
agent_timeout: 180
rogue_agent_alert: 180
loglevel: info
email_notifications: false
email_recipients:
- admin@vmware.com
smtp:
from: admin@vmware.com
host: smtp.vmware.com
port: 25
auth: plain
user: root
password: password
domain: localdomain
tsdb_enabled: false
tsdb:
address: 10.0.0.18
port: 4242
vcenter:
address: 10.0.0.233
user: administrator
password: Passw0rd
datacenters:
- name: newdatacenter
vm_folder: vm_folder
template_folder: template_folder
disk_path: bosh
datastore_pattern: NFS
persistent_datastore_pattern: NFS
allow_mixed_datastores: true
clusters:
- newcluster
检测部署文件有无语法错误,并指定配置文件
root@neal-Lenovo-Product:~/deployments# bosh deployment bosh.yml
Deployment set to `/root/deployments/bosh.yml'
root@root:~/deployments# bosh deploy
Getting deployment properties from director...
Unable to get properties list from director, trying without it...
Compiling deployment manifest...
Cannot get current deployment information from director, possibly a new deployment
Please review all changes carefully
Deploying `bosh2.yml' to `micro01' (type 'yes' to continue): yes
Director task 4
Preparing deployment
binding deployment (00:00:00)
binding releases (00:00:00)
.....................................
Preparing package compilation
Compiling packages
genisoimage/3 (00:03:29)
nginx/3 |o | 1/10 00:04:51 ETA: 00:29:58
nginx/3 (00:02:16)
......................................
Preparing configuration
binding configuration (00:00:01)
Done 1/1 00:00:01
Started updating job nats
Started updating job nats: nats/0 (canary)
Done updating job nats: nats/0 (canary) (00:01:13)
Done updating job nats (00:01:13)
Started updating job postgres
Started updating job postgres: postgres/0 (canary)
Done updating job postgres: postgres/0 (canary) (00:01:28)
Done updating job postgres (00:01:28)
Started updating job redis
Started updating job redis: redis/0 (canary)
Done updating job redis: redis/0 (canary) (00:01:08)
Done updating job redis (00:01:08)
Started updating job director
Started updating job director: director/0 (canary)
Done updating job director: director/0 (canary) (00:01:37)
Done updating job director (00:01:37)
Started updating job blobstore
Started updating job blobstore: blobstore/0 (canary)
Done updating job blobstore: blobstore/0 (canary) (00:01:33)
Done updating job blobstore (00:01:33)
Started updating job health_monitor
Started updating job health_monitor: health_monitor/0 (canary)
Done updating job health_monitor: health_monitor/0 (canary) (00:01:09)
Done updating job health_monitor (00:01:09)
Task 5 done
Started 2014-03-12 05:15:26 UTC
Finished 2014-03-12 05:42:10 UTC
Duration 00:26:44
Deployed `bosh2.yml' to `micro02'
查看虚拟机的状态
root@ubutnu:~/deployments# bosh vms
Deployment `bosh2'
Director task 6
Task 6 done
+------------------+---------+---------------+-----------+
| Job/index | State | Resource Pool | IPs |
+------------------+---------+---------------+-----------+
| blobstore/0 | running | small | 10.0.0.15 |
| director/0 | running | director | 10.0.0.14 |
| health_monitor/0 | running | small | 10.0.0.16 |
| nats/0 | running | small | 10.0.0.17 |
| postgres/0 | running | small | 10.0.0.12 |
| redis/0 | running | small | 10.0.0.13 |
+------------------+---------+---------------+-----------+
VMs total: 6