Bug 1430518

Summary: Unable to hot add new thin provisioned disk to VM
Product: Red Hat CloudForms Management Engine Reporter: myoder
Component: AutomateAssignee: Lucy Fu <lufu>
Status: CLOSED CURRENTRELEASE QA Contact: Alex Newman <anewman>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: anewman, cpelland, jcutter, jhardy, mkanoor, nchugh, obarenbo, simaishi, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 5.8.0.7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1432961 (view as bug list) Environment:
Last Closed: 2017-06-12 17:40:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: VMware Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1432961    

Description myoder 2017-03-08 20:12:16 UTC
Description of problem:

We have added a button to hot add a hard disk to a VM.  The action works correctly and the hard disk is added with the specified size.  The problem is that it is only added as thick provisioned and we would like it to be thin.

The provider we are using is VMware.  We have a method in the automate domain that will hot add a disk to VMware VM.  We do not know how to specify how to add thin provision disk as it always defaults as thick.

# Get vm object
vm = $evm.root['vm']
##raise "Missing $evm.root['vm'] object" unless vm

##$evm.log(:info, "evm attributes:#{$evm.root.attributes.inspect}")
$evm.log("info", "dialog $evm.root['dialog_disk_size1' ")

size = $evm.root['dialog_disk_size1'].to_i

# Get the size for the new disk from the root object
##size = $evm.root['size'].to_i
$evm.log("info", "Detected size:<#{size}>")

# Add disk to a VM
if size.zero?
  $evm.log("error", "Size:<#{size}> invalid")
else
  $evm.log("info", "Creating a new #{size}GB disk on Storage:<#{vm.storage_name}>")
##  vm.add_disk("[#{vm.storage_name}]", size * 1024, :sync => true)
##  vm.add_disk("[#{vm.storage_name}]", size * 1024, {:sync => true, :thin_provisioned => true})
  vm.add_disk("[#{vm.storage_name}]", size * 1024, :thin_provisioned => true)
end

Version-Release number of selected component (if applicable):
5.7

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
I have found these 2 documents concerning thin provisioning:
https://github.com/ManageIQ/manageiq/issues/12488
https://github.com/ManageIQ/manageiq/pull/1758/files

Comment 2 Greg McCullough 2017-03-14 16:32:03 UTC
Lucy, this change should be the same as what was added for RHV here: miq_ae_service_manageiq-providers-redhat-infra_manager-vm.rb

But needs to be applied to the VMware caller:
miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb

Comment 4 CFME Bot 2017-03-15 20:11:21 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/9d8d3bef15a358b0fed5d3c22d7545632fdb2ada

commit 9d8d3bef15a358b0fed5d3c22d7545632fdb2ada
Author:     Lucy Fu <lufu>
AuthorDate: Wed Mar 15 15:39:14 2017 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Wed Mar 15 15:39:33 2017 -0400

    Allow passing options when adding a disk.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1430518

 .../miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb      | 2 +-
 .../miq_ae_service_manageiq-providers-vmware-infra_manager-vm_spec.rb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comment 6 Josh Carter 2017-11-15 19:23:31 UTC
*** Bug 1510761 has been marked as a duplicate of this bug. ***