hashicorp / hashicorp/packer-plugin-amazon

Root device volume size ignored in amazon-ebssurrogate

Open
#271 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
91
Forks
141
Avg merge
2d 18h
Merged PRs (30d)
3

Description

#### Overview of the Issue

It seems like the size of the created root device does not honor the volume_size parameter. Whatever I do the volume size for the booted root is 8 GB for an ubuntu 18.04 image from Amazon.

#### Reproduction Steps

1. Complement the simplified packer buildfile below with needed values for your AWS environment.
2. Run the buildfile and inspect the output from the `fdisk -l` command. It should contain one disk (root) with partitions and the size 12 GB and an empty disk with the size of 10 GB.

This is the relevant output I get from the `fdisk -l` command.

```bash
amazon-ebssurrogate: Disk /dev/nvme1n1: 10 GiB, 10737418240 bytes, 20971520 sectors
amazon-ebssurrogate: Units: sectors of 1 * 512 = 512 bytes
amazon-ebssurrogate: Sector size (logical/physical): 512 bytes / 512 bytes
amazon-ebssurrogate: I/O size (minimum/optimal): 4096 bytes / 4096 bytes
amazon-ebssurrogate:
amazon-ebssurrogate:
amazon-ebssurrogate: Disk /dev/nvme0n1: 8 GiB, 8589934592 bytes, 16777216 sectors
amazon-ebssurrogate: Units: sectors of 1 * 512 = 512 bytes
amazon-ebssurrogate: Sector size (logical/physical): 512 bytes / 512 bytes
amazon-ebssurrogate: I/O size (minimum/optimal): 4096 bytes / 4096 bytes
amazon-ebssurrogate: Disklabel type: gpt
amazon-ebssurrogate: Disk identifier: 33C1FEF2-B351-4A2D-A23D-D9FB1E83BA72
amazon-ebssurrogate:
amazon-ebssurrogate: Device Start End Sectors Size Type
amazon-ebssurrogate: /dev/nvme0n1p1 227328 16777182 16549855 7.9G Linux filesystem
amazon-ebssurrogate: /dev/nvme0n1p14 2048 10239 8192 4M BIOS boot
amazon-ebssurrogate: /dev/nvme0n1p15 10240 227327 217088 106M EFI System
amazon-ebssurrogate:
amazon-ebssurrogate: Partition table entries are not in disk order.
```

### Plugin and Packer version

Packer v1.8.3

### Simplified Packer Buildfile

```json
{
"builders": [
{
"type": "amazon-ebssurrogate",
"instance_type": "t3a.nano",
"ami_name": "ami-name",
"ssh_username": "ubuntu",
"region": "...",
"ami_virtualization_type": "hvm",
"source_ami_filter": {
"filters": {
"name": "ubuntu/*-18.04-amd64-*",
"root-device-type": "ebs",
"virtualization-type": "hvm"
},
"most_recent": true,
"owners": [
"amazon"
]
},
"launch_block_device_mappings": [
{
"delete_on_termination": true,
"device_name": "/dev/sde",
"volume_size": 10,
"volume_type": "gp3"
}
],
"ami_root_device": {
"delete_on_termination": true,
"device_name": "/dev/sda1",
"source_device_name": "/dev/sde",
"volume_size": 12,
"volume_type": "gp3"
}
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo fdisk -l"
]
}
]
}
```

### Operating system and Environment details

Ubuntu 20.04 running in WSL2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.