forked from cloudfoundry/docs-bosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpi-config.html.md.erb
168 lines (140 loc) · 5.19 KB
/
cpi-config.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
---
title: CPI Config
---
<p class="note">Note: This feature is available with bosh-release v261+.</p>
In most cases having single Director use a single CPI and hence a single IaaS section (for example one AWS account, vSphere datacenter, or OpenStack tenant) is enough. But in some cases operator may want to rely on multiple IaaS sections to achieve necessary isolation, availability, capacity, scalability, security, and/or management needs. To address such configuration scenarios Director can be configured with multiple CPIs at runtime (instead of only allowing single CPI configuration at the deploy time).
The CPI config is a YAML file that defines multiple CPIs and properties necessary for each CPI to communicate with an appropriate IaaS section. Once CPIs are specified, operator can associate particular AZ in their cloud config to a particular CPI.
---
## <a id='update'></a> Updating and retrieving CPI config
To update CPI config on the Director use [`bosh update-cpi-config`](cli-v2.html#update-cpi-config) CLI command.
<p class="note">Note: See <a href="#example">example CPI config</a> below.</p>
<pre class="terminal">
$ bosh update-cpi-config cpis.yml
$ bosh cpi-config
Using environment '192.168.56.6' as client 'admin'
cpis:
- name: openstack-1a
type: openstack
properties:
...
- name: openstack-1b
type: openstack
properties:
...
</pre>
Once CPI config is updated AZs in the cloud config can reference specific CPI to be used during a deploy. Unlike runtime and cloud configs, CPI config is not tracked directly by the deployments and can be updated separately (useful for updating CPI credentials without forcing redeploy of all the deployments).
---
## <a id='cpis'></a> CPIs Block
**cpis** [Array, required]: Specifies the CPIs.
* **name** [String, required]: Unique name for a CPI. Example: `openstack-1a`.
* **type** [String, required]: CPI type. Director will add `_cpi` suffix to the end of the type when calling CPI binary. Example: `openstack`, `google`.
* **properties** [Hash, required]: Set of properties to provide to the CPI for each call so that CPI can authenticate and provision resources in an IaaS.
<p class="note">Note: Properties will vary depending on the CPI you're trying to use. These are the `Global Configuration` of a given CPI. See <a href="cpi-config.html#cpi-config">a complete list of the CPI properties</a>.</p>
OpenStack example:
```yaml
cpis:
- name: openstack-1a
type: openstack
properties:
auth_url: ((auth_url))
username: ((openstack_username))
api_key: ((openstack_password))
domain: ((openstack_domain))
project: ((openstack_project))
region: ((region))
default_key_name: ((default_key_name))
default_security_groups: ((default_security_groups))
human_readable_vm_names: true
```
VSphere example:
```yaml
cpis:
- name: ((vcenter_identifier))
type: vsphere
properties:
host: ((vcenter_ip))
user: ((vcenter_user))
password: ((vcenter_password))
datacenters:
- clusters:
- { ((vcenter_cluster)): {}}
datastore_pattern: ((vcenter_datastores_pattern))
disk_path: ((folder_to_put_disks_in))
name: ((vcenter_datacenter))
persistent_datastore_pattern: ((vcenter_persistent_datastores_pattern))
template_folder: ((folder_to_put_templates_in))
vm_folder: ((folder_to_put_vms_in))
```
For VSphere, if your datacenter and cluster names have spaces in them, there is no need to put quotes around them when updating your cpi-config.
---
## <a id='example'></a> Example
Example of a CPI config referencing two separate OpenStack installations:
```yaml
cpis:
- name: openstack-1a
type: openstack
properties:
api_key: ...
auth_url: ...
- name: openstack-1b
type: openstack
properties:
api_key: ...
auth_url: ...
```
AZs in cloud config can reference openstack CPIs by their given names:
```yaml
azs:
- name: z1
cpi: openstack-1a
cloud_properties:
availability_zone: us-east-1a
- name: z2
cpi: openstack-1b
cloud_properties:
availability_zone: us-east-1b
...
```
Example of a CPI config referencing two separate VSphere installations:
```yaml
cpis:
- name: vcenter-1a
type: vsphere
properties:
host: vcenter-1a-ip
user: vcenter-1a-user
password: vcenter-1a-password
datacenters:
- clusters:
- {vcenter-1a-cluster: {}}
datastore_pattern: ^(lun01|lun02|lun03|lun04|lun05)$
disk_path: vcenter-1a-disks/disks
name: vcenter-1a-datacenter
persistent_datastore_pattern: ^(lun01|lun02|lun03|lun04|lun05)$
template_folder: vcenter-1a-disks/templates
vm_folder: vcenter-1a-disks/vms
- name: vcenter-1b
type: vsphere
properties:
host: vcenter-1b-ip
user: vcenter-1b-user
password: vcenter-1b-password
datacenters:
- clusters:
- {vcenter-1b-cluster: {}}
datastore_pattern: ^(lun01|lun02|lun03|lun04|lun05)$
disk_path: vcenter-1b-disks/disks
name: vcenter-1b-datacenter
persistent_datastore_pattern: ^(lun01|lun02|lun03|lun04|lun05)$
template_folder: vcenter-1b-disks/templates
vm_folder: vcenter-1b-disks/vms
```
AZs in cloud config can reference VSphere CPIs by their given names:
```yaml
azs:
- name: z1
cpi: vcenter-1a
- name: z2
cpi: vcenter-1b
...
```