Skip to content

Commit

Permalink
New vSphere CPI Subkit
Browse files Browse the repository at this point in the history
  • Loading branch information
xiujiao authored and jhunt committed Oct 30, 2017
1 parent 55f7d02 commit 051a23b
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 13 deletions.
9 changes: 4 additions & 5 deletions base/0-bosh-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: bosh

releases:
- name: bosh
version: "262.3"
url: https://s3.amazonaws.com/bosh-compiled-release-tarballs/bosh-262.3-ubuntu-trusty-3421.9-20170706-183731-831697577-20170706183736.tgz?versionId=7GmwKfufgb5JwWhJ.cwIWLnejOtm2Hu4
sha1: 1eae3f06282417e54ebb199656458f9d6c38e2af
version: "263.2.0"
url: https://s3.amazonaws.com/bosh-compiled-release-tarballs/bosh-263.2.0-ubuntu-trusty-3445.7-20170915-052445-759948783-20170915052451.tgz?versionId=3kjVQuRK7JyrnbKEbKhLRi7qyo0wBXZJ
sha1: 37630c636a030454d55703cfdd495d733525353f

resource_pools:
- name: vms
Expand Down Expand Up @@ -39,7 +39,6 @@ instance_groups:
- {name: director, release: bosh}
- {name: health_monitor, release: bosh}
resource_pool: vms
persistent_disk_pool: disks
networks:
- name: default
static_ips: [((internal_ip))]
Expand Down Expand Up @@ -104,7 +103,7 @@ instance_groups:

cloud_provider:
mbus: https://mbus:((mbus_bootstrap_password))@((internal_ip)):6868
cert: ((mbus_bootstrap_ssl))
certificate: ((mbus_bootstrap_ssl))
properties:
agent: {mbus: "https://mbus:((mbus_bootstrap_password))@0.0.0.0:6868"}
blobstore: {provider: local, path: /var/vcap/micro_bosh/data/cache}
Expand Down
6 changes: 0 additions & 6 deletions base/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ instance_groups:
- (( replace ))
- name: (( grab params.bosh_network ))
static_ips: [(( grab params.static_ip ))]
persistent_disk_pool: (( grab params.bosh_disk_pool ))
vm_type: (( grab params.bosh_vm_type ))

meta:
Expand Down Expand Up @@ -56,11 +55,6 @@ update:
update_watch_time: 30000-120000
serial: true

releases:
- name: bosh
url: (( concat "https://bosh.io/d/github.com/cloudfoundry/bosh?v=" releases.bosh.version ))
sha1: 31d2912d4320ce6079c190f2218c6053fd1e920f

stemcells:
- alias: default
os: (( grab params.stemcell_os ))
Expand Down
1 change: 1 addition & 0 deletions hooks/subkit
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ for kit in $@; do
;;
vsphere-cpi)
CPI=$kit
CPI_INIT=vsphere-init
;;
vcloud-cpi)
CPI=$kit
Expand Down
37 changes: 36 additions & 1 deletion kit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,41 @@ params:
param: aws_security_groups
type: list

vsphere-cpi:
- ask: What is your vSphere user name?
description: The vSphere user name is used to authenticate BOSH to vSphere services
vault: vsphere:user
- ask: What is your vSphere password?
description: The vSphere password is used to authenticate BOSH to vSphere services
vault: vsphere:password
- ask: What is your vCenter host IP address?
description: The vCenter host address is where you can access all the serviced provided by vSphere
vault: vsphere:address
- ask: What is your vSphere Datacenter Name?
description: Bosh needs the name of vSphere datacenter it is placed to
param: vsphere_datacenter
- ask: What are your vSphere Clusters?
description: Bosh needs the name of at least one vSphere cluster to deploy to?
param: vsphere_clusters
type: list
min_count: 1
- ask: What are your vSphere Ephemeral Datastores pattern?
description: Bosh uses ephemeral disk for the operating system and swap disk
param: vsphere_ephemeral_datastores
type: list
- ask: What are your vSphere Persistent Datastores pattern?
description: BOSH uses persistent disks to store data that needs to survive redeploy
param: vsphere_persistent_datastores
type: list

vsphere-init:
- ask: What is your vSphere network name used for the BOSH?
description: Name of your vSphere network that BOSH being deployed to
param: vsphere_network
- ask: What is the vSphere persistent disk type that BOSH will use?
description: Persistent Disk Type for disk pool which will be used by BOSH to store data for successful redeploy
param: vsphere_disk_type

google-cpi:
- ask: What are your GCP credentials?
description: The json key to authenticate to GCP
Expand Down Expand Up @@ -198,7 +233,7 @@ params:

