CCI-MOC / esi

Elastic Secure Infrastructure project
6 stars 13 forks source link

fedora-38 image has issues #619

Closed tzumainn closed 3 weeks ago

tzumainn commented 2 months ago

The fedora-38 image in ESI apparently shifts the mac address over by two for some reason, leading to issues in openvswitch. We don't need to fix that, but we should upload a new fedora image (latest version) that can be provisioned and reached.

skanthed commented 4 weeks ago

@tzumainn You can test this image in my private repository - fedora-38. Once tested I will update the steps here.

tzumainn commented 4 weeks ago

Thanks! It works well; I've renamed it to fedora38 and made it public.

Before closing this issue, can you:

a) delete any test fedora 38 images to clean up space b) document the creation of the image here?

skanthed commented 3 weeks ago

Step 1: Install Disk Image Builder

Use the following command to install Disk Image Builder:

pip install diskimage-builder

Step 2: Set Up Environment Variables

Ensure that both ELEMENTS_PATH and _LIB environment variables are correctly set:

export _LIB=/path/to/diskimage_builder
export ELEMENTS_PATH=$_LIB/elements

Set the Fedora 38 specific environment variables

export DIB_RELEASE=38
export DIB_GRUB_INSTALLTYPE=both           # Ensures both UEFI and Legacy boot compatibility
export DIB_DISABLE_KERNEL_CLEANUP=1        # Disables kernel cleanup to retain all kernel files
export ARCH=x86_64
export DIB_CLOUD_IMAGES=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/${DIB_RELEASE}/Cloud/${ARCH}/images

Step 3: Create the Fedora 38 Image

Use the following command to create the Fedora 38 image compatible with UEFI and Legacy boot modes:

disk-image-create fedora vm block-device-efi dhcp-all-interfaces bootloader grub2 \
  -o fedora-38-vm-uefi-legacy.qcow2 \
  -p linux-firmware,cloud-init

Step 4: Verify the Image Contents (Optional)

After creating the image, you can verify its contents using guestfish to ensure that the necessary files (e.g., kernel, initramfs) are included:

guestfish --ro -a fedora-38-vm-uefi-legacy.qcow2 -i

Additional Step: Verify Partitions and Boot Files for UEFI and Legacy Compatibility

Use guestfish commands to list partitions, mount them, and check for necessary boot files:

><fs> list-partitions                           # Lists all partitions in the image
><fs> mount /dev/sda1 /                         # Adjust partition as necessary, e.g., /dev/sda1
><fs> ls /boot                                  # Lists boot files to check for kernel and initramfs

This will confirm that the image is configured correctly for both UEFI and Legacy boot.

tzumainn commented 3 weeks ago

Looks good!