fog-vsphere 1.7.0 → 1.7.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -1
  3. data/.rubocop.yml +8 -0
  4. data/.rubocop_todo.yml +217 -0
  5. data/.travis.yml +6 -7
  6. data/CHANGELOG.md +2 -6
  7. data/CONTRIBUTORS.md +10 -0
  8. data/Rakefile +10 -1
  9. data/lib/fog/vsphere/compute.rb +0 -2
  10. data/lib/fog/vsphere/models/compute/scsicontroller.rb +1 -6
  11. data/lib/fog/vsphere/models/compute/server.rb +7 -29
  12. data/lib/fog/vsphere/models/compute/ticket.rb +16 -0
  13. data/lib/fog/vsphere/models/compute/tickets.rb +25 -0
  14. data/lib/fog/vsphere/models/compute/volume.rb +28 -46
  15. data/lib/fog/vsphere/models/compute/volumes.rb +1 -1
  16. data/lib/fog/vsphere/requests/compute/create_vm.rb +44 -32
  17. data/lib/fog/vsphere/requests/compute/host_finish_maintenance.rb +14 -0
  18. data/lib/fog/vsphere/requests/compute/host_shutdown.rb +14 -0
  19. data/lib/fog/vsphere/requests/compute/host_start_maintenance.rb +14 -0
  20. data/lib/fog/vsphere/requests/compute/list_vm_scsi_controllers.rb +11 -4
  21. data/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +1 -2
  22. data/lib/fog/vsphere/requests/compute/modify_vm_controller.rb +14 -2
  23. data/lib/fog/vsphere/requests/compute/modify_vm_volume.rb +3 -3
  24. data/lib/fog/vsphere/requests/compute/vm_acquire_ticket.rb +34 -0
  25. data/lib/fog/vsphere/requests/compute/vm_reconfig_volumes.rb +15 -26
  26. data/lib/fog/vsphere/requests/compute/vm_relocate.rb +54 -0
  27. data/lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb +29 -0
  28. data/lib/fog/vsphere/requests/compute/vm_rename.rb +24 -0
  29. data/lib/fog/vsphere/requests/compute/vm_revert_snapshot.rb +29 -0
  30. data/lib/fog/vsphere/requests/compute/vm_suspend.rb +54 -0
  31. data/lib/fog/vsphere/version.rb +1 -1
  32. data/tests/class_from_string_tests.rb +3 -3
  33. data/tests/compute_tests.rb +16 -17
  34. data/tests/helpers/mock_helper.rb +3 -3
  35. data/tests/models/compute/cluster_tests.rb +4 -5
  36. data/tests/models/compute/hosts_tests.rb +2 -4
  37. data/tests/models/compute/rules_tests.rb +10 -16
  38. data/tests/models/compute/server_tests.rb +33 -29
  39. data/tests/models/compute/servers_tests.rb +2 -4
  40. data/tests/models/compute/ticket_tests.rb +12 -0
  41. data/tests/models/compute/tickets_tests.rb +8 -0
  42. data/tests/requests/compute/current_time_tests.rb +2 -4
  43. data/tests/requests/compute/folder_destroy_tests.rb +5 -7
  44. data/tests/requests/compute/get_network_tests.rb +18 -22
  45. data/tests/requests/compute/list_child_snapshots_tests.rb +1 -2
  46. data/tests/requests/compute/list_clusters_tests.rb +5 -6
  47. data/tests/requests/compute/list_datastores_tests.rb +6 -7
  48. data/tests/requests/compute/list_hosts_tests.rb +3 -4
  49. data/tests/requests/compute/list_networks_tests.rb +6 -7
  50. data/tests/requests/compute/list_storage_pods_test.rb +3 -4
  51. data/tests/requests/compute/list_virtual_machines_tests.rb +16 -20
  52. data/tests/requests/compute/list_vm_cdroms_tests.rb +1 -2
  53. data/tests/requests/compute/list_vm_snapshots_tests.rb +1 -2
  54. data/tests/requests/compute/modify_vm_cdrom_tests.rb +3 -4
  55. data/tests/requests/compute/revert_to_snapshot_tests.rb +2 -4
  56. data/tests/requests/compute/set_vm_customvalue_tests.rb +0 -2
  57. data/tests/requests/compute/vm_clone_tests.rb +20 -20
  58. data/tests/requests/compute/vm_config_vnc_tests.rb +3 -4
  59. data/tests/requests/compute/vm_destroy_tests.rb +1 -4
  60. data/tests/requests/compute/vm_migrate_tests.rb +1 -2
  61. data/tests/requests/compute/vm_power_off_tests.rb +2 -4
  62. data/tests/requests/compute/vm_power_on_tests.rb +1 -3
  63. data/tests/requests/compute/vm_reboot_tests.rb +2 -4
  64. data/tests/requests/compute/vm_reconfig_cdrom_tests.rb +2 -3
  65. data/tests/requests/compute/vm_reconfig_cpus_tests.rb +1 -3
  66. data/tests/requests/compute/vm_reconfig_hardware_tests.rb +2 -4
  67. data/tests/requests/compute/vm_reconfig_memory_tests.rb +1 -3
  68. data/tests/requests/compute/vm_suspend_tests.rb +23 -0
  69. data/tests/requests/compute/vm_take_snapshot_tests.rb +1 -3
  70. metadata +22 -4
  71. data/gemfiles/Gemfile.1.9.2+ +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f885f4027de3c28c90d0d9909bd13c7c9ec8b339
4
- data.tar.gz: afc80dbe162913b73794220d69ca791ea2829ef0
2
+ SHA256:
3
+ metadata.gz: 95375060abd33bf28937dfdc793ecbfcefb1a612d4a639456c0a304ac7641a25
4
+ data.tar.gz: 7550cbe2aee4325dafaff388c2546470a82cd893aad7818f52302f4005f5df2f
5
5
  SHA512:
6
- metadata.gz: 6ee93b2bb15102f94be2510f384651452b6a973626dfc8efef770091c2e58856de199b39c043d1c8316d79f921732b2846ea027f17b3cf03042c2dab2ef087f5
7
- data.tar.gz: 7144e530d128aeb69042ec2dfdbf7935eb4130e46f2ef7e5a9bd8097f2385b5bd82715b056558aac00347269017701932756dce6fc3d7b20e08e30096848397c
6
+ metadata.gz: 032576f8e9d1c11dee28a26625d72f23c4c50c60fce93480b3cacb97c0ad13c98c182357acbcf2106138eaa6edf39a83dfd70fa86939f367cf32d017ab44fc8c
7
+ data.tar.gz: 215eb88241d55311ecfcd45f2e85a2fd3a6b52ed9806418d8bfc7767e82559390f0f5e71b623a5a8ffe62272f304d7c1fae5fec261ad43cab0fb5bebcc1514de
data/.gitignore CHANGED
@@ -20,4 +20,5 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
- gemfiles/*.lock
23
+ gemfiles/*.lock
24
+ .*.swp
@@ -0,0 +1,8 @@
1
+ inherit_from:
2
+ - .rubocop_todo.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.0
6
+
7
+ Style/Documentation:
8
+ Enabled: false
@@ -0,0 +1,217 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2018-04-18 16:02:28 +0200 using RuboCop version 0.50.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 4
10
+ # Configuration parameters: AllowSafeAssignment.
11
+ Lint/AssignmentInCondition:
12
+ Exclude:
13
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
14
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
15
+
16
+ # Offense count: 7
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect.
19
+ # SupportedStylesAlignWith: keyword, variable, start_of_line
20
+ Lint/EndAlignment:
21
+ Exclude:
22
+ - 'lib/fog/vsphere/models/compute/customfields.rb'
23
+ - 'lib/fog/vsphere/models/compute/customvalues.rb'
24
+ - 'lib/fog/vsphere/models/compute/tickets.rb'
25
+ - 'lib/fog/vsphere/models/compute/volumes.rb'
26
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
27
+ - 'lib/fog/vsphere/requests/compute/host_start_maintenance.rb'
28
+
29
+ # Offense count: 2
30
+ Lint/InterpolationCheck:
31
+ Exclude:
32
+ - 'tests/requests/compute/vm_power_off_tests.rb'
33
+ - 'tests/requests/compute/vm_suspend_tests.rb'
34
+
35
+ # Offense count: 13
36
+ Lint/RescueWithoutErrorClass:
37
+ Exclude:
38
+ - 'lib/fog/vsphere/compute.rb'
39
+ - 'lib/fog/vsphere/requests/compute/list_hosts.rb'
40
+ - 'lib/fog/vsphere/requests/compute/list_vm_cdroms.rb'
41
+ - 'lib/fog/vsphere/requests/compute/list_vm_volumes.rb'
42
+
43
+ # Offense count: 3
44
+ Lint/ShadowingOuterLocalVariable:
45
+ Exclude:
46
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
47
+ - 'lib/fog/vsphere/requests/compute/destroy_rule.rb'
48
+ - 'lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb'
49
+
50
+ # Offense count: 9
51
+ Lint/UselessAssignment:
52
+ Exclude:
53
+ - 'lib/fog/vsphere/compute.rb'
54
+ - 'lib/fog/vsphere/models/compute/interfaces.rb'
55
+ - 'lib/fog/vsphere/models/compute/volumes.rb'
56
+ - 'lib/fog/vsphere/requests/compute/create_rule.rb'
57
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
58
+ - 'lib/fog/vsphere/requests/compute/get_interface_type.rb'
59
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
60
+ - 'lib/fog/vsphere/requests/compute/vm_migrate.rb'
61
+ - 'tests/requests/compute/vm_clone_tests.rb'
62
+
63
+ # Offense count: 57
64
+ Metrics/AbcSize:
65
+ Max: 633
66
+
67
+ # Offense count: 12
68
+ # Configuration parameters: CountComments, ExcludedMethods.
69
+ Metrics/BlockLength:
70
+ Max: 263
71
+
72
+ # Offense count: 21
73
+ # Configuration parameters: CountBlocks.
74
+ Metrics/BlockNesting:
75
+ Max: 5
76
+
77
+ # Offense count: 6
78
+ # Configuration parameters: CountComments.
79
+ Metrics/ClassLength:
80
+ Max: 452
81
+
82
+ # Offense count: 15
83
+ Metrics/CyclomaticComplexity:
84
+ Max: 150
85
+
86
+ # Offense count: 16
87
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
88
+ # URISchemes: http, https
89
+ Metrics/LineLength:
90
+ Max: 317
91
+
92
+ # Offense count: 72
93
+ # Configuration parameters: CountComments.
94
+ Metrics/MethodLength:
95
+ Max: 356
96
+
97
+ # Offense count: 1
98
+ # Configuration parameters: CountComments.
99
+ Metrics/ModuleLength:
100
+ Max: 109
101
+
102
+ # Offense count: 2
103
+ # Configuration parameters: CountKeywordArgs.
104
+ Metrics/ParameterLists:
105
+ Max: 6
106
+
107
+ # Offense count: 16
108
+ Metrics/PerceivedComplexity:
109
+ Max: 158
110
+
111
+ # Offense count: 1
112
+ # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
113
+ # NamePrefix: is_, has_, have_
114
+ # NamePrefixBlacklist: is_, has_, have_
115
+ # NameWhitelist: is_a?
116
+ Naming/PredicateName:
117
+ Exclude:
118
+ - 'spec/**/*'
119
+ - 'lib/fog/vsphere/compute.rb'
120
+
121
+ # Offense count: 15
122
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
123
+ # SupportedStyles: snake_case, camelCase
124
+ Naming/VariableName:
125
+ Exclude:
126
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
127
+ - 'lib/fog/vsphere/requests/compute/list_datacenters.rb'
128
+ - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
129
+ - 'lib/fog/vsphere/requests/compute/list_server_types.rb'
130
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
131
+ - 'tests/compute_tests.rb'
132
+
133
+ # Offense count: 10
134
+ Style/CaseEquality:
135
+ Exclude:
136
+ - 'lib/fog/vsphere/requests/compute/list_child_snapshots.rb'
137
+ - 'lib/fog/vsphere/requests/compute/revert_to_snapshot.rb'
138
+ - 'tests/requests/compute/list_child_snapshots_tests.rb'
139
+ - 'tests/requests/compute/list_datastores_tests.rb'
140
+ - 'tests/requests/compute/list_hosts_tests.rb'
141
+ - 'tests/requests/compute/list_networks_tests.rb'
142
+ - 'tests/requests/compute/list_vm_cdroms_tests.rb'
143
+ - 'tests/requests/compute/list_vm_snapshots_tests.rb'
144
+
145
+ # Offense count: 1
146
+ Style/ClassVars:
147
+ Exclude:
148
+ - 'lib/fog/bin/vsphere.rb'
149
+
150
+ # Offense count: 1
151
+ Style/DoubleNegation:
152
+ Exclude:
153
+ - 'tests/helpers/succeeds_helper.rb'
154
+
155
+ # Offense count: 12
156
+ # Configuration parameters: MinBodyLength.
157
+ Style/GuardClause:
158
+ Exclude:
159
+ - 'lib/fog/vsphere/compute.rb'
160
+ - 'lib/fog/vsphere/models/compute/interfaces.rb'
161
+ - 'lib/fog/vsphere/models/compute/rule.rb'
162
+ - 'lib/fog/vsphere/models/compute/server.rb'
163
+ - 'lib/fog/vsphere/requests/compute/create_group.rb'
164
+ - 'lib/fog/vsphere/requests/compute/create_rule.rb'
165
+ - 'lib/fog/vsphere/requests/compute/create_vm.rb'
166
+ - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
167
+ - 'lib/fog/vsphere/requests/compute/list_server_types.rb'
168
+
169
+ # Offense count: 2
170
+ Style/IfInsideElse:
171
+ Exclude:
172
+ - 'lib/fog/vsphere/models/compute/cdrom.rb'
173
+ - 'lib/fog/vsphere/models/compute/volume.rb'
174
+
175
+ # Offense count: 2
176
+ Style/MultilineBlockChain:
177
+ Exclude:
178
+ - 'lib/fog/vsphere/requests/compute/vm_clone.rb'
179
+
180
+ # Offense count: 4
181
+ Style/MultilineTernaryOperator:
182
+ Exclude:
183
+ - 'lib/fog/vsphere/models/compute/cluster.rb'
184
+ - 'lib/fog/vsphere/requests/compute/list_child_snapshots.rb'
185
+
186
+ # Offense count: 1
187
+ # Cop supports --auto-correct.
188
+ # Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
189
+ # SupportedStyles: predicate, comparison
190
+ Style/NumericPredicate:
191
+ Exclude:
192
+ - 'spec/**/*'
193
+ - 'lib/fog/vsphere/requests/compute/list_compute_resources.rb'
194
+
195
+ # Offense count: 1
196
+ # Cop supports --auto-correct.
197
+ # Configuration parameters: PreferredDelimiters.
198
+ Style/PercentLiteralDelimiters:
199
+ Exclude:
200
+ - 'Rakefile'
201
+
202
+ # Offense count: 3
203
+ # Cop supports --auto-correct.
204
+ # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
205
+ # SupportedStyles: slashes, percent_r, mixed
206
+ Style/RegexpLiteral:
207
+ Exclude:
208
+ - 'lib/fog/vsphere/requests/compute/create_folder.rb'
209
+ - 'lib/fog/vsphere/requests/compute/get_folder.rb'
210
+ - 'lib/fog/vsphere/requests/compute/list_resource_pools.rb'
211
+
212
+ # Offense count: 1
213
+ # Cop supports --auto-correct.
214
+ # Configuration parameters: AllowAsExpressionSeparator.
215
+ Style/Semicolon:
216
+ Exclude:
217
+ - 'tests/models/compute/rules_tests.rb'
@@ -6,20 +6,19 @@ matrix:
6
6
  - rvm: jruby-head
