Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to override AMI using amiID #991

Closed
miabbott opened this issue Jan 4, 2019 · 9 comments
Closed

unable to override AMI using amiID #991

miabbott opened this issue Jan 4, 2019 · 9 comments

Comments

@miabbott
Copy link
Member

miabbott commented Jan 4, 2019

Version

$ bin/openshift-install version
bin/openshift-install v0.7.0-master-79-g713289e20bd6afccb06f2e4ff7ed89d2483fac9a

Platform (aws|libvirt|openstack):

aws

What happened?

Trying to override the AMI the installer is using by specifying the amiID as part of the install-config.yaml file as noted in this comment

It wasn't clear where the amiID should be defined, but placing the amiID in various places throughout the install-config.yaml did not work for myself and others. Examples of config snippets that did not work below:

platform:
  aws:
    amiID: ami-017846ebe8ad7b7c7
    region: us-east-2
    vpcCIDRBlock: 10.0.0.0/16
machines:
- name: master
  platform: {}
  replicas: 3
  amiID: ami-017846ebe8ad7b7c7
- name: worker
  platform: {}
  replicas: 3
  amiID: ami-017846ebe8ad7b7c7
platform:
  aws:
    defaultMachinePlatform:
      amiID: ami-0d62429fac06659b1
    region: us-west-2
    vpcCIDRBlock: 10.0.0.0/16

What you expected to happen?

Installer uses the specified amiID for master/worker nodes.

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

  1. Create install-config.yaml
  2. Try to specify AMI via amiID in the install-config.yaml
  3. Run the installer

Anything else we need to know?

This could just be a case of better documentation about how to use amiID (or some other mechanism for selecting an AMI).

References

#728

cc: @mike-nguyen @ashcrow

@ashcrow
Copy link
Member

ashcrow commented Jan 4, 2019

/cc @wking

@staebler
Copy link
Contributor

staebler commented Jan 4, 2019

I added a comment to #728 with a sample of where the AMI would be defined in a machine pool.

@staebler
Copy link
Contributor

staebler commented Jan 4, 2019

You could also define it in the defaultMachinePlatform. It would be .platform.aws.defaultMachinePlatform.amiID.

@mike-nguyen
Copy link
Member

mike-nguyen commented Jan 4, 2019

I hit the same issue. The AMI specified in the install-config seems to be picked up in .openshift_install_state.json but is not reflected in terraform.tfvars. The resulting cluster doesn't seem to be using the AMI I specified.

install-config.yaml:

platform:
  aws:
    defaultMachinePlatform:
      amiID: ami-0d62429fac06659b1
    region: us-west-2
    vpcCIDRBlock: 10.0.0.0/16

.openshift_install_state.json:

            "platform": {
                "aws": {
                    "region": "us-west-2",
                    "defaultMachinePlatform": {
                        "amiID": "ami-0d62429fac06659b1",                                                              
                        "type": "",
                        "iamRoleName": "",
                        "rootVolume": {
                            "iops": 0,
                            "size": 0,
                            "type": ""
                        }
                    },
                    "vpcCIDRBlock": "10.0.0.0/16"
                }
            },

terraform.tfvars:

  "aws_ec2_ami_override": "ami-0ba5f11d0478bde38",                                                                     
  "aws_region": "us-west-2",
  "aws_vpc_cidr_block": "10.0.0.0/16",
  "libvirt_network_if": "",
  "libvirt_ip_range": ""
}

@miabbott
Copy link
Member Author

miabbott commented Jan 4, 2019

I added a comment to #728 with a sample of where the AMI would be defined in a machine pool.

Thanks @staebler

Copying here for completeness:

- name: master
  platform:
    aws:
      amiID: ami-deadbeef
  replicas: 3

I just tried this myself, but met the same outcome where the AMI specified was not used during install time. See below:

machines:
- name: master
  platform:
    aws:
      amiID: ami-0d62429fac06659b1
  replicas: 3
