Install Arm VM on EC2 Graviton (Arm) instance

0

Hey there,

I have a Red Hat compatible OS with Arm architect ISO file, I want to port this ISO to AWS as an AMI for EC2 instances, so I have created a VM on c6g.metal instance, which supports KVM virtualization, and I plan to install the ISO as a temp VM, and import it as a AMI or a EBS Snapshot -> AMI by using VM Import.

The command I launch the VM is

virt-install \
    --name rhel-compatible-linux-arm64 \
    --memory 4096 \
    --vcpus 4 \
    --disk size=10 \
    --os-variant rhel7.5 \
    --location /home/ec2-user/rhel-compatible-linux-arm64.iso \
    --initrd-inject /home/ec2-user/anaconda-ks.cfg \
    --extra-args="inst.ks=file:/anaconda-ks.cfg console=tty0 console=ttyS0,115200n8"

The question is , is there any steps or docs on how to do it?

Here are my challenges:

  • The ISO file will start a Graphic installation UI, how do I connect to the VM that is on EC2 graviton instance (c6g.metal) to complete the installation process from my laptop? Does it use VNC protocol (I assume the connection is "qemu+ssh://")? Which ports should I open from Security Group (5901)?
  • I change the installation from "graphical" to "text", and try to install it with a kickstart file, but it always fail at somewhere during the boot process, see picture for more details.
[  191.550201][  3] audit: type=1130 audit(1674990734.180:9): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-udev-settle comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  191.764756][  2] audit: type=1130 audit(1674990734.400:10): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=multipathd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  192.322576][  2] audit: type=1130 audit(1674990734.950:11): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

Generating "/run/initramfs/rdsosreport.txt"


Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.


Press Enter for maintenance
(or press Control-D to continue): 

Enter image description here

  • By looking into the logs in initramfs, errors, see picture for more details.
[    0.988546] localhost kernel: pci 0000:00:01.3: PCI bridge to [bus 04]
...skipping...
[  678.604694] localhost systemd-vconsole-setup[4213]: KD_FONT_OP_GET failed while trying to get the font metadata: Function not implemented
[  678.614684] localhost systemd-vconsole-setup[4213]: Fonts will not be copied to remaining consoles
[  678.638810] localhost systemd[1]: systemd-vconsole-setup.service: Succeeded.
[  678.660426] localhost systemd[1]: Started Setup Virtual Console.
[  678.671240] localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  678.675142] localhost audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  678.695610] localhost kernel: audit: type=1130 audit(1674991221.320:12): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  678.696216] localhost kernel: audit: type=1131 audit(1674991221.330:13): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  678.713619] localhost systemd[1]: Starting Dracut Emergency Shell...
[  679.331801] localhost systemd[1]: Received SIGRTMIN+21 from PID 823 (plymouthd).
[  679.345576] localhost systemd[1]: Received SIGRTMIN+21 from PID 823 (plymouthd).

Enter image description here

The kickstart config I'm using

#version=DEVEL
# Use graphical install
graphical


%post --nochroot

#####copy kyinfo and LICENSE
if [ -e /tmp/.kyinfo ];then
  echo y | cp -a /tmp/.kyinfo $ANA_INSTALL_PATH/etc/
fi
if [ -e /tmp/LICENSE ];then
  echo y | cp -a /tmp/LICENSE $ANA_INSTALL_PATH/etc/
fi

if [ -e /run/install/repo/.kyinfo ];then
  echo y | cp -a /run/install/repo/.kyinfo $ANA_INSTALL_PATH/etc/
fi

if [ -e /run/install/repo/LICENSE ];then
  echo y | cp -a /run/install/repo/LICENSE $ANA_INSTALL_PATH/etc/
fi

##### kylin postaction
## cdrom install, copy .kylin-post-actions
if [ -e /run/install/repo/.kylin-post-actions ];then
  echo y | cp -a /run/install/repo/.kylin-post-actions /tmp/.kylin-post-actions
  echo "repo=/run/install/repo" > /tmp/.kylin-repo
