Bug 1441319

Summary: [SCVMM] Error during provision to CSVFS storage
Product: Red Hat CloudForms Management Engine Reporter: Leo Khomenko <lkhomenk>
Component: ProvidersAssignee: Daniel Berger <dberger>
Status: CLOSED ERRATA QA Contact: Leo Khomenko <lkhomenk>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7.0CC: agrare, dajohnso, gblomqui, jfrey, jhardy, lkhomenk, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: scvmm:provision
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-01 13:11:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:

Description Leo Khomenko 2017-04-11 16:34:33 UTC
Description of problem: Error while provision to CSVFS is not recognized by CFME
"[EVM] VM [test-provt-w2fi] Step [CheckProvisioned] Status [[JSON::ParserError]: 743: unexpected token at ] Message [[JSON::ParserError]: 743: unexpected token at '']"

Version-Release number of selected component (if applicable):5.7.2.1/5.8.0.9


How reproducible:100%


Steps to Reproduce:
1.provison VM to CSVFS Storage
2.Check error message

Actual results:[EVM] VM [test-provt-w2fi] Step [CheckProvisioned] Status [[JSON::ParserError]: 743: unexpected token at ] Message [[JSON::ParserError]: 743: unexpected token at '']


Expected results:that is how error looks on SCVMM side: 
Error (23001)
Cannot create or update a non highly available virtual machine because the path C:\ClusterStorage\netapp_crud_vol\test-provt-w2fi is a clustered resource.

Comment 3 Jeff Teehan 2017-04-20 16:33:12 UTC
This is not a bug as far as what is happening.  You MUST use an HA template to provision on an HA resource.  The test as performed is expected to fail.  Dan and I are currently looking into the possibility of presenting a better error message.

Comment 4 Daniel Berger 2017-04-20 20:42:54 UTC
I think I see what's happening, in part thanks to Jeff's help.

The issue is that the build_ps_script in cloning.rb is actually running two commands - New-SCVirtualMachine and Set-SCVirtualMachine - and assumes that the first one always succeeds.

What's really happening is that the first command is failing. When I tried to run a deliberately bad provisioning script I get "Cannot create or update a non highly available virtual machine because the path C:\\whatever\\your_vm is a clustered resource."

But you never see that, and it sets $vm to a blank string. Ultimately that blank string is what gets passed back to our code. If you try JSON.parse("") in an irb shell, for example, you will see the same error that the reporter pasted.

So, I need to refactor the cloning.rb file, breaking up the powershell script into two parts, and doing some better error checking for each one.

Comment 5 Daniel Berger 2017-05-10 22:13:04 UTC
Please see https://github.com/ManageIQ/manageiq/pull/14842

Comment 9 errata-xmlrpc 2018-03-01 13:11:36 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-2018:0380