- name: worker
  platform:
    aws:
      amiID: ami-0d62429fac06659b1
  replicas: 3
      "machines": [
        {
          "name": "master",
          "replicas": 3,
          "platform": {
            "aws": {
              "amiID": "ami-0d62429fac06659b1",
              "type": "",
              "iamRoleName": "",
              "rootVolume": {
                "iops": 0,
                "size": 0,
                "type": ""
              }
            }
          }
        },
        {
          "name": "worker",
          "replicas": 3,
          "platform": {
            "aws": {
              "amiID": "ami-0d62429fac06659b1",
              "type": "",
              "iamRoleName": "",
              "rootVolume": {
                "iops": 0,
                "size": 0,
                "type": ""
              }
            }
          }
        }
      ],
DEBUG module.masters.aws_instance.master[2]: Creating...                     
DEBUG   ami:                                             "" => "ami-0ba5f11d0478bde38"                    
$ aws ec2 describe-instances --filters "Name=tag:clusterid,Values=miabbott0104d" | grep ami-
INSTANCES       0       x86_64          False   True    xen     ami-0ba5f11d0478bde38   i-0d258acc93fb21d8b     m4.large        2019-01-04T15:31:39.000Z        ip-10-0-39-248.us-west-2.compute.internal       10.0.39.248        ec2-54-218-119-130.us-west-2.compute.amazonaws.com      54.218.119.130  /dev/xvda       ebs     True            subnet-0f4c7c52c4d7d028a        hvm     vpc-056bb5213fe47e6bf
INSTANCES       0       x86_64          False   True    xen     ami-0ba5f11d0478bde38   i-0f84e4cf1ee7dff5f     m4.large        2019-01-04T15:31:38.000Z        ip-10-0-31-72.us-west-2.compute.internal        10.0.31.72 ec2-52-27-11-91.us-west-2.compute.amazonaws.com 52.27.11.91     /dev/xvda       ebs     True            subnet-0f7ae6b4c178fafb1        hvm     vpc-056bb5213fe47e6bf
INSTANCES       0       x86_64          False   True    xen     ami-0ba5f11d0478bde38   i-0f409f5c881c912b1     m4.large        2019-01-04T15:31:35.000Z        ip-10-0-12-33.us-west-2.compute.internal        10.0.12.33 ec2-54-245-149-65.us-west-2.compute.amazonaws.com       54.245.149.65   /dev/xvda       ebs     True            subnet-0227b2592defc8729        hvm     vpc-056bb5213fe47e6bf
INSTANCES       0       x86_64          False   True    xen     ami-0d62429fac06659b1   i-05707da60ae414390     m4.large        2019-01-04T15:43:27.000Z        ip-10-0-153-184.us-west-2.compute.internal      10.0.153.184               /dev/xvda       ebs     True            subnet-0d2c5517e8f447ce3        hvm     vpc-056bb5213fe47e6bf
INSTANCES       0       x86_64          False   True    xen     ami-0d62429fac06659b1   i-0841b816acfff0989     m4.large        2019-01-04T15:43:32.000Z        ip-10-0-135-135.us-west-2.compute.internal      10.0.135.135               /dev/xvda       ebs     True            subnet-0beface05cce18b84        hvm     vpc-056bb5213fe47e6bf
INSTANCES       0       x86_64          False   True    xen     ami-0d62429fac06659b1   i-08133508748c905ff     m4.large        2019-01-04T15:43:30.000Z        ip-10-0-164-16.us-west-2.compute.internal       10.0.164.16                /dev/xvda       ebs     True            subnet-0aa7df79cdf9f3e1e        hvm     vpc-056bb5213fe47e6bf

@miabbott
Copy link
Member Author

miabbott commented Jan 4, 2019

Oh actually, it looks like it was used for the workers but not the masters?

@wking
Copy link
Member

wking commented Jan 4, 2019

Oh actually, it looks like it was used for the workers but not the masters?

Sounds like it's just Terraform-variable generation that's broken then. #792 should fix that.

@wking
Copy link
Member

wking commented Jan 18, 2019

amiID is gone since b07f23e (#1052). In the rare case that you do need an override, you can use the OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE=ami-... environment variable added in #1052.

/close

@openshift-ci-robot
Copy link
Contributor

@wking: Closing this issue.

In response to this:

amiID is gone since b07f23e (#1052). In the rare case that you do need an override, you can use the OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE=ami-... environment variable added in #1052.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants