Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1867975

Summary: [aws-custom-region]If no amiID specified in us-gov region, installer will try to copy AMI image which is not allowed from us-gov.
Product: OpenShift Container Platform Reporter: Yunfei Jiang <yunjiang>
Component: InstallerAssignee: Abhinav Dahiya <adahiya>
Installer sub component: openshift-installer QA Contact: Yunfei Jiang <yunjiang>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: medium CC: adahiya, jstuever
Version: 4.6   
Target Milestone: ---   
Target Release: 4.6.0   
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-27 16:27:30 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
install log none

Description Yunfei Jiang 2020-08-11 10:00:09 UTC
Created attachment 1711057 [details]
install log

Copy AMI image is not supported by us-gov region, the custom AMI must be specified.
When trying to install a cluster without amiID, the installer will also try to do `copy ami` action:

time="2020-08-10T14:31:14Z" level=error msg="Error: InvalidRequest: Copy image not allowed from specified region."
time="2020-08-10T14:31:14Z" level=error msg="\tstatus code: 400, request id: cb654de4-8e1e-400d-ac98-303cffce8a62"

If install a cluster in us-gov region, but do not provide amiID, install should be report a validation error instead of trying to do an unsupported action which is a known limitation.

install config:
```
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform: {}
  replicas: 3
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform: {}
  replicas: 3
metadata:
  creationTimestamp: null
  name: yunjiang-us-noep
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  machineNetwork:
  - cidr: 10.0.0.0/16
  networkType: OpenShiftSDN
  serviceNetwork:
  - 172.30.0.0/16
platform:
  aws:
    region: us-gov-west-1
publish: Internal
```

Version-Release number of the following components: 
4.6.0-0.nightly-2020-08-09-151434
 
How reproducible: 
Always 
 
Steps to Reproduce: 
1. Create a private cluster with abobe install-config
 
Actual results: 

time="2020-08-10T14:31:14Z" level=error msg="Error: InvalidRequest: Copy image not allowed from specified region."
time="2020-08-10T14:31:14Z" level=error msg="\tstatus code: 400, request id: cb654de4-8e1e-400d-ac98-303cffce8a62"
time="2020-08-10T14:31:14Z" level=error
time="2020-08-10T14:31:14Z" level=error msg="  on ../../../tmp/openshift-install-651586325/main.tf line 114, in resource \"aws_ami_copy\" \"imported\":"
time="2020-08-10T14:31:14Z" level=error msg=" 114: resource \"aws_ami_copy\" \"imported\" {"
time="2020-08-10T14:31:14Z" level=error

Expected results: 
do not try to do copy action, install reports a validation error

Additional info:

Comment 3 Yunfei Jiang 2020-09-11 09:16:47 UTC
verified. PASS.
version: 4.6.0-0.nightly-2020-09-10-195619

Comment 5 errata-xmlrpc 2020-10-27 16:27:30 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 (OpenShift Container Platform 4.6 GA Images), 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-2020:4196