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 +4 -4
- data/lib/VMwareWebService/MiqVimVm.rb +28 -0
- data/lib/VMwareWebService/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14f76c8ac26d5fc6d1b9c9a137eb03ab2847dd3f2382db826fcbc8e73399faf1
|
4
|
+
data.tar.gz: 4986c375b421ba84f690c58bd73fd6e455aca45e133fc7c7b9dbfe4de94e13a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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-
|
11
|
+
date: 2020-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|