vagrant-vcloud 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -3
- data/lib/vagrant-vcloud/action/read_ssh_info.rb +2 -4
- data/lib/vagrant-vcloud/command.rb +95 -77
- data/lib/vagrant-vcloud/driver/version_5_1.rb +6 -6
- data/lib/vagrant-vcloud/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7921deee4b96c4a9dff76fd076a0976595fcf32
|
4
|
+
data.tar.gz: 228f26b02b6eb32d08d62c59500a8c9618357382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d8076e0a367c99e6a8580b2d718eb7975e42c319d390b19cd9dff0fae6b8b983a891c454dbd8ca90ff9bfc512ea3f5f522c9651038cfe6805cc60589ffb926e
|
7
|
+
data.tar.gz: 5523a1fd974ad0d5617a5bc39c662d68e94fdc0022a5ba9cb02bd8629213086a17e8c79bfe5359b144ff774cca6d455de84feaa9204d29ed99451fa0397175f7
|
data/README.md
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
[Vagrant](http://www.vagrantup.com) provider for VMware vCloud Director®
|
2
2
|
=============
|
3
3
|
|
4
|
-
[Version 0.2.
|
4
|
+
[Version 0.2.1](https://github.com/frapposelli/vagrant-vcloud/releases/tag/v0.2.1) has been released!
|
5
5
|
-------------
|
6
6
|
|
7
7
|
Please note that this software is still Alpha/Beta quality and is not recommended for production usage.
|
8
8
|
|
9
9
|
Right now a [Precise32](http://vagrant.tsugliani.fr/precise32.box) is available for use, or you can roll your own as you please, make sure to install VMware tools in it.
|
10
10
|
|
11
|
+
Features of Version 0.2.1 are:
|
12
|
+
|
13
|
+
- Critical Bugfixes
|
14
|
+
|
11
15
|
Features of Version 0.2.0 are:
|
12
16
|
|
13
|
-
- It's now possible to connect to an existing VDC network without creating a vShield Edge [ISSUE #23].
|
17
|
+
- It's now possible to connect to an existing VDC network without creating a vShield Edge using ```network_bridge = true``` in the Vagrantfile [ISSUE #23]. *experimental*
|
14
18
|
- Added a ```upload_chunksize``` parameter to specify the chunk dimension during box uploads [ISSUE #21].
|
15
19
|
- Added support for [vCloud® Hybrid Service™](http://www.vmware.com/products/vcloud-hybrid-service) API version 5.7.
|
16
20
|
- Added a new command to vagrant called ```vcloud-status``` that shows the current status of the vCloud instance relative to the Vagrant deployment. *experimental*
|
@@ -118,4 +122,4 @@ Vagrant.configure("2") do |config|
|
|
118
122
|
end
|
119
123
|
```
|
120
124
|
|
121
|
-
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/frapposelli/vagrant-vcloud/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
125
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/frapposelli/vagrant-vcloud/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
@@ -46,12 +46,10 @@ module VagrantPlugins
|
|
46
46
|
else
|
47
47
|
|
48
48
|
@logger.debug('Getting port forwarding rules...')
|
49
|
-
rules = cnx.get_vapp_port_forwarding_rules(
|
49
|
+
rules = cnx.get_vapp_port_forwarding_rules(vapp_id)
|
50
50
|
|
51
51
|
rules.each do |rule|
|
52
|
-
if rule[:vapp_scoped_local_id] == myhash[:vapp_scoped_local_id]
|
53
|
-
&& rule[:nat_internal_port] == '22'
|
54
|
-
|
52
|
+
if rule[:vapp_scoped_local_id] == myhash[:vapp_scoped_local_id] && rule[:nat_internal_port] == '22'
|
55
53
|
@external_ip = rule[:nat_external_ip]
|
56
54
|
@external_port = rule[:nat_external_port]
|
57
55
|
break
|
@@ -87,92 +87,110 @@ module VagrantPlugins
|
|
87
87
|
# FIXME: this needs to be fixed to accomodate the bridged scenario
|
88
88
|
# potentially showing only the assigned IPs in the VMs
|
89
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
|
-
|
90
|
+
if !cfg.network_bridge.nil?
|
91
|
+
|
92
|
+
# Create a new table for the network information
|
93
|
+
network_table = Terminal::Table.new
|
94
|
+
network_table.title = 'Network Map'
|
95
|
+
|
96
|
+
network_table << ['VM Name', 'IP Address', 'Connection']
|
97
|
+
network_table << :separator
|
98
|
+
|
99
|
+
# ap vapp[:vms_hash]
|
100
|
+
|
101
|
+
vapp[:vms_hash].each do |vm|
|
102
|
+
# ap vm
|
103
|
+
|
104
|
+
network_table << [vm[0], vm[1][:addresses][0], 'Direct']
|
105
|
+
end
|
106
|
+
else
|
107
|
+
|
108
|
+
vapp_edge_ip = cnx.get_vapp_edge_public_ip(vapp_id)
|
109
|
+
vapp_edge_rules = cnx.get_vapp_port_forwarding_rules(vapp_id)
|
110
|
+
edge_gateway_rules = cnx.get_edge_gateway_rules(cfg.vdc_edge_gateway,
|
111
|
+
cfg.vdc_id)
|
112
|
+
|
113
|
+
# Create a new table for the network information
|
114
|
+
network_table = Terminal::Table.new
|
115
|
+
network_table.title = 'Vagrant vCloud Director Network Map'
|
116
|
+
|
117
|
+
network_table << ['VM Name', 'Destination NAT Mapping', 'Enabled']
|
118
|
+
network_table << :separator
|
119
|
+
|
120
|
+
# Fetching Destination NAT Rules for each vApp/Edge/VM/Mapping
|
121
|
+
edge_gateway_rules.each do |edge_gateway_rule|
|
122
|
+
vapp_edge_rules.each do |vapp_edge_rule|
|
123
|
+
|
124
|
+
# Only check DNAT and src/dst
|
125
|
+
if edge_gateway_rule[:rule_type] == 'DNAT' &&
|
126
|
+
edge_gateway_rule[:original_ip] == cfg.vdc_edge_gateway_ip &&
|
127
|
+
edge_gateway_rule[:translated_ip] == vapp_edge_ip
|
128
|
+
|
129
|
+
# Loop on every VM in the vApp
|
130
|
+
vapp[:vms_hash].each do |vm|
|
131
|
+
# Only Map valid vAppEdge scope to VM scope
|
132
|
+
vm_scope = vm[1][:vapp_scoped_local_id]
|
133
|
+
vapp_edge_scope = vapp_edge_rule[:vapp_scoped_local_id]
|
134
|
+
|
135
|
+
if vm_scope == vapp_edge_scope
|
136
|
+
|
137
|
+
# Generate DNAT Mappings for the valid machines
|
138
|
+
# If rules don't match, you will not see them !
|
139
|
+
network_table << [
|
140
|
+
"#{vm[0]}",
|
141
|
+
"#{cfg.vdc_edge_gateway_ip}:" +
|
142
|
+
"#{vapp_edge_rule[:nat_external_port]}" +
|
143
|
+
" -> #{vapp_edge_ip}:" +
|
144
|
+
"#{vapp_edge_rule[:nat_external_port]}" +
|
145
|
+
" -> #{vm[1][:addresses][0]}:" +
|
146
|
+
"#{vapp_edge_rule[:nat_internal_port]}",
|
147
|
+
edge_gateway_rule[:is_enabled]
|
148
|
+
]
|
149
|
+
end
|
131
150
|
end
|
132
151
|
end
|
133
152
|
end
|
134
153
|
end
|
135
|
-
end
|
136
154
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
155
|
+
# Fetching Source NAT Rules for the vApp
|
156
|
+
network_table << :separator
|
157
|
+
network_table << ['Network Name', 'Source NAT Mapping', 'Enabled']
|
158
|
+
network_table << :separator
|
159
|
+
|
160
|
+
edge_gateway_rules.each do |edge_gateway_rule|
|
161
|
+
# Only check SNAT and src/dst
|
162
|
+
if edge_gateway_rule[:rule_type] == 'SNAT' &&
|
163
|
+
edge_gateway_rule[:original_ip] == vapp_edge_ip &&
|
164
|
+
edge_gateway_rule[:translated_ip] == cfg.vdc_edge_gateway_ip
|
165
|
+
|
166
|
+
network_table << [
|
167
|
+
edge_gateway_rule[:interface_name],
|
168
|
+
"#{vapp_edge_ip} -> #{cfg.vdc_edge_gateway_ip}",
|
169
|
+
edge_gateway_rule[:is_enabled]
|
170
|
+
]
|
171
|
+
end
|
153
172
|
end
|
154
|
-
end
|
155
173
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
174
|
+
# Fetching Edge Gateway Firewall Rules
|
175
|
+
network_table << :separator
|
176
|
+
network_table << ['Rule# - Description', 'Firewall Rules', 'Enabled']
|
177
|
+
network_table << :separator
|
178
|
+
edge_gateway_rules.each do |edge_gateway_rule|
|
179
|
+
# Only add firewall rules
|
180
|
+
if edge_gateway_rule[:rule_type] == 'Firewall'
|
181
|
+
network_table << [
|
182
|
+
"#{edge_gateway_rule[:id]} - " +
|
183
|
+
"(#{edge_gateway_rule[:description]})",
|
184
|
+
"#{edge_gateway_rule[:policy]} " +
|
185
|
+
"SRC:#{edge_gateway_rule[:source_ip]}:" +
|
186
|
+
"#{edge_gateway_rule[:source_portrange]} to " +
|
187
|
+
"DST:#{edge_gateway_rule[:destination_ip]}:" +
|
188
|
+
"#{edge_gateway_rule[:destination_portrange]}",
|
189
|
+
"#{edge_gateway_rule[:is_enabled]}"
|
190
|
+
]
|
191
|
+
end
|
173
192
|
end
|
174
193
|
end
|
175
|
-
|
176
194
|
# Print the Network Table
|
177
195
|
puts
|
178
196
|
puts network_table
|
@@ -1251,7 +1251,7 @@ module VagrantPlugins
|
|
1251
1251
|
nat_rule_1 = Nokogiri::XML::Node.new 'NatRule', response
|
1252
1252
|
rule_type = Nokogiri::XML::Node.new 'RuleType', response
|
1253
1253
|
rule_type.content = 'DNAT'
|
1254
|
-
nat_rule_1.add_child
|
1254
|
+
nat_rule_1.add_child rule_type
|
1255
1255
|
|
1256
1256
|
is_enabled = Nokogiri::XML::Node.new 'IsEnabled', response
|
1257
1257
|
is_enabled.content = 'true'
|
@@ -1268,7 +1268,7 @@ module VagrantPlugins
|
|
1268
1268
|
|
1269
1269
|
original_ip = Nokogiri::XML::Node.new 'OriginalIp', response
|
1270
1270
|
original_ip.content = edge_gateway_ip
|
1271
|
-
|
1271
|
+
gateway_nat_rule.add_child original_ip
|
1272
1272
|
|
1273
1273
|
original_port = Nokogiri::XML::Node.new 'OriginalPort', response
|
1274
1274
|
original_port.content = 'any'
|
@@ -1301,11 +1301,11 @@ module VagrantPlugins
|
|
1301
1301
|
|
1302
1302
|
is_enabled = Nokogiri::XML::Node.new 'IsEnabled', response
|
1303
1303
|
is_enabled.content = 'true'
|
1304
|
-
nat_rule_2.add_child
|
1304
|
+
nat_rule_2.add_child is_enabled
|
1305
1305
|
|
1306
1306
|
gateway_nat_rule = Nokogiri::XML::Node.new 'GatewayNatRule',
|
1307
1307
|
response
|
1308
|
-
nat_rule_2.add_child
|
1308
|
+
nat_rule_2.add_child gateway_nat_rule
|
1309
1309
|
|
1310
1310
|
interface = Nokogiri::XML::Node.new 'Interface', response
|
1311
1311
|
interface['href'] = edge_network_id
|
@@ -1314,7 +1314,7 @@ module VagrantPlugins
|
|
1314
1314
|
|
1315
1315
|
original_ip = Nokogiri::XML::Node.new 'OriginalIp', response
|
1316
1316
|
original_ip.content = edge_vapp_ip
|
1317
|
-
|
1317
|
+
gateway_nat_rule.add_child original_ip
|
1318
1318
|
|
1319
1319
|
translated_ip = Nokogiri::XML::Node.new 'TranslatedIp', response
|
1320
1320
|
translated_ip.content = edge_gateway_ip
|
@@ -1444,7 +1444,7 @@ module VagrantPlugins
|
|
1444
1444
|
|
1445
1445
|
end
|
1446
1446
|
if node.css('RuleType').text == 'SNAT'
|
1447
|
-
gw_node = node.css('
|
1447
|
+
gw_node = node.css('GatewayNatRule')
|
1448
1448
|
nat_fw_rules << {
|
1449
1449
|
:rule_type => 'SNAT',
|
1450
1450
|
:interface_name => gw_node.css('Interface').first['name'],
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Rapposelli
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|