Open lsq-ablair opened 9 months ago
May relate to https://github.com/hashicorp/packer-plugin-amazon/issues/122.
When specifying an amazon-ebs builder, I'm trying to set the boot volume size with launch_block_device_mappings. By the above bug, I should set this to "xvda" for Windows root devices.
However, with the hcl code,
data "amazon-ami" "windows_server_2022" { filters = { name = "Windows_Server-2022-English-Full-Base-*" root-device-type = "ebs" virtualization-type = "hvm" } most_recent = true owners = ["801119661308"] # Amazon Official region = "us-east-1" } source "amazon-ebs" "this" { ami_name = "Test" ami_virtualization_type = "hvm" instance_type = "m3.xlarge" launch_block_device_mappings { # The C drive delete_on_termination = true device_name = "xvda" #"/dev/xvda" volume_size = 50 } launch_block_device_mappings { delete_on_termination = true device_name = "xvdb" volume_size = 100 volume_type = "gp3" } region = "us-east-1" source_ami = data.amazon-ami.windows_server_2022.id subnet_id = var.subnet_id user_data = templatefile(var.user_data_file, {winrm_password = data.external-raw.random_pass.result}) communicator = "winrm" winrm_insecure = true winrm_port = 5986 winrm_use_ssl = true }
I get three volumes. The goal is to increase /dev/sda1 from 30 -> 50GB, but instead I get a new volume:
device_name = "/dev/xvda"
device_name = "xvda"
The two xvdX volumes are kept separate and neither applies to the root volume. However, when I specify either /dev/sda or sda, I get an error:
/dev/sda
sda
launch_block_device_mappings { # The C drive delete_on_termination = true device_name = "/dev/sda" volume_size = 50 } ==> amazon-ebs.this: Error launching source instance: InvalidBlockDeviceMapping: Invalid ==> amazon-ebs.this: device name /dev/sda ==> amazon-ebs.this: status code: 400, request id: cc529xxx-xxx
I believe this is a bug or regression. Or is there something wrong with the builder config?
May relate to https://github.com/hashicorp/packer-plugin-amazon/issues/122.
When specifying an amazon-ebs builder, I'm trying to set the boot volume size with launch_block_device_mappings. By the above bug, I should set this to "xvda" for Windows root devices.
However, with the hcl code,
I get three volumes. The goal is to increase /dev/sda1 from 30 -> 50GB, but instead I get a new volume:
device_name = "/dev/xvda"
device_name = "xvda"
The two xvdX volumes are kept separate and neither applies to the root volume. However, when I specify either
/dev/sda
orsda
, I get an error:I believe this is a bug or regression. Or is there something wrong with the builder config?