7
7
  fast_finish: true
8
8
  include:
9
- - rvm: 1.9.3
10
- gemfile: gemfiles/Gemfile.1.9.2+
11
9
  - rvm: 2.0.0
12
10
  gemfile: Gemfile
13
- - rvm: 2.1.0
11
+ - rvm: 2.1.10
14
12
  gemfile: Gemfile
15
- - rvm: 2.1.1
13
+ - rvm: 2.2.6
16
14
  gemfile: Gemfile
17
- - rvm: 2.2.0
15
+ - rvm: 2.3.3
16
+ gemfile: Gemfile
17
+ - rvm: 2.4.0
18
18
  gemfile: Gemfile
19
- - rvm: jruby-19mode
20
- gemfile: gemfiles/Gemfile.1.9.2+
21
19
  - rvm: jruby-head
22
20
  gemfile: Gemfile
21
+ script: bundle exec rake travis:ci
23
22
  notifications:
24
23
  email: false
25
24
  addons:
@@ -1,7 +1,5 @@
1
1
  ## v1.7.0
2
2
 
3
- * Update volumes when `save` is called on Server
4
- * Add the ability to update the size of attached virtual disks
5
3
  * Improve mocks for folders and networks
6
4
 
7
5
  ## v1.6.0
@@ -14,17 +12,15 @@
14
12
 
