bosh_vcloud_cpi 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +69 -31
- data/lib/cloud/vcloud/steps/instantiate.rb +7 -4
- data/lib/cloud/vcloud/steps/poweron.rb +19 -0
- data/lib/cloud/vcloud/steps/recompose.rb +20 -0
- data/lib/cloud/vcloud/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a78d3ecf8e961821180d301cb22fcee8a6a3d2c
|
|
4
|
+
data.tar.gz: bc414b5280ac52c0addf1fe754830b3dd856369d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3485a56c5d4b7046bcd301f82f8f76d21a7a460ec863e7175b65d6694957b23915976c66a64d916db51238021dd77d95169c856e30ba7a8b504dd984e322a114
|
|
7
|
+
data.tar.gz: 088ebb06315d9fe0432f17cb55a94a6fafbdfa6f4ff7ba0fe4882507dd1d447a62fb7b90d5d145929e768ded0ac38fa29205fa1a2b3b5ae0593b193d18c3e53e
|
data/README.md
CHANGED
|
@@ -3,52 +3,90 @@ Copyright (c) VMware, Inc.
|
|
|
3
3
|
|
|
4
4
|
## Introduction
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Use the vSphere MicroBosh and BOSH stemcells when targetting vCloud Director.
|
|
9
|
-
|
|
6
|
+
It's a BOSH CPI implementation for a vCloud Director backed infrastructure cloud.
|
|
10
7
|
In order to target a vCloud Director instance, MicroBosh must be set to use
|
|
11
8
|
the vCloud plugin configuration as shown below:
|
|
12
9
|
|
|
13
10
|
---
|
|
14
11
|
plugin: vcloud
|
|
15
12
|
vcds
|
|
16
|
-
- url:
|
|
17
|
-
user:
|
|
18
|
-
password:
|
|
13
|
+
- url:
|
|
14
|
+
user:
|
|
15
|
+
password:
|
|
19
16
|
entities:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
organization:
|
|
18
|
+
virtual_datacenter:
|
|
19
|
+
vapp_catalog:
|
|
20
|
+
media_catalog:
|
|
21
|
+
media_storage_profile:
|
|
22
|
+
vm_metadata_key:
|
|
23
|
+
description:
|
|
24
|
+
control: #optional parameters
|
|
25
|
+
wait_max: #optional parameters
|
|
27
26
|
|
|
28
27
|
Note that vCloud Director version 5.1 or newer is required.
|
|
29
28
|
|
|
29
|
+
## Parameters
|
|
30
|
+
|
|
31
|
+
This section explains which parameters are supported in vCloud BOSH CPI.
|
|
32
|
+
|
|
33
|
+
### vCloud related
|
|
34
|
+
|
|
35
|
+
* `url` (required)
|
|
36
|
+
The endpoint of the target vCloud Director
|
|
37
|
+
* `user` (required)
|
|
38
|
+
The user name of the target vCloud Director
|
|
39
|
+
* `password` (required)
|
|
40
|
+
The password of the target vCloud Director
|
|
41
|
+
* `organization` (required)
|
|
42
|
+
The organization name
|
|
43
|
+
* `virtual_datacenter` (required)
|
|
44
|
+
The virtual data center name
|
|
45
|
+
* `vapp_catalog` (required)
|
|
46
|
+
The name of the calalog for vapp template
|
|
47
|
+
* `media_catalog` (required)
|
|
48
|
+
The name of the calalog for media files
|
|
49
|
+
* `media_storage_profile` (required)
|
|
50
|
+
The storage profile to use. You can put * here to match all the storage profiles.
|
|
51
|
+
* `vm_metadata_key` (required)
|
|
52
|
+
The key name of VM metadata
|
|
53
|
+
* `description` (required)
|
|
54
|
+
Text associated with the VMs
|
|
55
|
+
* `Control` (optional)
|
|
56
|
+
All the following control parameters are optional
|
|
57
|
+
* `wait_max` (optional)
|
|
58
|
+
Maximum wait seconds for a single CPI task
|
|
59
|
+
* `wait_delay` (optional)
|
|
60
|
+
Delay in seconds for pooling next CPI task status
|
|
61
|
+
* `cookie_timeout` (optional)
|
|
62
|
+
The cookie timeout in seconds
|
|
63
|
+
* `retry_max` (optional)
|
|
64
|
+
Maximum retry times
|
|
65
|
+
* `retry_delay` (optional)
|
|
66
|
+
The delay of first retry, the next is *2
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Network related
|
|
70
|
+
|
|
71
|
+
The network name should be specified under `cloud_properties` in the `networks` section of a BOSH deployment manifest. It should be the 'Org VDC Network' you plan to use for deployment.
|
|
72
|
+
|
|
30
73
|
|
|
31
74
|
## Example
|
|
32
75
|
|
|
33
|
-
This is a sample of how vCloud Director specific properties are used in a
|
|
76
|
+
This is a sample of how vCloud Director specific properties are used in a BOSH deployment manifest:
|
|
34
77
|
|
|
35
78
|
---
|
|
36
|
-
name: sample
|
|
37
|
-
director_uuid: 38ce80c3-e9e9-4aac-ba61-97c676631b91
|
|
38
|
-
|
|
39
|
-
...
|
|
40
|
-
|
|
41
79
|
networks:
|
|
42
|
-
- name: default
|
|
80
|
+
- name: default
|
|
43
81
|
subnets:
|
|
44
|
-
|
|
45
|
-
-
|
|
82
|
+
- reserved:
|
|
83
|
+
- 192.168.21.129 - 192.168.21.150
|
|
46
84
|
static:
|
|
47
|
-
-
|
|
48
|
-
range:
|
|
49
|
-
gateway:
|
|
85
|
+
- 192.168.21.151 - 192.168.21.189
|
|
86
|
+
range: 192.168.21.128/25
|
|
87
|
+
gateway: 192.168.21.253
|
|
50
88
|
dns:
|
|
51
|
-
-
|
|
89
|
+
- 192.168.71.1
|
|
52
90
|
cloud_properties:
|
|
53
91
|
name: "tempest_vdc_network"
|
|
54
92
|
|
|
@@ -56,12 +94,12 @@ This is a sample of how vCloud Director specific properties are used in a BOSH d
|
|
|
56
94
|
|
|
57
95
|
properties:
|
|
58
96
|
vcd:
|
|
59
|
-
url: https://
|
|
60
|
-
user:
|
|
61
|
-
password:
|
|
97
|
+
url: https://192.168.10.1
|
|
98
|
+
user: dev
|
|
99
|
+
password: pwd
|
|
62
100
|
entities:
|
|
63
101
|
organization: dev
|
|
64
|
-
virtual_datacenter:
|
|
102
|
+
virtual_datacenter: vdc
|
|
65
103
|
vapp_catalog: cloudfoundry
|
|
66
104
|
media_catalog: cloudfoundry
|
|
67
105
|
media_storage_profile: *
|
|
@@ -16,21 +16,23 @@ module VCloudCloud
|
|
|
16
16
|
params.linked_clone = false
|
|
17
17
|
params.set_locality = locality_spec template, disk_locality
|
|
18
18
|
|
|
19
|
+
state[:instantiate_vapp_name] = vapp_name
|
|
20
|
+
|
|
19
21
|
vapp = client.invoke :post, client.vdc.instantiate_vapp_template_link, :payload => params
|
|
20
22
|
|
|
21
23
|
state[:vapp] = client.wait_entity vapp
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
def rollback
|
|
25
|
-
|
|
26
|
-
if
|
|
27
|
-
@logger.debug "Requesting vApp: #{
|
|
27
|
+
vapp_name = state[:instantiate_vapp_name]
|
|
28
|
+
if vapp_name
|
|
29
|
+
@logger.debug "Requesting vApp: #{vapp_name}"
|
|
28
30
|
|
|
29
31
|
# Note that when renaming vApp, the remove_link stays the same and points to
|
|
30
32
|
# the original vApp. To avoid potential inconsistency, fetch vApp from the server.
|
|
31
33
|
begin
|
|
32
34
|
client.flush_cache # flush cached vdc which contains vapp list
|
|
33
|
-
vapp = client.vapp_by_name
|
|
35
|
+
vapp = client.vapp_by_name vapp_name
|
|
34
36
|
link = vapp.remove_link true
|
|
35
37
|
client.invoke_and_wait :delete, link if link
|
|
36
38
|
rescue => ex
|
|
@@ -39,6 +41,7 @@ module VCloudCloud
|
|
|
39
41
|
|
|
40
42
|
# remove the item from state
|
|
41
43
|
state.delete :vapp
|
|
44
|
+
state.delete :instantiate_vapp_name
|
|
42
45
|
end
|
|
43
46
|
end
|
|
44
47
|
|
|
@@ -9,9 +9,28 @@ module VCloudCloud
|
|
|
9
9
|
end
|
|
10
10
|
poweron_link = entity.power_on_link
|
|
11
11
|
raise "#{entity.name} unable to power on" unless poweron_link
|
|
12
|
+
state[:poweron_target] = state[ref]
|
|
12
13
|
client.invoke_and_wait :post, poweron_link
|
|
13
14
|
state[ref] = client.reload entity
|
|
14
15
|
end
|
|
16
|
+
|
|
17
|
+
def rollback
|
|
18
|
+
target = state[:poweron_target]
|
|
19
|
+
if target
|
|
20
|
+
begin
|
|
21
|
+
entity = client.reload target
|
|
22
|
+
if entity['status'] == VCloudSdk::Xml::RESOURCE_ENTITY_STATUS[:POWERED_OFF].to_s
|
|
23
|
+
@logger.debug "#{entity.name} already powered off"
|
|
24
|
+
return
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
poweroff_link = entity.power_off_link
|
|
28
|
+
client.invoke_and_wait :post, poweroff_link
|
|
29
|
+
rescue => ex
|
|
30
|
+
@logger.debug(ex) if @logger
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
15
34
|
end
|
|
16
35
|
end
|
|
17
36
|
end
|
|
@@ -14,6 +14,26 @@ module VCloudCloud
|
|
|
14
14
|
recompose_vapp_link = container_vapp.recompose_vapp_link true
|
|
15
15
|
client.invoke_and_wait :post, recompose_vapp_link, :payload => params
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
def rollback
|
|
19
|
+
# The recompose method is only used in create_vm step.
|
|
20
|
+
# The rollback logic here is to delete the new-created VM.
|
|
21
|
+
vm = state[:vm]
|
|
22
|
+
if vm
|
|
23
|
+
@logger.debug "Requesting VM: #{vm.name}"
|
|
24
|
+
|
|
25
|
+
begin
|
|
26
|
+
entity = client.reload vm
|
|
27
|
+
link = entity.remove_link true
|
|
28
|
+
client.invoke_and_wait :delete, link if link
|
|
29
|
+
rescue => ex
|
|
30
|
+
@logger.debug(ex) if @logger
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# remove the item from state
|
|
34
|
+
state.delete :vm
|
|
35
|
+
end
|
|
36
|
+
end
|
|
17
37
|
end
|
|
18
38
|
end
|
|
19
39
|
end
|
data/lib/cloud/vcloud/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bosh_vcloud_cpi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- VMware
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-04-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bosh_common
|
|
@@ -110,7 +110,7 @@ dependencies:
|
|
|
110
110
|
version: 1.5.6
|
|
111
111
|
description: |-
|
|
112
112
|
BOSH vCloud CPI
|
|
113
|
-
|
|
113
|
+
dff08c
|
|
114
114
|
email: support@cloudfoundry.com
|
|
115
115
|
executables: []
|
|
116
116
|
extensions: []
|