-
Notifications
You must be signed in to change notification settings - Fork 119
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
1.2.3 selects a subnet that doesn't support the requested instance type #368
Comments
Version 1.2.3 made changes to how the plugin handles auto-selection of a subnet when it's not specified, see hashicorp/packer-plugin-amazon@f1ec287 Sadly, the new algorithm selects us-east-1e for us that doesn't support the machine types we use (c6*.large) which causes the build to fail. I reported it here: hashicorp/packer-plugin-amazon#368 One workaround might be to pin a working subnet, but that's apparently also broken in 1.2.3, see hashicorp/packer-plugin-amazon#367 Therefore, I decided to pin the plugin to 1.2.2 for now, and see what's the recommended approach from terraform guys. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
Version 1.2.3 made changes to how the plugin handles auto-selection of a subnet when it's not specified, see hashicorp/packer-plugin-amazon@f1ec287 Sadly, the new algorithm selects us-east-1e for us that doesn't support the machine types we use (c6*.large) which causes the build to fail. I reported it here: hashicorp/packer-plugin-amazon#368 One workaround might be to pin a working subnet, but that's apparently also broken in 1.2.3, see hashicorp/packer-plugin-amazon#367 Therefore, I decided to pin the plugin to 1.2.2 for now, and see what's the recommended approach from terraform guys. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
We're seeing similar behaviour, and we are setting VPC, subnet_id, and availability_zone. It's still picking a subnet in the wrong AZ
(subnet ID redacted) |
Same here. Started yesterday evening. Not good, broke all our builds. |
Hi there folks there is a regression in v1.2.3, as mentioned #367. But I am leaving this issue open because there seems to be a slightly different request. For those affected by the regression you can downgrade the plugin by pinning to v1.2.2 packer {
required_plugins {
amazon = {
version = "= 1.2.2"
source = "github.com/hashicorp/amazon"
}
}
I don't know if this is something that we can account for without actually querying instances types for supported subnets. Does setting the subnet_id to a subnet that has support for the instance fail? The change released yesterday allows for the use of associate_public_ip when no subnet or vpc ID is defined. It does not account for the selected instance type. |
I have not pinned a specific subnet ID. I have noted that even using a subnet filter that filters by VPC ID and Availability zone still picks up a subnet that is not in the requested AZ. So that part is pretty broken.’
I currently have to force the plugin version back to 1.2.2.
-Alan
|
Hi @ondrejbudai, This one as @nywilken said might be tricky. I suspect that the I suspect this worked by accident as the VPC/subnet picked by default associated a public IP by default, if that setting changes, your template will not work anymore. We'll be tackling this in the coming weeks so we can pick a suitable AZ/subnet for this instance type. Apologies again for the unexpected errors. Edit: in the related issue, you did mention pinning a subnet, this was indeed a problem, which we should have fixed with 1.2.4, if you test it out when it's released (the release is in progress and will be out soon), pinning the subnet should be an available workaround for you. |
Ah, we misunderstood the documentation. I will try to remove |
Version 1.2.3 made changes to how the plugin handles auto-selection of a subnet when it's not specified, see hashicorp/packer-plugin-amazon@f1ec287 Sadly, the new algorithm selects us-east-1e for us that doesn't support the machine types we use (c6*.large) which causes the build to fail. I reported it here: hashicorp/packer-plugin-amazon#368 One workaround might be to pin a working subnet, but that's apparently also broken in 1.2.3, see hashicorp/packer-plugin-amazon#367 Therefore, I decided to pin the plugin to 1.2.2 for now, and see what's the recommended approach from terraform guys. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
Version 1.2.3 made changes to how the plugin handles auto-selection of a subnet when it's not specified, see hashicorp/packer-plugin-amazon@f1ec287 Sadly, the new algorithm selects us-east-1e for us that doesn't support the machine types we use (c6*.large) which causes the build to fail. I reported it here: hashicorp/packer-plugin-amazon#368 One workaround might be to pin a working subnet, but that's apparently also broken in 1.2.3, see hashicorp/packer-plugin-amazon#367 Therefore, I decided to pin the plugin to 1.2.2 for now, and see what's the recommended approach from terraform guys. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
Version 1.2.3 made changes to how the plugin handles auto-selection of a subnet when it's not specified, see hashicorp/packer-plugin-amazon@f1ec287 Sadly, the new algorithm selects us-east-1e for us that doesn't support the machine types we use (c6*.large) which causes the build to fail. I reported it here: hashicorp/packer-plugin-amazon#368 One workaround might be to pin a working subnet, but that's apparently also broken in 1.2.3, see hashicorp/packer-plugin-amazon#367 Therefore, I decided to pin the plugin to 1.2.2 for now, and see what's the recommended approach from terraform guys. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
Hi @ondrejbudai, With the latest release of the plugin the issue should be entierly fixed now, since we filter the subnets based on their AZ and their capability to host the requested machine type. Would it be possible for you to test it out with your initial configuration? |
This has been resolved with the latest plugin release. I'm going to close this issue. If you are running into issues or the feature is not working as expected please drop a comment and we will gladly reopen. |
Overview of the Issue
The new subnet selection mechanism in 1.2.3 selects a subnet that doesn't support the requested instance type.
Reproduction Steps
associate_public_ip_address = true
, but don't specify a subnet nor a VPC.Plugin and Packer version
packer-plugin-amazon 1.2.3
Packer v1.8.6
Simplified Packer Buildfile
Full buildfile: https://github.com/osbuild/osbuild-composer/blob/03b093acb024675eab75b7fe266b3e6db2504dc7/templates/packer/worker.pkr.hcl#L21
The important bit is that we set
associate_public_ip_address = true
, but we don't set a subnet or a VPC.Operating system and Environment details
Reproducible in both the docker.io/library/packer container and on Fedora 38 running Packer v1.8.6 from the official repository.
Log Fragments and crash.log files
The text was updated successfully, but these errors were encountered: