vmware_web_service 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 9a3fda957a5c3f40ee4cb771e4dfb68ffcabaec2b511c3088a9070de7c816e96
4
- data.tar.gz: 2f411a8da658bf1112f7f589909c10ada57265e9f9f230acb346dffcf7199b93
3
+ metadata.gz: 14f76c8ac26d5fc6d1b9c9a137eb03ab2847dd3f2382db826fcbc8e73399faf1
4
+ data.tar.gz: 4986c375b421ba84f690c58bd73fd6e455aca45e133fc7c7b9dbfe4de94e13a3
5
5
  SHA512:
6
- metadata.gz: 72ffcec7bdefef9325d1f28f2fa80ea9ee75585d69523ad852adeec32a836bd505fa1fdfeb80572f52963762c63852970d100d1e6c313909eda1a3fece8cf618
7
- data.tar.gz: 3aaf49a620c290efc30a14171c052e8cccfc900a82c7d386b627a92a124c28cdfb4a705e86e4f483faac174bfe24a9a169bdc7e459692cda04f3954bac56be76
6
+ metadata.gz: 7246fb8609f6038bacc5332c9699dafe3620c979c6ff257cf5d570b6f1c3d34145c76dd76fbefe6ff24c2fbfaffb7d4d5737b82fc0030521904b06987e66f7c4
7
+ data.tar.gz: 13e63e326831738118a5917e1369821cbd1e1a3133c0530d46a22b64a841ecc43097b61e87725129f980419e86e71180d6ec895b0eeeafe00f9102d0895e6432
@@ -873,6 +873,34 @@ class MiqVimVm
873
873
  waitForTask(taskMor)
874
874
  end # def removeDiskByFile
875
875
 
876
+ def resizeDisk(backingFile, newSizeInKb)
877
+ disk = getDeviceByBacking(backingFile)
878
+ raise "resizeDisk: no virtual device associated with: #{backingFile}" unless disk
879
+ raise "resizeDisk: cannot reduce the size of a disk" unless newSizeInKb >= Integer(disk.capacityInKB)
880
+ $vim_log.debug "MiqVimVm::resizeDisk: backingFile = #{backingFile} current size = #{device.capacityInKB} newSize = #{newSizeInKb} KB" if $vim_log
881
+
882
+ vmConfigSpec = VimHash.new("VirtualMachineConfigSpec") do |vmcs|
883
+ vmcs.deviceChange = VimArray.new("ArrayOfVirtualDeviceConfigSpec") do |vmcs_vca|
884
+ vmcs_vca << VimHash.new("VirtualDeviceConfigSpec") do |vdcs|
885
+ vdcs.operation = VirtualDeviceConfigSpecOperation::Edit
886
+
887
+ vdcs.device = VimHash.new("VirtualDisk") do |vDev|
888
+ vDev.backing = disk.backing
889
+ vDev.capacityInKB = newSizeInKb
890
+ vDev.controllerKey = disk.controllerKey
891
+ vDev.key = disk.key
892
+ vDev.unitNumber = disk.unitNumber
893
+ end
894
+ end
895
+ end
896
+ end
897
+
898
+ $vim_log.info "MiqVimVm(#{@invObj.server}, #{@invObj.username}).resizeDisk: calling reconfigVM_Task" if $vim_log
899
+ taskMor = @invObj.reconfigVM_Task(@vmMor, vmConfigSpec)
900
+ $vim_log.info "MiqVimVm(#{@invObj.server}, #{@invObj.username}).resizeDisk: returned from reconfigVM_Task" if $vim_log
901
+ waitForTask(taskMor)
902
+ end
903
+
876
904
  #
877
905
  # Find a SCSI controller and
878
906
  # return its key and next available unit number.
@@ -1,3 +1,3 @@
1
1
  module VMwareWebService
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmware_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-23 00:00:00.000000000 Z
11
+ date: 2020-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport