Closed wiza closed 7 years ago
Also seeing this behaviour where AWS instances cannot be created with the error: "msg: Instance creation failed => InvalidParameterCombination: Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type."
Try exporting the following env variable:
export ec2_vpc_subnet=<valid VPC subnet id>
I believe the issue is related to ec2 limiting access to certain instance sizes in classic mode.
I already export the subnet (as we have quite a few, and need to select the correct one)
@benbarclay are you overriding any of the default instance types through env variables as well?
ec2_instance_type will set a default override ec2_master_instance_type will override master hosts only ec2_node_instance_type will override node hosts only ec2_infra_instance_type will override infra node hosts only ec2_etcd_instance_type will override ec2 hosts only
It could be an issue with m4.large instances in your region/az.
ec2_region='ap-southeast-2' \ ec2_keypair='REDACTED' \ ec2_image='ami-d38dc6e9' \ ec2_vpc_subnet="REDACTED" \ ec2_assign_public_ip='true' \ bin/cluster -v create aws --deployment-type=origin openshift
It was working for me a few days ago, then I started getting the above error after a git pull brought me up to date with master.
Having said that, I checked out out the previous version I was on and can't deploy from it either now.
@benbarclay have you tried reverting to your previous checkout? I saw the same issue a couple of weeks ago, and resolved it by setting ec2_vpc_subnet, which then provisioned the hosts inside of a vpc instead of ec2 classic, which is the default for my account.
Do you see the same error when attempting to spin up a m4.large instance using the same image in the same vpc subnet within the same region? The error indicates that ec2 isn't allowing that combination for your account at this time.
Switching one or more of the following: region, vpc_subnet, instance_type should clear up the issue.
I changed the region (was deploying to eu-west-1 before) so I unsetted and tried to ran with defaults. It has worked before. Should I remove all vpcs, keypairs, etc. These scripts have previously launched instances inside vpc by default?
@wiza it will use the default VPC if configured for accounts that don't have access to ec2 classic.
Have you tried using m3.large instances instead?
export ec2_instance_type=m3.large
@detiber no help on changing instance_type, also no use of specifying existing vpc subnet or changing region.
@wiza it looks like the error message I was looking at was the wrong one.
TASK: [fail msg="Could not find requested ami"]
This appears to tell me that the centos image we are referencing is no longer available.
Could you verify the ami id for the latest CentOS image?
ami-33734044 @ eu-west-1
Log has ami-96a818fe @ us-east-1, which are the defaults in the script. But it's the same error, what ever the variables...
I'll attempt to replicate today.
It looks like the env lookups we were doing to set the defaults for the instance types is the issue. I submitted https://github.com/openshift/openshift-ansible/pull/1003 to address it.
The big thing was that the env lookup plugin was returning an empty string for a non-existent environment variable which prevented the template from returning the right instance type, and was instead passing the empty string on as the instance type. I updated the use of the default filter to treat the values as booleans for the existence test and my testing shows that it is working as expected with that change.
This issue has been inactive for quite some time. Please update and reopen this issue if this is still a priority you would like to see action on.
Older version (month ago or so) worked, running on CentOS 7.1, this is the log:
$ bin/cluster -vvvvv create aws test RUN [time ansible-playbook -vvvvv -i inventory/aws/hosts -e 'num_masters=1 num_nodes=2 cluster_id=test num_etcd=0 num_infra=1 deployment_type=origin' playbooks/aws/openshift-cluster/launch.yml]
PLAY [Launch instance(s)] ***** localhost: not importing file: /home/centos/openshift/openshift-ansible/playbooks/aws/openshift-cluster/vars.origin.test.yml
TASK: [fail ] ***** skipping: [localhost]
TASK: [set_fact k8s_type="etcd"] ****** ok: [localhost] => {"ansible_facts": {"k8s_type": "etcd"}}
TASK: [Generate etcd instance names(s)] *** skipping: [localhost]
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"etcd_names": []}}
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"created_by": "centos", "docker_vol_ephemeral": "False", "env": "test", "env_host_type": "test-openshift-etcd", "host_type": "etcd", "sub_host_type": "default"}}
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"ec2_region": "us-east-1"}}
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"ec2_image_name": ""}}
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"ec2_image": "ami-96a818fe"}}
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"ec2_keypair": "libra"}}
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"ec2_vpc_subnet": ""}}
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"ec2_assign_public_ip": ""}}
TASK: [set_fact ] ***** skipping: [localhost]
TASK: [set_fact ] ***** ok: [localhost] => {"ansible_facts": {"ec2_instance_type": "", "ec2_security_groups": ["public"]}}
TASK: [set_fact ] ***** skipping: [localhost]
TASK: [set_fact ] ***** skipping: [localhost]
TASK: [set_fact ] ***** skipping: [localhost]
TASK: [set_fact ] ***** skipping: [localhost]
TASK: [Find amis for deployment_type] *****