Bug 1291891

Summary: network association missing from vm.hardware.nics
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: AutomateAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Shveta <sshveta>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.4.0CC: cpelland, jhardy, mfeifer, mkanoor, obarenbo, sshveta, tfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.6.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1292220 1301084 (view as bug list) Environment:
Last Closed: 2016-06-29 15:21:06 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: 1292220, 1301084    

Comment 2 Greg McCullough 2015-12-15 20:00:50 UTC
Lots of text in the description, but the end result is a request to expose networks from the hardware service model:

miq_ae_service_hardware.rb
    expose :networks,         :association => true  <---Add this line

To reproduce you can use the following code in the rails console:
$evm =
MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
vm = $evm.vmdb(:vm_vmware).first
vm.hardware.networks

Comment 4 CFME Bot 2015-12-16 18:20:42 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/4e2f52994117df7adcbcf7569940ee8512f3a45d

commit 4e2f52994117df7adcbcf7569940ee8512f3a45d
Author:     Lucy Fu <lufu>
AuthorDate: Wed Dec 16 10:50:12 2015 -0500
Commit:     Lucy Fu <lufu>
CommitDate: Wed Dec 16 11:22:48 2015 -0500

    Expose networks from hardware service model.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1291891

 lib/miq_automation_engine/service_models/miq_ae_service_hardware.rb | 1 +
 1 file changed, 1 insertion(+)

Comment 5 CFME Bot 2015-12-17 13:51:58 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=8acaf89b543876fbd2689dbb070b456f25b15cfc

commit 8acaf89b543876fbd2689dbb070b456f25b15cfc
Author:     Lucy Fu <lufu>
AuthorDate: Wed Dec 16 10:50:12 2015 -0500
Commit:     Lucy Fu <lufu>
CommitDate: Wed Dec 16 13:54:53 2015 -0500

    Expose networks from hardware service model.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1291891

 lib/miq_automation_engine/service_models/miq_ae_service_hardware.rb | 1 +
 1 file changed, 1 insertion(+)

Comment 6 CFME Bot 2016-02-09 22:47:52 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=4e24065dbf75767ae725dc923c5f23d924b95cab

commit 4e24065dbf75767ae725dc923c5f23d924b95cab
Author:     Lucy Fu <lufu>
AuthorDate: Wed Dec 16 10:50:12 2015 -0500
Commit:     Lucy Fu <lufu>
CommitDate: Thu Jan 28 11:02:49 2016 -0500

    Expose networks from hardware service model.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1291891

 vmdb/lib/miq_automation_engine/service_models/miq_ae_service_hardware.rb | 1 +
 1 file changed, 1 insertion(+)

Comment 7 Shveta 2016-04-19 18:45:41 UTC
Execute the following in rails console : 
========================
$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
vm_ar = ManageIQ::Providers::Vmware::InfraManager::Vm.all.detect {|v| v.hardware.networks.present?}
vm = $evm.vmdb(:vm_vmware, vm_ar.id)
vm.hardware.networks

-----------------------------
Network association is shown : 

irb(main):040:0> vm.hardware.networks
=> [#<MiqAeServiceNetwork:0xab5f18 @object=#<Network id: 97, hardware_id: 1437, device_id: 212, description: nil, guid: nil, dhcp_enabled: nil, ipaddress: "10.8.59.80", subnet_mask: nil, lease_obtained: nil, lease_expires: nil, default_gateway: nil, dhcp_server: nil, dns_server: nil, hostname: "dhcp-8-59-80.cfme.lab.eng.rdu2.redhat.com", domain: nil, ipv6address: "2620:52:0:83a:250:56ff:fe96:d8f4">, @virtual_columns=["region_description", "region_number"], @associations=["guest_device", "hardware"]>]

===========================================
5.6.0.1-beta2.20160413141124_e25ac0e

Comment 9 errata-xmlrpc 2016-06-29 15:21:06 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/RHBA-2016:1348