Bug 1972582 - [oVirt] Installing with an oVirt network with 2 vnics on the same network causes the installer to not create tfvars and fail with terraform error
Summary: [oVirt] Installing with an oVirt network with 2 vnics on the same network cau...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.9.0
Assignee: Gal Zaidman
QA Contact: Michael Burman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-16 09:26 UTC by Gal Zaidman
Modified: 2021-10-18 17:34 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:34:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift installer pull 5002 0 None open Bug 1972582: Installing with an oVirt network with 2 vnics on the same network causes the installer to not create tfvars... 2021-06-16 09:47:02 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:34:59 UTC

Description Gal Zaidman 2021-06-16 09:26:26 UTC
When running the installer with an install config that contains a network name but no VNic profile, and on the oVirt side there is more then one VNIC profile attached to the network then the installer will fail with error on missing tfvars.
The missing tfvars are all the oVirt specific vars and the tfvarts.json file is never written.

Example of the error:
```
....

ERROR Error: No value for required variable        
ERROR                                              
ERROR   on ../../../openshift-install-948796804/variables-ovirt.tf line 111: 
ERROR  111: variable "ovirt_master_affinity_groups" { 
ERROR                                              
ERROR The root module input variable "ovirt_master_affinity_groups" is not set, and 
ERROR has no default value. Use a -var or -var-file command line argument to provide 
ERROR a value for this variable.                   
ERROR                                              
ERROR Failed to read tfstate: open /tmp/openshift-install-948796804/terraform.tfstate: no such file or directory 
FATAL failed to fetch Cluster: failed to generate asset "Cluster": failed to create cluster: failed to apply Terraform: failed to complete the change 
```

When looking into the code we do check that and should return a good error message[1], but since this is a custom error and the err var is actually nil then we return with nil which causes the installation to continue and fail when it can't start terraform.

How to test:
Try to install openshift on oVirt with a network that has 2 VNICs attached and expect to get a clear error message:

"failed to compute values for Engine platform, there are multiple vNIC profiles. found 2 vNIC profiles for network _______"

[1] https://github.com/openshift/installer/blob/master/pkg/asset/cluster/tfvars.go#L534

Comment 7 Michael Burman 2021-07-18 08:52:21 UTC
Verified on - openshift-install-linux-4.9.0-0.nightly-2021-07-17-212317 with
rhvm-4.4.7.6-0.11.el8ev.noarch

The installer fails now with more meaningful error message to the user:

"DEBUG Generating Terraform Variables...            
FATAL failed to fetch Terraform Variables: failed to generate asset "Terraform Variables": failed to compute values for Engine platform, there are multiple vNIC profiles. found 2 vNIC profiles for network ovirtmgmt "

Comment 10 errata-xmlrpc 2021-10-18 17:34:35 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.9.0 bug fix and security 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-2021:3759


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