15
13
  ## v1.5.1
16
14
 
17
- * Move volume key generation to volume model
18
- * Set defaults more reliably for SCSI
15
+ * Removed for hotfix
19
16
 
20
17
  ## v1.5.0
21
18
 
22
19
  * Rename the get_spec method in create_rule to get_group_spec
23
- * Change modify_vm_controller to follow changes made to create_controller
24
20
 
25
21
  ## v1.4.0
26
22
 
27
- * Add ability for VMs to have multiple SCSI controllers
23
+ * Removed for hotfix
28
24
 
29
25
  ## v1.3.0
30
26
 
@@ -4,11 +4,13 @@
4
4
  * Ben Talbot - btalbot <ben_t48@hotmail.com>
5
5
  * Carl Caum <carl@carlcaum.com>
6
6
  * Carlos Sanchez <csanchez@maestrodev.com>
7
+ * Chris Roberts <chrobert@redhat.com>
7
8
  * Chris Thompson <chris.thompson@govdelivery.com>
8
9
  * Chris Thompson <teaforthecat@gmail.com>
9
10
  * Christopher Oliver <coliver@datapipe.com>
10
11
  * Cyrus Team <cyrusteam@cyruslists.com>
11
12
  * Darren Foo <stonith@users.noreply.github.com>
