vm_shepherd 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vm_shepherd/shepherd.rb +2 -0
- data/lib/vm_shepherd/version.rb +1 -1
- data/lib/vm_shepherd/vsphere_manager.rb +3 -3
- data/spec/fixtures/shepherd/vsphere.yml +4 -0
- data/spec/spec_helper.rb +0 -4
- data/spec/vm_shepherd/shepherd_spec.rb +4 -0
- data/vm_shepherd.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c32036e3aca4e84839df2a57544f620b8c1d29a
|
4
|
+
data.tar.gz: 1247e3b6de98c44acf42bfb39f0f1c38bbe79d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41484520464f955a1b95bd7766a34cc19789e817651ba6dcbd703c155692948db0351f397cfc6a63b417cd2468c4226e30eeef697d85cab8e62f5e92c9d5447c
|
7
|
+
data.tar.gz: ca9d0d8cd53359c809524de9d6528aeef537cc76431f8533a9ce4b4cd44a54f98da3ac8ce1a2e1e1ce2bc0dbc6fe88d76ca73212bcdeccdf2c044b2043f0282c
|
data/lib/vm_shepherd/shepherd.rb
CHANGED
@@ -52,6 +52,8 @@ module VmShepherd
|
|
52
52
|
netmask: vm_shepherd_config.dig('vm', 'netmask'),
|
53
53
|
dns: vm_shepherd_config.dig('vm', 'dns'),
|
54
54
|
ntp_servers: vm_shepherd_config.dig('vm', 'ntp_servers'),
|
55
|
+
cpus: vm_shepherd_config.dig('vm', 'cpus'),
|
56
|
+
ram_mb: vm_shepherd_config.dig('vm', 'ram_mb'),
|
55
57
|
},
|
56
58
|
{
|
57
59
|
cluster: vm_shepherd_config.dig('vsphere', 'cluster'),
|
data/lib/vm_shepherd/version.rb
CHANGED
@@ -114,7 +114,7 @@ module VmShepherd
|
|
114
114
|
def boot_vm(ovf_file_path, vm_config, vsphere_config)
|
115
115
|
datacenter.vmFolder.traverse(vsphere_config[:folder], RbVmomi::VIM::Folder, true)
|
116
116
|
template = deploy_ovf_template(ovf_file_path, vsphere_config)
|
117
|
-
vm = create_vm_from_template(template, vsphere_config)
|
117
|
+
vm = create_vm_from_template(template, vm_config, vsphere_config)
|
118
118
|
|
119
119
|
reconfigure_vm(vm, vm_config)
|
120
120
|
power_on_vm(vm)
|
@@ -202,7 +202,7 @@ module VmShepherd
|
|
202
202
|
end || fail('ERROR finding host to upload OVF to')
|
203
203
|
end
|
204
204
|
|
205
|
-
def create_vm_from_template(template, vsphere_config)
|
205
|
+
def create_vm_from_template(template, vm_config, vsphere_config)
|
206
206
|
logger.info("BEGIN clone_vm_task tempalte=#{template.name}")
|
207
207
|
template.CloneVM_Task(
|
208
208
|
folder: target_folder(vsphere_config),
|
@@ -215,7 +215,7 @@ module VmShepherd
|
|
215
215
|
},
|
216
216
|
powerOn: false,
|
217
217
|
template: false,
|
218
|
-
config: {numCPUs: 2, memoryMB: 2048},
|
218
|
+
config: {numCPUs: vm_config[:cpus] || 2, memoryMB: vm_config[:ram_mb] || 2048},
|
219
219
|
}
|
220
220
|
).wait_for_completion.tap {
|
221
221
|
logger.info("END clone_vm_task tempalte=#{template.name}")
|
@@ -18,6 +18,8 @@ vm_shepherd:
|
|
18
18
|
netmask: OVA_NETMASK
|
19
19
|
dns: OVA_DNS
|
20
20
|
ntp_servers: OVA_NTP
|
21
|
+
cpus: OVA_CPUS
|
22
|
+
ram_mb: OVA_RAM_MB
|
21
23
|
cleanup:
|
22
24
|
datacenter: VSPHERE_OTHER_DATACENTER
|
23
25
|
datastores:
|
@@ -45,6 +47,8 @@ vm_shepherd:
|
|
45
47
|
netmask: OVA_NETMASK-2
|
46
48
|
dns: OVA_DNS-2
|
47
49
|
ntp_servers: OVA_NTP-2
|
50
|
+
cpus: OVA_CPUS
|
51
|
+
ram_mb: OVA_RAM_MB
|
48
52
|
cleanup:
|
49
53
|
datacenter: VSPHERE_OTHER_DATACENTER-2
|
50
54
|
datastores:
|
data/spec/spec_helper.rb
CHANGED
@@ -2,10 +2,6 @@ SPEC_ROOT = File.expand_path(__dir__)
|
|
2
2
|
|
3
3
|
$LOAD_PATH << SPEC_ROOT
|
4
4
|
|
5
|
-
require 'codeclimate-test-reporter'
|
6
|
-
|
7
|
-
CodeClimate::TestReporter.start
|
8
|
-
|
9
5
|
RSpec.configure do |config|
|
10
6
|
config.expect_with :rspec do |expectations|
|
11
7
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
@@ -148,6 +148,8 @@ module VmShepherd
|
|
148
148
|
netmask: first_config.dig('vm', 'netmask'),
|
149
149
|
dns: first_config.dig('vm', 'dns'),
|
150
150
|
ntp_servers: first_config.dig('vm', 'ntp_servers'),
|
151
|
+
cpus: first_config.dig('vm', 'cpus'),
|
152
|
+
ram_mb: first_config.dig('vm', 'ram_mb'),
|
151
153
|
},
|
152
154
|
{
|
153
155
|
cluster: first_config.dig('vsphere', 'cluster'),
|
@@ -166,6 +168,8 @@ module VmShepherd
|
|
166
168
|
netmask: last_config.dig('vm', 'netmask'),
|
167
169
|
dns: last_config.dig('vm', 'dns'),
|
168
170
|
ntp_servers: last_config.dig('vm', 'ntp_servers'),
|
171
|
+
cpus: last_config.dig('vm', 'cpus'),
|
172
|
+
ram_mb: last_config.dig('vm', 'ram_mb'),
|
169
173
|
},
|
170
174
|
{
|
171
175
|
cluster: last_config.dig('vsphere', 'cluster'),
|
data/vm_shepherd.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vm_shepherd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ops Manager Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-v1
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: codeclimate-test-reporter
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
139
|
description: A tool for booting and tearing down Ops Manager VMs on various Infrastructures.
|
154
140
|
email:
|
155
141
|
- cf-tempest-eng@pivotal.io
|