Bug 1890501

Summary: [OCP 4.5][vsphere IPI] folder not found if datacenter is inside a folder
Product: OpenShift Container Platform Reporter: Mario Abajo <mabajodu>
Component: InstallerAssignee: aos-install
Installer sub component: openshift-installer QA Contact: Gaoyun Pei <gpei>
Status: CLOSED DUPLICATE Docs Contact:
Severity: low    
Priority: unspecified CC: adahiya, wmealing
Version: 4.5   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-22 17:37:11 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:
Attachments:
Description Flags
openshift_install.log none

Description Mario Abajo 2020-10-22 12:03:45 UTC
Created attachment 1723499 [details]
openshift_install.log

Created attachment 1723499 [details]
openshift_install.log

Thanks for opening a bug report!
Before hitting the button, please fill in as much of the template below as you can.
If you leave out information, it's harder to help you.
Be ready for follow-up questions, and please respond in a timely manner.
If we can't reproduce a bug we might close your issue.
If we're wrong, PLEASE feel free to reopen it and explain why.

Version:

$ openshift-install version
bin/openshift-install 4.5.14
built from commit 9893a482f310ee72089872f1a4caea3dbec34f28
release image quay.io/openshift-release-dev/ocp-release@sha256:95cfe9273aecb9a0070176210477491c347f8e69e41759063642edf8bb8aceb6


Platform:

vsphere 6.7

Please specify:
IPI

What happened?

If the datacenter object in vsphere is inside a folder like in this example:

* Vcenter
  \_ Folder
    \_ Datacenter
      \_ Cluster
       ...

Instead of the clasic hierarchy:

* Vcenter
  \_ Datacenter
    \_ Cluster
     ...

Then the terraform fails with this error:

FATAL failed to fetch Cluster: failed to fetch dependency of "Cluster": failed to generate asset "Platform Provisioning Check": platform.vsphere.folder: Invalid value: "/DATACENTER/vm/Openshift": folder '/DATACENTER/vm/Openshift' not found

Looks like the prefix path used to access folders doesn't take into account this situation.

I will attach a .openshift-install.log file from a test cluster


What did you expect to happen?

Installation success no matter the hierarchy is in vsphere


How to reproduce it (as minimally and precisely as possible)?

It is easy to reproduce just by moving the datacenter in vsphere under a folder and trying to launch an ipi install


Anything else we need to know?

One way to overcome this is explained in the KCS: https://access.redhat.com/solutions/5507161
- First generate the installation file:
$ openshift-install create install-config --dir=DIRECTORY

- Then modify the "datacenter" label on install-config.yaml from this:
    datacenter: DATACENTER_NAME
  to this:
    datacenter: FOLDER_NAME/DATACENTER_NAME

I have not tested yet if this can have further implications

Comment 1 Mario Abajo 2020-10-22 12:07:13 UTC
Full error message:
~~~
INFO Creating infrastructure resources...         
ERROR                                              
ERROR Error: failed to find provided vSphere objects: folder '/DATACENTER/vm/xxxxxx-lfgv8' not found 
ERROR                                              
ERROR   on ../../../tmp/openshift-install-222423625/main.tf line 43, in resource "vsphereprivate_import_ova" "import": 
ERROR   43: resource "vsphereprivate_import_ova" "import" { 
ERROR                                              
ERROR                                              
FATAL failed to fetch Cluster: failed to generate asset "Cluster": failed to create cluster: failed to apply Terraform: failed to complete the change 
~~~

Comment 2 Abhinav Dahiya 2020-10-22 17:37:11 UTC

*** This bug has been marked as a duplicate of bug 1882022 ***