13
+ * Derek Wright <derekmwright@users.noreply.github.com>
12
14
  * Dominic Cleal <dcleal@redhat.com>
13
15
  * Eric Stonfer <ericstonfer@yahoo.com>
14
16
  * Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
@@ -36,6 +38,7 @@
36
38
  * Lukas Zapletal <lzap+git@redhat.com>
37
39
  * Marc Grimme <grimme@atix.de>
38
40
  * Marc Grimme <marc.grimme@googlemail.com>
41
+ * Marek Hulan <mhulan@redhat.com>
39
42
  * Martin Matuska <martin@matuska.org>
40
43
  * Matt Darby <matt.darby@rackspace.com>
41
44
  * Matthew Black <matthew.black@sap.com>
@@ -56,11 +59,14 @@
56
59
  * Rich Daley <rdaley@williamhill.co.uk>
57
60
  * Rich Lane <rlane@club.cc.cmu.edu>
58
61
  * Samuel Keeley <samuel@dropbox.com>
62
+ * Sergio Cambra <sergio@programatica.es>
59
63
  * Shlomi Zadok <shlomi@ben-hanna.com>
60
64
  * Simon Josi <me@yokto.net>
61
65
  * Tejas Ravindra Mandke <tejas@identified.com>
66
+ * Timo Goebel <mail@timogoebel.name>
62
67
  * Timo Goebel <timo.goebel@dm.de>
