Bug 1200137

Summary: SCVMM VM power function failing with error
Product: Red Hat CloudForms Management Engine Reporter: ncatling
Component: ProvidersAssignee: Bronagh Sorota <bsorota>
Status: CLOSED ERRATA QA Contact: Milan Falešník <mfalesni>
Severity: low Docs Contact:
Priority: medium    
Version: 5.3.0CC: bsorota, cpelland, gblomqui, jfrey, jhardy, jocarter, ncatling, 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:
: 1245685 (view as bug list) Environment:
Last Closed: 2015-12-08 13:03:24 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: 1245685    

Description ncatling 2015-03-09 20:04:41 UTC
Description of problem:

VM power operations failing on SCVMM 2012 SP1 provider using PowerShell 4.

Error produced: ‘Get-SCVirtualMachine : The term 'Get-SCVirtualMachine' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.’

Fixed by amending following line in vmdb/app/models/ems_microsoft.rb

command = "powershell Import-Module VirtualMachineManager; Get-VMMServer #{ipaddress}; #{cmdlet}-SCVirtualMachine -VM (Get-SCVirtualMachine -ID #{vm_uid_ems}) #{params}"

Version-Release number of selected component (if applicable):
CFME 5.3
SCVMM 2012 SP1
PowerShell 4.0

How reproducible:
Attempt power on/off of SCVMM hosted VM.


Steps to Reproduce:
1. Select VM in Infrastructure\VMs
2. Select Power > Power Off
3.

Actual results:
VM remains on. Following error in scvmm.log

[----] I, [2015-03-09T17:52:08.114997 #14574:b0e80c]  INFO -- : MIQ(EmsRefresh::Parsers::Scvmm.ems_inv_to_hashes) Collecting data for EMS name: [SCVMM (10.3.56.116)] id: [1000000000003]...Complete
[----] E, [2015-03-09T17:56:03.115857 #25301:ad9814] ERROR -- : MIQ(Class#log_dos_error_results) Get-SCVirtualMachine : The term 'Get-SCVirtualMachine' is not recognized as 
the name of a cmdlet, function, script file, or operable program. Check the 
spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:28
+ Stop-SCVirtualMachine -VM (Get-SCVirtualMachine -ID 
dbd4aa4c-53eb-40ff-a4c6-5c1c ...
+                            ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-SCVirtualMachine:String) [] 
   , CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


Expected results:
VM powered off/on.


Additional info:

Comment 6 Greg Blomquist 2015-07-28 19:57:54 UTC
https://github.com/ManageIQ/manageiq/pull/2094

Upstream PR for handling SP1.

Comment 8 Bronagh Sorota 2015-09-30 16:04:03 UTC
Hi Milan,
I think it best to test in R2 since that is the version we officially support.

thanks
Bronagh

Comment 9 ncatling 2015-09-30 16:12:27 UTC
This problem only relates to SP1, so needs to be tested in an SP1 environment.

Comment 10 Bronagh Sorota 2015-09-30 16:14:26 UTC
I missed that part. Yes, only testing in an SP1 env is suffice.

Comment 12 errata-xmlrpc 2015-12-08 13:03:24 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