Skip to content

AWS prepare without credentials present fails due to no EC2 IMDS role found #297

@mkolesnik

Description

@mkolesnik

What happened:
Running cloud prepare for AWS via subctl, when no ~/.aws/credentials file is found, fails with:

 ✓ Preparing AWS cloud for Submariner deployment
 ✓ Obtained infra ID "mkolesni-subm-deb2-42pgb" and region "us-east-1" from OCP metadata file "mkolesni-subm-deb2/metadata.json"
 ✓ Initializing AWS connectivity
 ✗ Retrieving VPC ID 
 ✗ Unable to retrieve the VPC ID: error describing AWS VPCs: operation error EC2: DescribeVpcs, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded
 ✗ Failed to prepare AWS cloud: unable to retrieve the VPC ID: error describing AWS VPCs: operation error EC2: DescribeVpcs, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded

subctl version: devel

What you expected to happen:
It should present a clear error message
On 0.11.2 it used to present this message:

 ✗ Retrieving AWS credentials from your AWS configuration
 ✗ failed to read AWS credentials from /root/.aws/credentials: open /root/.aws/credentials: no such file or directory

How to reproduce it (as minimally and precisely as possible):
Install openshift on AWS using openshift-installer: ./openshift-install create cluster
Run cloud prepare: subctl cloud prepare aws

Anything else we need to know?:

Environment:

  • Diagnose information (use subctl diagnose all):
  • Gather information (use subctl gather):
  • Cloud provider or hardware configuration: AWS
  • Install tools: openshift-install 4.10.16
  • Others: Happens on devel and on 0.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions