Bug 1461584 - Provisioning to MS SCVMM Uses host.name instead of host.hostname
Provisioning to MS SCVMM Uses host.name instead of host.hostname
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning (Show other bugs)
Unspecified Unspecified
medium Severity medium
: GA
: 5.9.0
Assigned To: Daniel Berger
Leo Khomenko
: 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:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1479367 1479377 (view as bug list)
Last Closed: 2018-03-06 09:40:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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):


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 - 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 }
irb(main):006:0> $evm.vmdb(:host).where("name ~ 'hyperv-hostname'").each { |i| puts i.hostname }
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

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