Bug 1882022 - [vsphere][ipi] directory path is incomplete, terraform can't find the cluster
Summary: [vsphere][ipi] directory path is incomplete, terraform can't find the cluster
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.7.0
Assignee: Jeremiah Stuever
QA Contact: jima
URL:
Whiteboard:
: 1890501 (view as bug list)
Depends On:
Blocks: 1918510
TreeView+ depends on / blocked
 
Reported: 2020-09-23 15:45 UTC by Dan Yocum
Modified: 2021-06-14 21:35 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:19:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
American Systems wrapper scripts for vSphere UPI install (24.76 KB, application/gzip)
2020-10-02 17:09 UTC, Dan Yocum
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift installer pull 4493 0 None closed Bug 1882022: installconfig: enable vsphere folders for datacenters and clusters. 2021-02-18 03:20:26 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:20:58 UTC

Description Dan Yocum 2020-09-23 15:45:31 UTC
Description of problem:

For IPI the terraform code cannot find the cluster that is in the the configuration to deploy the ova (because of a reference path being incomplete)


How reproducible:

Always

Steps to Reproduce:
1. Install on vSphere via IPI

Actual results:

The reference is wrong in the installer business logic.  It is make to many assumptions.

In this case the call out to the vsphere api should look for the location that the cluster resides and not assume that it is in the root path.

IE: the installer seeds terraform the path of '/core/host/tims-esp' when the actual path is '/core/host/ResourcePools/tims-esp'

  THE FIX:

Walk the path from the core to the actual MOB reference.

THE FAILURE:

[root@tilctrl401 osc_ryan]# ./openshift-install create install-config
? Platform vsphere
? vCenter tiavcsa651.ti.com
? Username svccoreocpvc
? Password [? for help] ****************
INFO Connecting to vCenter tiavcsa651.ti.com
INFO Defaulting to only available datacenter: core
? Cluster tims-esp
? Default Datastore tims_esp_ssd_01
? Network 160_os_ip_01-vds
? Virtual IP Address for API 10.60.1.40
? Virtual IP Address for Ingress 10.60.1.41
? Base Domain dhms.io
? Cluster Name ocp604
? Pull Secret [? for help] *******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

[root@tilctrl401 osc_ryan]# ./openshift-install create cluster
INFO Consuming Install Config from target directory
INFO Obtaining RHCOS image file from 'https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.5/45.82.202007141718-0/x86_64/rhcos-45.82.202007141718-0-vmware.x86_64.ova?sha256=9c977abeba0aeedc222ae9dd3d27e659bb5c959c9fd6b199f940d16de07ded4e'
INFO Creating infrastructure resources...
ERROR
ERROR Error: failed to find provided vSphere objects: cluster '/core/host/tims-esp' not found
ERROR
ERROR   on ../../tmp/openshift-install-627270158/main.tf line 43, in resource "vsphereprivate_import_ova" "import":
ERROR   43: resource "vsphereprivate_import_ova" "import" {
ERROR
ERROR



Expected results:

Succeeds

Comment 1 Dan Yocum 2020-09-23 15:50:35 UTC
Per the customer, this is a work-around:

echo "## fixing cloud provider vsphere path" ${_occmd} get cm cloud-provider-config -n openshift-config -o yaml | sed -E "s~folder = \"(.*)\"~folder = \"${_path}\"~g" | ${_occmd} apply -f -

Comment 2 Abhinav Dahiya 2020-09-23 16:47:58 UTC
Since it seems like you are using create install-config and then create cluster. Can you please attach

1. the install-config.yaml , feel free to remove the senstive bits like passwords and secrets

2. also the .openshift_install.log

Comment 4 W. Trevor King 2020-09-23 20:56:54 UTC
4.5 install issues should not block 4.6 going GA.  Punting to 4.7, and any fixes may be backported to 4.5.

Comment 8 Dan Yocum 2020-10-02 17:09:46 UTC
Created attachment 1718485 [details]
American Systems wrapper scripts for vSphere UPI install

install-config.yaml is located at artifacts/upi-int-install-config.yaml in the tarball.

Comment 12 Abhinav Dahiya 2020-10-22 17:37:11 UTC
*** Bug 1890501 has been marked as a duplicate of this bug. ***

Comment 13 Jeremiah Stuever 2020-10-28 20:55:47 UTC
I have created a JIRA to track this RFE: https://issues.redhat.com/browse/CORS-1586

Comment 14 Jeremiah Stuever 2020-10-28 21:02:02 UTC
An JIRA has been created to track this as an RFE. A workaround was discussed in Comment 1. An alternative workaround is to use root folders instead of other locations until this RFE is completed. Closing this BZ in favor of the JIRA.

Comment 15 Dan Yocum 2020-12-04 17:28:08 UTC
This is a bug.  "IE: the installer seeds terraform the path of '/core/host/tims-esp' when the actual path is '/core/host/ResourcePools/tims-esp'"

Re-opening to ease tracking in the customer portal.

Comment 19 Jeremiah Stuever 2020-12-17 05:08:55 UTC
I was able to successfully deploy a cluster where the datacenter is in a folder... (Vcenter/foo/Datacenter-1). The PR for this BZ will include an update to the installer to include the folder name the datacenter value when a user selects one from the prompt which requires it. As a workaround, a user can edit the install-config.yaml and update the datacenter field to include the folder name. For example:

platform:
  vsphere:
    datacenter: foo/Datacenter-1

Comment 21 Jeremiah Stuever 2020-12-17 05:54:48 UTC
I was able to successfully deploy a cluster where the vsphere cluster is in a folder... (Vcenter/Datacenter-1/bar/Cluster-1). The PR for this BZ will include an update to the installer to include the folder name in the cluster value when a user selects one from the prompt which requires it. As a workaround, a user can edit the install-config.yaml and update the cluster field to include the folder name. For example:

platform:
  vsphere:
    cluster: bar/Cluster-1

Comment 26 jima 2021-01-19 06:39:34 UTC
Verified on 4.7.0-0.nightly-2021-01-17-211555 by using Jeremiah's vsphere platform and passed.

both cluster and datacenter are in customized folder:
    cluster: bar/Cluster-1
    datacenter: foo/SDDC-Datacenter

Creating cluster by running "./openshift-install create cluster --dir ipi", and cluster is installed completely.
$ ./oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.7.0-0.nightly-2021-01-18-214951   True        False         18m     Cluster version is 4.7.0-0.nightly-2021-01-18-214951

Comment 31 errata-xmlrpc 2021-02-24 15:19:20 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), 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/RHSA-2020:5633


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