Skip to content

Commit

Permalink
Merge pull request ManageIQ#413 from billfitzgerald0120/requested_res…
Browse files Browse the repository at this point in the history
…t_api_tweek

Updated requested method to fix vm_reconfigure via rest-api.
  • Loading branch information
mkanoor authored Sep 4, 2018
2 parents a31fac6 + 011643f commit 758b168
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def requested_storage(args_hash)
end
if args_hash[:resource].options[:disk_remove]
args_hash[:resource].options[:disk_remove].each do |disk|
disk_num = disk[:disk_name].match(/_(\d).vmdk/)
disk_num = disk['disk_name'].match(/_(\d).vmdk/)
next unless disk_num
$evm.log(:info, "Reconfigure Disk Removal: #{disk.inspect}")
disk_n_number = "disk_#{disk_num[1].succ}_size"
Expand Down
9 changes: 9 additions & 0 deletions spec/automation/unit/method_validation/requested_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ def check_results(requested_hash, storage, cpu, vms, memory)
check_results(ws.root['quota_requested'], 10.megabytes, 2, 1, 4096.megabytes)
end

it "removes a disk " do
setup_model("vmware_reconfigure")
@reconfigure_request.update_attributes(:options => {:src_ids => [@vm_vmware.id], :request_type => :vm_reconfigure,\
:disk_remove => [{"disk_name" => "freds disk", "persistent" => true, "thin_provisioned" => false,\
"dependent" => true, "bootable" => false}]})
ws = run_automate_method(reconfigure_attrs)
check_results(ws.root['quota_requested'], 0, 0, 1, 0.megabytes)
end

it "minus 1 cpu and minus 2048 memory" do
setup_model("vmware_reconfigure")
@reconfigure_request.update_attributes(:options => {:src_ids => [@vm_vmware.id], :cores_per_socket => 1,\
Expand Down

0 comments on commit 758b168

Please sign in to comment.