63
68
  * Timur Alperovich <timur@maginatics.com>
69
+ * Tyler Gregory <01100010011001010110010101110000@users.noreply.github.com>
64
70
  * Wesley Beary <geemus+github@gmail.com>
65
71
  * Wesley Beary <geemus@gmail.com>
66
72
  * Xavier Fontrodona <xavier.fontrodona@safelayer.com>
@@ -70,5 +76,9 @@
70
76
  * geemus <geemus@gmail.com>
71
77
  * karmab <karimboumedhel@gmail.com>
72
78
  * karimb <karimboumedhel@gmail.com>
79
+ * milo_cheung <milo.cheung@appcara.com>
80
+ * scottd018 <scottd018@users.noreply.github.com>
73
81
  * slivik <jakub.sliva@gmail.com>
82
+ * theOpenBit <theopenbit@users.noreply.github.com>
74
83
  * tipt0e <topo-2@charter.net>
84
+ * wiad <adam.winberg@gmail.com>
data/Rakefile CHANGED
@@ -1,8 +1,17 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rubocop/rake_task'
3
+
4
+ desc 'Run Ruby style checks'
5
+ RuboCop::RakeTask.new(:style)
6
+
7
+ namespace :travis do
8
+ desc 'Run tests on Travis'
9
+ task ci: %w(style test)
10
+ end
2
11
 
3
12
  mock = ENV['FOG_MOCK'] || 'true'
4
13
  task :test do
5
14
  sh("export FOG_MOCK=#{mock} && bundle exec shindont")
6
15
  end
7
16
 
8
- task(:default => [:test])
17
+ task(default: [:test])
@@ -89,7 +89,6 @@ module Fog
89
89
  request :get_virtual_machine
90
90
  request :vm_reconfig_hardware
91
91
  request :vm_reconfig_memory
92
- request :vm_reconfig_volumes
93
92
  request :vm_reconfig_cpus
94
93
  request :vm_reconfig_cdrom
95
94
  request :vm_config_vnc
@@ -101,7 +100,6 @@ module Fog
101
100
  request :list_vm_customvalues
102
101
  request :list_customfields
103
102
  request :get_vm_first_scsi_controller
104
- request :list_vm_scsi_controllers
105
103
  request :set_vm_customvalue
106
104
  request :vm_take_snapshot
107
105
  request :list_vm_snapshots
@@ -5,14 +5,9 @@ module Fog
5
5
  attribute :shared_bus
6
6
  attribute :type
7
7
  attribute :unit_number
8
- attribute :key, :type => :integer
8
+ attribute :key
9
9
  attribute :server_id
10
10
 
11
- def initialize(attributes = {})
12
- super
13
- self.key ||= 1000
14
- end
15
-
16
11
  def to_s
17
12
  "#{type} ##{key}: shared: #{shared_bus}, unit_number: #{unit_number}"
18
13
  end
@@ -6,7 +6,6 @@ module Fog
6
6
  class Server < Fog::Compute::Server
7
7
  extend Fog::Deprecation
8
8
  deprecate(:ipaddress, :public_ip_address)
9
- deprecate(:scsi_controller, :scsi_controllers)
10
9
 
11
10
  # This will be the instance uuid which is globally unique across
12
11
  # a vSphere deployment.
@@ -46,7 +45,7 @@ module Fog
46
45
  attribute :instance_uuid # move this --> id
47
46
  attribute :guest_id
48
47
  attribute :hardware_version
49
- attribute :scsi_controllers, :type => :array
48
+ attribute :scsi_controller # this is the first scsi controller. Right now no more of them can be used.
50
49
  attribute :cpuHotAddEnabled
