# Aws ec2 lvm ami

**URL:** <https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312>\
**Category:** Rocky Linux Help & Support\
**Created:** [December 20, 2022, 2:10pm UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312 "2022-12-20T14:10:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![invadetl](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@invadetl](https://forums.rockylinux.org/u/invadetl)\
**Post date:** [December 20, 2022, 2:10pm UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312/1 "2022-12-20T14:10:05Z")

</div>

Hi.

I see the 8.7 repo includes a number of new images, including:  
Rocky-8-EC2-LVM.latest.x86\_64.qcow2

are there any plans to add an LVM based AMI to the AWS Marketplace?

Thanks.

---

<div class="post-metadata">

**Author:** ![neil](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/neil/32/34_2.png) [@neil](https://forums.rockylinux.org/u/neil)\
**Post date:** [December 21, 2022, 5:53am UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312/2 "2022-12-21T05:53:51Z")

</div>

Hi there,

Thank you for asking! It is planned to release them, but I want to do some testing on them to ensure they are working properly with expanding the disk… something I just ran into with Oracle and want to make sure I resolve before publishing. If you’d like to help, I can provide some instructions on how to import the image yourself from that .qcow2 file.

Best,  
Neil

---

<div class="post-metadata">

**Author:** ![invadetl](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@invadetl](https://forums.rockylinux.org/u/invadetl)\
**Post date:** [December 21, 2022, 9:42am UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312/3 "2022-12-21T09:42:16Z")

</div>

Hi.

Thanks for the response.

At the moment we create our own LVM AMIs from qcow2 images created using QEMU. I was hoping to avoid this step by using an official AMI.

I am currently in the process of planning our migration to RL9. Until the official AMIs are available, I would be more than happy to test using the Rocky-9-EC2-LVM.latest.x86\_64.qcow2 image and report back anything of interest.

Just in case my process is different to yours. I simply convert the image to raw format using “qemu-img convert” and then import the image as a snapshot, as per:

> **[Importing a disk as a snapshot using VM Import/Export - VM Import/Export](https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-import-snapshot.html)**
>
> Import a disk from a virtualization environment to Amazon EC2 as an Amazon EBS snapshot.

If you would like me to test something else, just let me know.

---

<div class="post-metadata">

**Author:** ![neil](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/neil/32/34_2.png) [@neil](https://forums.rockylinux.org/u/neil)\
**Post date:** [December 21, 2022, 6:29pm UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312/4 "2022-12-21T18:29:33Z")

</div>

yep, that is the exact same process.

I appreciate your testing!

---

<div class="post-metadata">

**Author:** ![invadetl](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@invadetl](https://forums.rockylinux.org/u/invadetl)\
**Post date:** [December 22, 2022, 3:41pm UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312/5 "2022-12-22T15:41:51Z")

</div>

Disk images converted successfully:

```auto
ls -al Rocky-*
-rw-r--r--. 1 user user 3047555072 Dec 22 12:32 Rocky-8-EC2-LVM.latest.x86_64.qcow2
-rw-r--r--. 1 user user 10737418240 Dec 22 13:14 Rocky-8-EC2-LVM.latest.x86_64.raw
-rw-r--r--. 1 user user 1691025408 Dec 22 12:50 Rocky-9-EC2-LVM.latest.x86_64.qcow2
-rw-r--r--. 1 user user 10737418240 Dec 22 13:15 Rocky-9-EC2-LVM.latest.x86_64.raw

file Rocky-*
Rocky-8-EC2-LVM.latest.x86_64.qcow2: QEMU QCOW Image (v3), 10737418240 bytes (v3), 10737418240 bytes
Rocky-8-EC2-LVM.latest.x86_64.raw: DOS/MBR boot sector, extended partition table (last)
Rocky-9-EC2-LVM.latest.x86_64.qcow2: QEMU QCOW Image (v3), 10737418240 bytes (v3), 10737418240 bytes
Rocky-9-EC2-LVM.latest.x86_64.raw: DOS/MBR boot sector, extended partition table (last)

```

Successfully uploaded to S3 and imported into EC2:

```auto
aws ec2 describe-snapshots --snapshot-ids snap-047e882c64fc7da22
{
    "Snapshots": [
        {
            "Description": "",
            "Encrypted": false,
            "OwnerId": "889705491250",
            "Progress": "100%",
            "SnapshotId": "snap-047e882c64fc7da22",
            "StartTime": "2022-12-22T13:45:07.426000+00:00",
            "State": "completed",
            "VolumeId": "vol-ffffffff",
            "VolumeSize": 10,
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "Rocky-8-EC2-LVM.latest.x86_64.raw"
                }
            ],
            "StorageTier": "standard"
        }
    ]
}

aws ec2 describe-snapshots --snapshot-ids snap-0f4a4207f093320e6
{
    "Snapshots": [
        {
            "Description": "",
            "Encrypted": false,
            "OwnerId": "889705491250",
            "Progress": "100%",
            "SnapshotId": "snap-0f4a4207f093320e6",
            "StartTime": "2022-12-22T13:50:28.487000+00:00",
            "State": "completed",
            "VolumeId": "vol-ffffffff",
            "VolumeSize": 10,
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "Rocky-9-EC2-LVM.latest.x86_64.raw"
                }
            ],
            "StorageTier": "standard"
        }
    ]
}

```

Volumes (with increased size) created successfully:

```auto
aws ec2 describe-volumes --volume-ids vol-0027ec7293d00f710
{
    "Volumes": [
        {
            "Attachments": [],
            "AvailabilityZone": "eu-west-2c",
            "CreateTime": "2022-12-22T13:53:29.152000+00:00",
            "Encrypted": false,
            "Size": 50,
            "SnapshotId": "snap-047e882c64fc7da22",
            "State": "available",
            "VolumeId": "vol-0027ec7293d00f710",
            "Iops": 3000,
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "Rocky-8-EC2-LVM.latest.x86_64.raw"
                }
            ],
            "VolumeType": "gp3",
            "MultiAttachEnabled": false,
            "Throughput": 125
        }
    ]
}

aws ec2 describe-volumes --volume-ids vol-000d96f29c8550ae3
{
    "Volumes": [
        {
            "Attachments": [],
            "AvailabilityZone": "eu-west-2c",
            "CreateTime": "2022-12-22T13:54:00.260000+00:00",
            "Encrypted": false,
            "Size": 50,
            "SnapshotId": "snap-0f4a4207f093320e6",
            "State": "available",
            "VolumeId": "vol-000d96f29c8550ae3",
            "Iops": 3000,
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "Rocky-9-EC2-LVM.latest.x86_64.raw"
                }
            ],
            "VolumeType": "gp3",
            "MultiAttachEnabled": false,
            "Throughput": 125
        }
    ]
}

```

I attached the RL8 volume as the root volume to an instance and it has booted successfully.

I can connect to the instance successfully using ssh, but I can’t authenticate.

I had a look in:

> **[Rocky Linux ISOs and Images - Rocky Wiki](https://wiki.rockylinux.org/rocky/image/)**
>
> The wiki for the Rocky Linux project

but couldn’t see any details as to the credentials I should use.

If you could let me know, I can log in and take a look around.

---

<div class="post-metadata">

**Author:** ![invadetl](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@invadetl](https://forums.rockylinux.org/u/invadetl)\
**Post date:** [December 23, 2022, 12:35pm UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312/6 "2022-12-23T12:35:26Z")

</div>

Instead of using an existing instance, I created new AMIs from the snapshots and then created new instances specifying an ssh key pair.

I am now able to log into both the new RL8 and RL9 instances using the “rocky” user and the ssh key.

LVM on the RL8 instance looks OK:

```auto
sudo vgdisplay -v
  --- Volume group ---
  VG Name rocky
  System ID             
  Format lvm2
  Metadata Areas 1
  Metadata Sequence No 2
  VG Access read/write
  VG Status resizable
  MAX LV 0
  Cur LV 1
  Open LV 1
  Max PV 0
  Cur PV 1
  Act PV 1
  VG Size <8.90 GiB
  PE Size 4.00 MiB
  Total PE 2278
  Alloc PE / Size 2278 / <8.90 GiB
  Free PE / Size 0 / 0   
  VG UUID 9iK0Hu-xzEt-6Qlu-OZyY-HmfP-lmVQ-tmlUju
   
  --- Logical volume ---
  LV Path /dev/rocky/root
  LV Name root
  VG Name rocky
  LV UUID rJXe3p-B7Eu-9WYb-L8ph-iADs-14zW-HWtIDB
  LV Write Access read/write
  LV Creation host, time localhost.localdomain, 2022-11-29 23:35:02 +0000
  LV Status available
  # open 1
  LV Size <8.90 GiB
  Current LE 2278
  Segments 1
  Allocation inherit
  Read ahead sectors auto
  - currently set to 8192
  Block device 253:0
   
  --- Physical volumes ---
  PV Name /dev/nvme0n1p3     
  PV UUID NJH5zg-9A3Z-AuCA-QmNv-EGNw-SNhh-2jHRJQ
  PV Status allocatable
  Total PE / Free PE 2278 / 0

```

but not on the RL9 instance:

```auto
sudo vgdisplay -v
  Devices file PVID apAFgtozy2cM9cxyKZpvhzsy701exw5H last seen on /dev/vda3 not found.
  No volume groups found.

```

The image contains the following:

```auto
/etc/lvm/devices/system.devices:
# LVM uses devices listed in this file.
# Created by LVM command lvmdevices pid 2305 at Wed Nov 30 00:40:00 2022
VERSION=1.1.2
IDTYPE=devname IDNAME=/dev/vda3 DEVNAME=/dev/vda3 PVID=apAFgtozy2cM9cxyKZpvhzsy701exw5H PART=3

```

Recursively deleting /etc/lvm/devices/ and rebooting resolves the problem.

Also both volumes have the following partition:

```auto
/dev/nvme0n1p4 20967424 20969471 2048 1M BIOS boot

```

even though I specified UEFI when creating the AMIs. I assume I can delete this partition?

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:30am UTC](https://forums.rockylinux.org/t/aws-ec2-lvm-ami/8312/7 "2023-08-25T03:30:13Z")

</div>