- ask: What is BOSH's default gateway?
description:
This is the default gateway for the subnet that BOSh is deployed on
This is the default gateway for the subnet that BOSH is deployed on
example: 10.0.1.1
param: default_gateway

Expand Down
3 changes: 2 additions & 1 deletion subkits/bosh-init/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ instance_groups:
- name: bosh
resource_pool: (( grab params.bosh_vm_type ))
vm_type: (( prune ))
persistent_disk_pool: (( grab params.bosh_disk_pool ))

networks:
- name: (( grab params.bosh_network ))
Expand All @@ -26,7 +27,7 @@ networks:

cloud_provider:
mbus: (( concat "https://mbus:" meta.mbus_bootstrap_password "@" params.static_ip ":6868" ))
cert: (( vault meta.vault "/ssl/mbus:certificate" ))
certificate: (( vault meta.vault "/ssl/mbus:certificate" ))

properties:
agent:
Expand Down
7 changes: 7 additions & 0 deletions subkits/vsphere-cpi/params.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
params:
vsphere_ephemeral_datastores: (( param "Enter your vSphere ephemeral datastore pattern" ))
vsphere_persistent_datastores: (( param "Enter your vSphere persistent datastore pattern" ))
vsphere_clusters: (( param "Enter your vSphere clusters" ))
vsphere_datacenter: (( param "Enter your vSphere Datacenter Name" ))

45 changes: 45 additions & 0 deletions subkits/vsphere-cpi/vsphere.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
meta:
vm_folder: (( concat params.env "/vms" ))
template_folder: (( concat params.env "/templates" ))
disk_path: (( concat params.env "/disks" ))

joined_vsphere_ephemeral_datastores: (( join "|" params.vsphere_ephemeral_datastores ))
vsphere_ephemeral_datastores: (( concat "^(" meta.joined_vsphere_ephemeral_datastores ")$" ))
joined_vsphere_persistent_datastores: (( join "|" params.vsphere_persistent_datastores ))
vsphere_persistent_datastores: (( concat "^(" meta.joined_vsphere_persistent_datastores ")$" ))

instance_groups:
- name: bosh
jobs:
- name: vsphere_cpi
release: bosh-vsphere-cpi
# In cloud config, define a disk_type using name: bosh
persistent_disk_type: bosh
# In cloud config, define a vm_type using name: small
vm_type: small

properties:
vcenter:
user: (( vault meta.vault "/vsphere:user" ))
password: (( vault meta.vault "/vsphere:password" ))
address: (( vault meta.vault "/vsphere:address" ))
datacenters:
- name: (( grab params.vsphere_datacenter ))
vm_folder: (( grab meta.vm_folder ))
template_folder: (( grab meta.template_folder ))
disk_path: (( grab meta.disk_path ))
datastore_pattern: (( grab meta.vsphere_ephemeral_datastores ))
persistent_datastore_pattern: (( grab meta.vsphere_persistent_datastores ))
clusters: (( grab params.vsphere_clusters ))

director:
cpi_job: vsphere_cpi

releases:
- name: bosh-vsphere-cpi
version: 45
sha1: b5f3c53c800d6c8a9182b263ec239a952f33ba67
url: https://bosh.io/d/github.com/cloudfoundry-incubator/bosh-vsphere-cpi-release?v=45

variables: []
28 changes: 28 additions & 0 deletions subkits/vsphere-init/init.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
resource_pools:
- name: (( grab params.bosh_vm_type ))
cloud_properties:
cpu: (( grab params.vsphere_cpu ))
ram: (( grab params.vsphere_ram ))
disk: (( grab params.vsphere_disk ))
stemcell: (( grab meta.latest_stemcells.bosh-vsphere-esxi-ubuntu-trusty-go_agent ))

networks:
- name: (( grab params.bosh_network ))
subnets:
- (( inline ))
- cloud_properties:
name: (( grab params.vsphere_network ))

disk_pools:
- name: (( grab params.bosh_disk_pool ))
cloud_properties:
type: (( grab params.vsphere_disk_type ))

cloud_provider:
template:
name: vsphere_cpi
release: bosh-vsphere-cpi

properties:
vcenter: (( grab instance_groups.bosh.properties.vcenter ))
8 changes: 8 additions & 0 deletions subkits/vsphere-init/params.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
params:
vsphere_cpu: 2
vsphere_ram: 4096
vsphere_disk: 40960

vsphere_network: (( param "Enter the vSphere network name" ))
vsphere_disk_type: (( param "Enthe the vSphere persistent disk type for disk pool" ))

0 comments on commit 051a23b

Please sign in to comment.