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

Non-existant AMI - cannot run netz #3

Open
cyn8 opened this issue Aug 7, 2022 · 6 comments
Open

Non-existant AMI - cannot run netz #3

cyn8 opened this issue Aug 7, 2022 · 6 comments

Comments

@cyn8
Copy link

cyn8 commented Aug 7, 2022

Hi all,

Getting this error when attempting to run netz on AWS:

[2022-08-08 02:14:47] DEBUG aws going to create ec2 instance
[2022-08-08 02:14:47] ERROR InvalidAMIID.NotFound: The image id '[ami-02649d71054b25d22]' does not exist
	status code: 400, request id: 207603a5-b3e6-439f-9724-6a350a5034ff

Any advice? Thanks!

@cyn8 cyn8 changed the title Non-existant AMI - cannot run nets Non-existant AMI - cannot run netz Aug 7, 2022
@jondot
Copy link
Member

jondot commented Aug 8, 2022

Hi @cyn8 we're accepting PRs,
The line you need to change is here:

ImageId: aws.String("ami-02649d71054b25d22"),

Just have it accept an ENV variable would be OK.

@cyn8
Copy link
Author

cyn8 commented Aug 8, 2022

From my understanding, an AMI provides information required to launch an EC2 instance. What is your AMI that is originally referenced supposed to contain?

@cmpxchg16
Copy link
Member

Hi @cyn8, this AMI is Red Hat Linux distro.

@cyn8
Copy link
Author

cyn8 commented Aug 16, 2022

Hi, thanks for the help. I have modified the code to accept an argument for the AMI name, and I will open a pull request shortly. At the moment however I am experiencing another issue trying to launch with AWS:

% ./netz --file taskdefinition.json --security-group ... --subnet ... --region ap-southeast-2 --number-of-nic 5 --debug --instance-type c4.8xlarge --instance-key-name ... --ami ...

[2022-08-16 13:42:35]  INFO going to create aws cloud resources
[2022-08-16 13:42:35] DEBUG aws going to create iam role
[2022-08-16 13:42:36]  INFO iam role already exist
[2022-08-16 13:42:36]  INFO aws iam role succeed
[2022-08-16 13:42:36] DEBUG aws going to put role policy
[2022-08-16 13:42:37]  INFO aws put role policy succeed
[2022-08-16 13:42:37] DEBUG aws going to create instance profile
[2022-08-16 13:42:37]  INFO instance profile already exist
[2022-08-16 13:42:37]  INFO aws instance profile succeed
[2022-08-16 13:42:37] DEBUG aws going to add role to instance profile
[2022-08-16 13:42:37]  INFO add iam to instance profile succeed
[2022-08-16 13:42:37] DEBUG aws going to create ecs cluster
[2022-08-16 13:42:37]  INFO aws create ecs cluster succeed
[2022-08-16 13:42:37] DEBUG aws going to create ec2 instance
[2022-08-16 13:42:38]  INFO wait until aws ec2 instance running..
[2022-08-16 13:42:54] DEBUG aws create ec2 instance succeed
[2022-08-16 13:42:54] DEBUG aws going to create network interface: #1
[2022-08-16 13:42:54]  INFO aws create network interface succeed: #1
[2022-08-16 13:42:54] DEBUG aws going to allocate elastic ip: #1
[2022-08-16 13:42:54]  INFO aws allocate elastic ip succeed: #1
[2022-08-16 13:42:54] DEBUG aws going to associate elastic ip to network interface: #1
[2022-08-16 13:42:55]  INFO aws associate elastic ip to network interface succeed: #1
[2022-08-16 13:42:55] DEBUG aws going to attach network interface to instance: #1
[2022-08-16 13:42:56]  INFO aws attach network interface to instance succeed: #1
[2022-08-16 13:42:56] DEBUG aws going to create network interface: #2
[2022-08-16 13:42:56]  INFO aws create network interface succeed: #2
[2022-08-16 13:42:56] DEBUG aws going to allocate elastic ip: #2
[2022-08-16 13:42:56]  INFO aws allocate elastic ip succeed: #2
[2022-08-16 13:42:56] DEBUG aws going to associate elastic ip to network interface: #2
[2022-08-16 13:42:57]  INFO aws associate elastic ip to network interface succeed: #2
[2022-08-16 13:42:57] DEBUG aws going to attach network interface to instance: #2
[2022-08-16 13:42:58]  INFO aws attach network interface to instance succeed: #2
[2022-08-16 13:42:58] DEBUG aws going to create network interface: #3
[2022-08-16 13:42:58]  INFO aws create network interface succeed: #3
[2022-08-16 13:42:58] DEBUG aws going to allocate elastic ip: #3
[2022-08-16 13:42:58]  INFO aws allocate elastic ip succeed: #3
[2022-08-16 13:42:58] DEBUG aws going to associate elastic ip to network interface: #3
[2022-08-16 13:42:59]  INFO aws associate elastic ip to network interface succeed: #3
[2022-08-16 13:42:59] DEBUG aws going to attach network interface to instance: #3
[2022-08-16 13:43:00]  INFO aws attach network interface to instance succeed: #3
[2022-08-16 13:43:00] DEBUG aws going to create network interface: #4
[2022-08-16 13:43:00]  INFO aws create network interface succeed: #4
[2022-08-16 13:43:00] DEBUG aws going to allocate elastic ip: #4
[2022-08-16 13:43:00]  INFO aws allocate elastic ip succeed: #4
[2022-08-16 13:43:00] DEBUG aws going to associate elastic ip to network interface: #4
[2022-08-16 13:43:01]  INFO aws associate elastic ip to network interface succeed: #4
[2022-08-16 13:43:01] DEBUG aws going to attach network interface to instance: #4
[2022-08-16 13:43:02]  INFO aws attach network interface to instance succeed: #4
[2022-08-16 13:43:02] DEBUG aws going to create network interface: #5
[2022-08-16 13:43:02]  INFO aws create network interface succeed: #5
[2022-08-16 13:43:02] DEBUG aws going to allocate elastic ip: #5
[2022-08-16 13:43:02]  INFO aws allocate elastic ip succeed: #5
[2022-08-16 13:43:02] DEBUG aws going to associate elastic ip to network interface: #5
[2022-08-16 13:43:03]  INFO aws associate elastic ip to network interface succeed: #5
[2022-08-16 13:43:03] DEBUG aws going to attach network interface to instance: #5
[2022-08-16 13:43:04]  INFO aws attach network interface to instance succeed: #5
[2022-08-16 13:43:04]  INFO waiting until ecs cluster will have container instances..
[2022-08-16 13:43:05]  INFO still waiting (1 seconds)...
[2022-08-16 13:43:06]  INFO still waiting (2 seconds)...
[2022-08-16 13:43:07]  INFO still waiting (3 seconds)...
...
[2022-08-16 13:45:06]  INFO still waiting (120 seconds)...
[2022-08-16 13:45:06] ERROR too much time to wait for ecs container instances
[2022-08-16 13:45:06]  WARN destroying resources, it could take a minute so please don't kill me...
[2022-08-16 13:45:42]  INFO done to destroy resources.

Any advice on the above? Thanks again in advance.

@cyn8
Copy link
Author

cyn8 commented Sep 13, 2022

Hi, just bumping this issue. Not sure where to look from here.

@PeterDaveHello
Copy link

PeterDaveHello commented Oct 26, 2022

From my understanding, an AMI provides information required to launch an EC2 instance. What is your AMI that is originally referenced supposed to contain?

From AMI Lookup (https://github.com/AMILookup/amilookup.com)

image

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

No branches or pull requests

4 participants