Bug 1588908 - [RFE] VMware guests are incorrectly marked as linked_clone true, remove attribute
Summary: [RFE] VMware guests are incorrectly marked as linked_clone true, remove attri...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.12.0
Assignee: Adam Grare
QA Contact: Kedar Kulkarni
URL:
Whiteboard:
Depends On:
Blocks: 1595269 1767885
TreeView+ depends on / blocked
 
Reported: 2018-06-08 05:18 UTC by Nikhil Gupta
Modified: 2020-03-20 15:36 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1767885 (view as bug list)
Environment:
Last Closed: 2020-03-20 15:36:02 UTC
Category: Bug
Cloudforms Team: VMware
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3533791 0 None None None 2018-07-17 02:32:10 UTC

Description Nikhil Gupta 2018-06-08 05:18:21 UTC
Description of problem:
VMs are incorrectly marked as Linked Clones.
Every VM discovered from VMware provider has "linked_clone": true.
However, none of the VMs is sharing a disk or has a snapshot.


Version-Release number of selected component (if applicable):
cfme-5.9.2.4-1.el7cf
VMware

How reproducible:
Always

Steps to Reproduce:
1. Integrate VMware provider

2. Check the total number of VMs present
   # psql -U postgres -d vmdb_production -c "select name from vms where vendor='vmware';" | wc -l

3. Now, check the total number of VMs having linked_clone set as True:
   # psql -U postgres -d vmdb_production -c "select name from vms where vendor='vmware' and linked_clone='t';" | wc -l

Actual results:
All VMware VMs discovered in CFME has linked_clone value set as 't'.

Expected results:
Only VMs which are actually created as linked clone should be marked as true and rest should be marked as false.

Comment 2 James Wong 2018-07-18 03:50:53 UTC
Hi Nikhil,

I just tested refreshing a vCenter and there are some VMs marked as linked_clone and some are not. I picked a couple of them to confirm they are expected.

FYI, the logic of determining a linked_clone is here https://github.com/jameswnl/manageiq-providers-vmware/blob/fda5cdfa7ab90e36bba855ed24fbab3da56f8fa5/app/models/manageiq/providers/vmware/infra_manager/refresh_parser.rb#L962-L970

And you can use the vsphere's mob browser to confirm if the VM config matched the logic.

Let me know the vCenter you are using and also a VM you think is being inventoried incorrectly.

Thanks,
James

Comment 4 James Wong 2018-07-18 22:42:16 UTC
Hi Nikhil,

I have tested on 6.5, 6.0 and 5.5 and all of them are exhibiting this issue. 

I further look at the code we currently have and it was based on this blog http://www.vmdev.info/?p=546 which was apparently written for vSphere 4.

Googling on the web, people are asking the same question about how to determine if a VM is a linked clone and there's no answer (Except the above mentioned blog)

vSphere clients doesn't have options to create a linked clone VM.  Only way to do so seems is through API.  CFME cloning process does allow that.  However, after the cloning, the VM is still defying the logic we have in code.

So this feature seems broken for a long time as the code hasn't been touched for a long  time.

To fix this issue, there'll be considerable work and the method we will be using is simply our own observations and even that is not guaranteed to work for forthcoming vSphere releases.

Can you provide more information about the customer case especially on how their business would be impact? 

Adding Brad to decide next step on this issue

regards,
James

Comment 5 James Wong 2018-07-18 22:44:07 UTC
(My comment on a earlier separate test on 7/17 was done on a smaller setup and that vCenter is broken when I want to look further into it)

Comment 10 Nikhil Gupta 2018-09-24 02:24:11 UTC
Hi Brad and James,

I have updated the following kcs solution:
https://access.redhat.com/solutions/3533791

Regards,
Niks

Comment 19 CFME Bot 2019-08-12 19:12:31 UTC
New commit detected on ManageIQ/manageiq-providers-vmware/master:

https://github.com/ManageIQ/manageiq-providers-vmware/commit/913541977e5d7724f8c05751de2ae338d4fdff9f
commit 913541977e5d7724f8c05751de2ae338d4fdff9f
Author:     Adam Grare <agrare>
AuthorDate: Mon Aug 12 11:56:41 2019 -0400
Commit:     Adam Grare <agrare>
CommitDate: Mon Aug 12 11:56:41 2019 -0400

    Linked Clone cannot be accurately collected

    Don't set the linked_clone attribute because it cannot be accurately
    detected and set.

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1588908

 app/models/manageiq/providers/vmware/infra_manager/refresh_parser.rb | 5 -
 1 file changed, 5 deletions(-)


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