Overview
Amazon Linux 2 (AL2) and Amazon Linux 2023 (AL2023) are Linux operating systems from AWS. Like any other Linux-based OS, you can run an Amazon Linux VM on Zadara Compute. However, the images provided by Amazon come without any default users and do not support cloud-init metadata from Zadara Compute by default.
To allow the image to properly pull metadata—a necessity to initialize your first user—you must configure cloud-init inside the Image to work with Zadara Compute.
Below is an example of the basic steps required to accomplish this, please see Amazon's documentation for more details:
Opening or Mounting the Image
First, ensure you have a copy of the AL2 or AL2023 KVM qcow2 Image.
In order to edit the necessary config file, you will need some type of tool that allows you to mount or edit a qcow2.
On most Linux distributions the qemu-tools package can be installed as it includes the qemu-nbd utility, but you can use your tool of choice as long as it supports mounting a qcow2 Image in write mode.
For example, using qemu-nbd from a Linux system, you can export the qcow2 image as a block device like this:
$ sudo qemu-nbd --connect=/dev/nbd0 <path_to_al2_image>You'll see that it has two partitions, with the second being the main Linux partition:
You can then mount it as normal:
$ mkdir /tmp/mount
$ sudo mount /dev/nbd0p1 /tmp/mount
Updating Cloud Configuration
Amazon Linux 2
With the partition mounted, you can then edit the /etc/cloud/cloud.cfg file. You will need to update the datasource_list parameter to include OpenStack.
If the parameter is already configured, it will look something like this to begin with:
datasource_list: [ NoCloud, AltCloud, ConfigDrive, OVF, None ]The datasource_list parameter must be added or edited to include OpenStack to work on Zadara Compute:
datasource_list: [ OpenStack, NoCloud, AltCloud, ConfigDrive, OVF, None ]Amazon Linux 2023
With the partition mounted, you can then create the /etc/cloud/cloud.cfg.d/99-datasource.cfg file, which must contain the following datasource_list parameter for OpenStack:
datasource_list: [ OpenStack ]Using Amazon Linux with Zadara Compute
Once this change has been made, you can simply upload and use the Image as normal with Zadara Compute.
Note: If you used qemu-nbd, be sure to umount and disconnect the Image:
$ sudo umount /tmp/mount
$ sudo qemu-nbd --disconnect /dev/nbd0Migrating an Amazon Linux AMI to Zadara Compute
Amazon Linux AMIs do not contain the same packages and configuration as Amazon's official KVM releases and may not have support or configuration for VGA. If you export and migrate a VM created from an Amazon AMI and need support for Zadara's built-in web console, you will need to install and configure VGA drivers, please consult Amazon's documentation.