Bug 1461584 - Provisioning to MS SCVMM Uses host.name instead of host.hostname
Provisioning to MS SCVMM Uses host.name instead of host.hostname
Status: CLOSED CURRENTRELEASE
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning (Show other bugs)
5.7.0
Unspecified Unspecified
medium Severity medium
: GA
: 5.9.0
Assigned To: Daniel Berger
Leo Khomenko
provision:scvmm
: TestOnly, ZStream
Depends On:
Blocks: 1479367 1479377
  Show dependency treegraph
 
Reported: 2017-06-14 16:57 EDT by Jeffrey Cutter
Modified: 2018-03-06 09:40 EST (History)
7 users (show)

See Also:
Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1479367 1479377 (view as bug list)
Environment:
Last Closed: 2018-03-06 09:40:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: Bug
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core


Attachments (Terms of Use)

  None (edit)
Description Jeffrey Cutter 2017-06-14 16:57:47 EDT
Description of problem:

Provisioning to Microsoft System Center Virtual Machine Manager runs a New-SCCVirtualMachine command and passes an argument of -VMHost with the value of the VMDB host object .name (host.name).  You can see in the debug log below from scvmm.log that the VMHost is being passed with a " - 4" appended as the host was removed and readded to SCVMM several times and each time gets a new ems_ref.

Jun 14 13:56:23 cfme01 cf_scvmm:      $vm = New-SCVirtualMachine         -Name 'testvm1'         -VMHost hyperv_hostname.example.com - 4         -Path '\\nas.example.com\ShareName'         -VMTemplate (Get-SCVMTemplate -Name '2016');       Set-SCVirtualMachine -VM $vm         -CPUCount 1          -DynamicMemoryEnabled $false        -MemoryMB 4096 | Out-Null;        $adapter = $vm | SCVirtualNetworkAdapter;      Set-SCVirtualNetworkAdapter       -VirtualNetworkAdapter $adapter       -LogicalNetwork (Get-SCLogicalNetwork -Name 'LP 2069 MC vRA Win Dev') | Out-Null;       $vm | Select-Object ID | ConvertTo-Json

This yields the following error:

Jun 14 13:56:23 cfme01 cf_scvmm: [----] D, [2017-06-14T13:56:18.205456 #4091:605130] DEBUG -- : Q-task_id([miq_provision_10000000001416]) MIQ(ManageIQ::Providers::Microsoft::InfraManager#run_powershell_script) Execute Powershell Script...
Jun 14 13:56:23 cfme01 cf_scvmm: [----] E, [2017-06-14T13:56:21.781163 #4091:605130] ERROR -- : Q-task_id([miq_provision_10000000001416]) MIQ(Class#log_dos_error_results) New-SCVirtualMachine : A positional parameter cannot be found that accepts argument '-'.

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

5.7.2

How reproducible:

Every time you provision to a host where the host.name doesn't match the host.hostname.

Steps to Reproduce:
1.  In CloudForms UI, edit a host resource and rename it to have a - 1 in it and then provision to it.

Additional info:

irb(main):003:0> $evm.vmdb(:host).where("name ~ 'hyperv-hostname'").each { |i| puts i.name }
hyperv-hostname.example.com
hyperv-hostname.example.com - 2
hyperv-hostname.example.com - 3
hyperv-hostname.example.com - 4
irb(main):005:0> $evm.vmdb(:host).where("name ~ 'hyperv-hostname'").each { |i| puts i.ems_ref }
d8e310fc-d63f-4603-aba8-33a4ccbbd31d
65c286ce-9f96-4c55-8361-55f7ed36a3d4
62e68605-be94-4a27-a8ee-d0b369431887
8f179946-df85-436a-8a7f-59ab47dbb05c
irb(main):006:0> $evm.vmdb(:host).where("name ~ 'hyperv-hostname'").each { |i| puts i.hostname }
hyperv-hostname.example.com
hyperv-hostname.example.com
hyperv-hostname.example.com
hyperv-hostname.example.com
Comment 5 Jeff Teehan 2017-06-15 16:49:18 EDT
I can test for that.  I'll take a look.
Comment 7 Daniel Berger 2017-07-21 15:10:46 EDT
https://github.com/ManageIQ/manageiq/pull/15632

Note You need to log in before you can comment on or make changes to this bug.