51
50
  attribute :memoryHotAddEnabled
52
51
  attribute :firmware
@@ -58,7 +57,7 @@ module Fog
58
57
  initialize_interfaces
59
58
  initialize_volumes
60
59
  initialize_customvalues
61
- initialize_scsi_controllers
60
+ initialize_scsi_controller
62
61
  end
63
62
 
64
63
  # Lazy Loaded Attributes
@@ -80,11 +79,6 @@ module Fog
80
79
  service.vm_reconfig_cpus('instance_uuid' => instance_uuid, 'cpus' => cpus, 'corespersocket' => corespersocket)
81
80
  end
82
81
 
83
- def vm_reconfig_volumes(options = {})
84
- requires :instance_uuid, :volumes
85
- service.vm_reconfig_volumes('instance_uuid' => instance_uuid, 'volumes' => volumes)
86
- end
87
-
88
82
  def vm_reconfig_hardware(hardware_spec, options = {})
89
83
  requires :instance_uuid
90
84
  service.vm_reconfig_hardware('instance_uuid' => instance_uuid, 'hardware_spec' => hardware_spec)
@@ -261,12 +255,8 @@ module Fog
261
255
  attributes[:customvalues] ||= id.nil? ? [] : service.customvalues( :vm => self )
262
256
  end
263
257
 
264
- def scsi_controllers
265
- self.attributes[:scsi_controllers] ||= service.list_vm_scsi_controllers(id)
266
- end
267
-
268
258
  def scsi_controller
269
- scsi_controllers.first
259
+ self.attributes[:scsi_controller] ||= service.get_vm_first_scsi_controller(id)
270
260
  end
271
261
 
272
262
  def folder
@@ -279,7 +269,6 @@ module Fog
279
269
  if persisted?
280
270
  vm_reconfig_cpus if attribute_changed?(:cpus) || attribute_changed?(:corespersocket)
281
271
  vm_reconfig_memory if attribute_changed?(:memory_mb)
282
- vm_reconfig_volumes if attribute_changed?(:volumes)
283
272
  else
284
273
  self.id = service.create_vm(attributes)
285
274
  end
@@ -325,7 +314,7 @@ module Fog
325
314
 
326
315
  def initialize_volumes
327
316
  if attributes[:volumes] and attributes[:volumes].is_a?(Array)
328
- self.attributes[:volumes].map! { |vol| vol.is_a?(Hash) ? service.volumes.new({:server => self}.merge(vol)) : vol }
317
+ self.attributes[:volumes].map! { |vol| vol.is_a?(Hash) ? service.volumes.new(vol) : vol }
329
318
  end
330
319
  end
331
320
 
@@ -335,20 +324,9 @@ module Fog
335
324
  end
336
325
  end
337
326
 
338
- def initialize_scsi_controllers
339
- if attributes[:scsi_controllers] && attributes[:scsi_controllers].is_a?(Array)
340
- self.attributes[:scsi_controllers].map! do |controller|
341
- controller.is_a?(Hash) ? Fog::Compute::Vsphere::SCSIController.new(controller) : controller
342
- end
343
- elsif attributes[:scsi_controller] && attributes[:scsi_controller].is_a?(Hash)
344
- self.attributes[:scsi_controllers] = [
345
- Fog::Compute::Vsphere::SCSIController.new(self.attributes[:scsi_controller])
346
- ]
347
- elsif attributes[:volumes] && attributes[:volumes].is_a?(Array) && !attributes[:volumes].empty?
348
- # Create a default scsi controller if there are any disks but no controller defined
349
- self.attributes[:scsi_controllers] = [
350
- Fog::Compute::Vsphere::SCSIController.new
351
- ]
327
+ def initialize_scsi_controller
328
+ if attributes[:scsi_controller] and attributes[:scsi_controller].is_a?(Hash)
329
+ Fog::Compute::Vsphere::SCSIController.new(self.attributes[:scsi_controller])
352
330
  end
353
331
  end
354
332