Bug 1234990

Summary: SCVMM provisioning from template fails to extrapolate the destination storage correctly
Product: Red Hat CloudForms Management Engine Reporter: ncatling
Component: ProvisioningAssignee: Bronagh Sorota <bsorota>
Status: CLOSED ERRATA QA Contact: Milan Falešník <mfalesni>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.4.0CC: bsorota, cpelland, fdewaley, jhardy, jteehan, obarenbo
Target Milestone: GAKeywords: ZStream
Target Release: 5.5.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.5.0.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1245691 (view as bug list) Environment:
Last Closed: 2015-12-08 13:18:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1245691    

Description ncatling 2015-06-23 16:27:24 UTC
Description of problem:
SCVMM provisioning from template fails to extrapolate the destination storage correctly.

Version-Release number of selected component (if applicable):
CFME 5.4
SCVMM SP1/R2

How reproducible:
Provision from template will fail with this PowerShell error:
New-SCVirtualMachine : Cannot create or update a highly available virtual machine because Virtual Machine Manager could not locate or access C:
Followed by '[JSON::ParserError]: 757: unexpected token' error in evm.log

Steps to Reproduce:
1.
2.
3.

Actual results:
Provision fails.


Expected results:
Provision successful.


Additional info:

Following def in clone.rb fails to extrapolate the destination storage:

  def dest_mount_point
    dest_datastore.name.scan(DRIVE_LETTER).last.to_s
  end

Example would be 'C:\ClusterStorage\CLUSP04 Prod Volume 3-1' but method produces 'C'.

"file://server.local/C:/ClusterStorage/CLUSP04%20Prod%20Volume%203-1".scan(/[a-z][:]/i).last.to_s

Comment 2 Greg McCullough 2015-06-23 17:02:22 UTC
GregB - Can you have someone from on the SCVMM group take a look into this issue.

Comment 3 ncatling 2015-06-24 12:41:45 UTC
Here's a suggested fix:

  def dest_mount_point
    d_ds = dest_datastore.name.to_s.scan(/file:\/\/.*\/([A-Z][:].*)/i)
    d_ds = d_ds[0][0].to_s
    d_ds.gsub(/\/|%20/, '/' => '\\', '%20' => ' ')
  end

Comment 6 CFME Bot 2015-07-29 21:56:05 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/76fa43376a313fa3a7dc0b5ebb477368bd2596ea

commit 76fa43376a313fa3a7dc0b5ebb477368bd2596ea
Author:     Bronagh Sorota <bsorota>
AuthorDate: Wed Jul 29 15:37:58 2015 -0400
Commit:     Bronagh Sorota <bsorota>
CommitDate: Wed Jul 29 15:37:58 2015 -0400

    Correctly handles manipulation of the datastore name.
    
    Handles:
     - URI decoding (note, we encode the datastore path in the SCVMM parser;  as I understand it, this is a requirement for SSA )
    -  more complex datastore paths
    -  converting forward slashes to backslashes suitable for running the command on a Windows Server
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1234990

 app/models/miq_provision_microsoft/cloning.rb | 5 +++--
 spec/models/miq_provision_microsoft_spec.rb   | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

Comment 8 CFME Bot 2015-08-03 20:27:36 UTC
Detected commit referencing this ticket while ticket status is POST.

Comment 13 Jeff Teehan 2015-10-05 22:20:44 UTC
High Availability virtual machines can only be provisioned on Cluster Share Volumes.  I created the CSV, as well as an High Availability configured template.

Using an HA VM, and storing in on the Cluster Shared Volume the provision works just fine.

FYI, whenever you see this ([JSON::ParserError]) just open up the Jobs tab of SCVMM and find the failed Create Virtual Machine job.  Click on that job and you'll get an explanation of exactly what went wrong.

Moving this to Verified as SCVMM provision appears to be working correctly with 5.5.0.3 using https://10.8.58.233/miq_request/show/105r4

Comment 15 errata-xmlrpc 2015-12-08 13:18:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551