fi
## copy kylin post scripts in new os
if [ -e /tmp/.kylin-post-actions ];then
  echo y | cp -a /tmp/.kylin-post-actions $ANA_INSTALL_PATH/bin
fi
if [ -e /tmp/.kylin-repo ];then
  echo y | cp -a /tmp/.kylin-repo $ANA_INSTALL_PATH/tmp/
fi

## copy and run .kylin-post-actions-nochroot
if [ -e /run/install/repo/.kylin-post-actions-nochroot ];then
  echo y | cp -a /run/install/repo/.kylin-post-actions-nochroot /tmp/.kylin-post-actions-nochroot
fi
if [ -e /tmp/.kylin-post-actions-nochroot ];then
  /bin/bash -x /tmp/.kylin-post-actions-nochroot &> $ANA_INSTALL_PATH/var/log/.kylin-post-actions-nochroot.log
fi


%end

%post

systemctl disable systemd-networkd-wait-online.service
systemctl disable multipathd.service

### do kylin post action
if [ -e /bin/.kylin-post-actions ];then
  /bin/bash -x /bin/.kylin-post-actions &> /var/log/.kylin-post-actions.log
fi

%end

%packages
@^minimal-environment

%end

# Keyboard layouts
keyboard --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network  --hostname=localhost.localdomain

# Use CDROM installation media
cdrom

# Run the Setup Agent on first boot
firstboot --enable
# System services
services --enabled="chronyd"

ignoredisk --only-use=sda
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
#part swap --fstype="swap" --ondisk=sda --size=2046
part swap --fstype="swap" --ondisk=sda --size=1024
part /boot/efi --fstype="efi" --ondisk=sda --size=1024 --fsoptions="umask=0077,shortname=winnt"
#part / --fstype="xfs" --ondisk=sda --size=37888
part / --fstype="xfs" --ondisk=sda --size=7000

# System timezone
timezone Asia/Shanghai --utc

user --groups=wheel --name=kylin --gecos="Kylin"

%addon com_redhat_kdump --enable --reserve-mb='1024M'

%end

%anaconda
pwpolicy root --minlen=8 --minquality=1 --strict --nochanges --notempty
pwpolicy user --minlen=8 --minquality=1 --strict --nochanges --emptyok
pwpolicy luks --minlen=8 --minquality=1 --strict --nochanges --notempty
%end

Any hints/tips/docs are highly appreciated! Thanks

1 Answer
0

Here are the steps to complete the process:

  • Create a new EC2 instance based on c6g.Metal, select the AMI you require (e.g., Amazon Linux, Red Hat Enterprise Linux, or Ubuntu)
  • Connect to the instance via SSH
  • Launch the virt-install command, specifying the ISO file and other parameters such as memory and CPU allocation.
  • Connect to the console of the new VM with the virsh console command.
  • Complete the installation process by following the steps on the UI of the ISO file.

For step by step guide you can check AWS official documentation on "VM Import/Export" : https://aws.amazon.com/vm-import-export/

**Regarding your challenges: **

  • For the graphic installation, you can connect to the console of the new VM using the virsh console command.
  • For the issue with the kickstart file, it's difficult to determine the exact cause without further details. Please try to check the logs or debug information available on the instance.
  • For the logs in initramfs, it's usually related to font issues. You can try to install the required font packages on the instance or try another distribution.
profile picture
answered a year ago
  • Hey Divyam

    Big thanks for the quick answer, really appreciated. However, these are some details that might need to be dived deep.

    For example,

    * Connect to the console of the new VM with the virsh console command.
    * Complete the installation process by following the steps on the UI of the ISO file.
    

    How do I connect to the VM with virsh command? it doesn't show the UI for me to complete the installation What protocol the virsh command is using for the GUI, is it VNC? What ports should be opened from Security Group if I connect to the VM from my laptop?

    Many thanks in advance!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions