bosh_vcloud_cpi 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c608586130394ee017d5d2eb63700ce63826aef
4
- data.tar.gz: 5168386f10ca6b36060da0001a1f8363c37ecb2c
3
+ metadata.gz: 4a78d3ecf8e961821180d301cb22fcee8a6a3d2c
4
+ data.tar.gz: bc414b5280ac52c0addf1fe754830b3dd856369d
5
5
  SHA512:
6
- metadata.gz: 05c93554f01ed00e7128a515da7ad005cc6a6faa3c1d4026b2e2f6fb2849ff4b2b9dc7d38be3a1119ba0593f84b462429554cc7cd083ba906ff0d94e467960d1
7
- data.tar.gz: 3cb633a4b8a91a0ebc25850b43d493df15fd35c8597bf4af74e1e49ef0d9acc0f7e393deee8c65f0375d7e790d8f545e3b90f4fef34c090a313ed8f59a33cd8f
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
- A BOSH CPI implementation for a vCloud Director backed infrastructure cloud.
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: <VCD url> (e.g. http://1.2.3.4)
17
- user: <VCD user> (e.g. orgadmin)
18
- password: <>
13
+ - url:
14
+ user:
15
+ password:
19
16
  entities:
20
- organization: <Organization name>
21
- virtual_datacenter: <VDC name>
22
- vapp_catalog: <Organization catalog name>
23
- media_catalog: <Organization catalog name>
24
- vm_metadata_key: cf-agent-env
25
- description: <Text associated with Cloud Foundry VMs>
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 BOSH deployment manifest:
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 # An internal name for the network in your manifest file
80
+ - name: default
43
81
  subnets:
44
- - reserved:
45
- - 10.146.21.129 - 10.146.21.150
82
+ - reserved:
83
+ - 192.168.21.129 - 192.168.21.150
46
84
  static:
47
- - 10.146.21.151 - 10.146.21.189
48
- range: 10.146.21.128/25
49
- gateway: 10.146.21.253
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
- - 10.132.71.1
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://10.146.21.135
60
- user: dev_mgr
61
- password: vmware
97
+ url: https://192.168.10.1
98
+ user: dev
99
+ password: pwd
62
100
  entities:
63
101
  organization: dev
64
- virtual_datacenter: tempest
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
- vapp = state[:vapp]
26
- if vapp
27
- @logger.debug "Requesting vApp: #{vapp.name}"
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 vapp.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
@@ -2,7 +2,7 @@ module Bosh
2
2
  module Clouds
3
3
 
4
4
  class VCloud
5
- VERSION = '1.5.0.pre.3'
5
+ VERSION = '0.5.3'
6
6
  end
7
7
 
8
8
  end
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.2
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-02-25 00:00:00.000000000 Z
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
- 5ea4fb
113
+ dff08c
114
114
  email: support@cloudfoundry.com
115
115
  executables: []
116
116
  extensions: []