Unable to import the rockylinx 9 to AWS cloud

Steps followed

I downloaded the qcow2 format form this link
Index of /pub/rocky/9/images/x86_64/ Rocky-9-EC2-Base-9.1-20230215.0.x86_64.qcow2

I converted this qcow to raw format(which is supported on aws)
qemu-img convert -f qcow2 -O raw Rocky-9-EC2-Base-9.1-20230215.0.x86_64.qcow2 Rocky-9-EC2-Base-9.1.raw

But when I tired to import image on AWS , I get this error.

StatusMessage": “ClientError: Unknown OS / Missing OS files.”,

Is these steps followed are correct ?Please help me on this

Wouldn’t it be better to use the ones already prepared? From here: Cloud Images | Rocky Linux

Or is there a particular reason you are trying to do this, than use the already prepared official images?

We want to create our own custom image , we will not use marketplace/community AMI’s

1 Like

This is something I have done last period. Some hints are:

I also recommend you join the mattermost Development channel, there I discussed with @neil more on this topic.

I put together the scripts on a repository: GitHub - valentin-nasta/create-custom-rocky-linux-ami
Please let me know if you encounter any issue.

(I had to create a new post because I was limited to 2 links per post.)

Hi Valentin , I tried the steps mentioned by you
STEP 17/20: ENV LIBGUESTFS_BACKEND direct
→ 5594ca12b7f
STEP 18/20: COPY prep-azure.sh /prep-azure.sh
→ 29374bf25eb
STEP 19/20: RUN chmod +x /prep-azure.sh
→ a4a7b9dc6e5
STEP 20/20: ENTRYPOINT [“/tini”, “–”]
COMMIT empanadas:latest
→ 4cd83341361
Successfully tagged localhost/empanadas:latest
4cd833413614e7f31d4848d0042450f44c8cd4c70b864b9ef28dcc6fea23190e

But I am unable to login to container localhost/empanadas:latest

docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

docker image pull localhost/empanadas:latest
Error response from daemon: Get “http://localhost/v2/”: dial tcp [::1]:80: connect: connection refused

Hi Sagar, on this example should be used podman and not docker.

sudo podman images
REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
localhost/empanadas       latest      011e3cc8b82f  2 days ago   3.09 GB
docker.io/library/fedora  36          45237698d272  2 weeks ago  171 MB

podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/empanadas latest 4cd833413614 21 hours ago 3.09 GB
Docker 36 45237698d272 2 weeks ago 171 MB
[root@ip-10-70-13-224 create-custom-rocky-linux-ami]# podman run 4cd833413614
tini (tini version 0.19.0 - git.de40ad0)
Usage: tini [OPTIONS] PROGRAM – [ARGS] | --version

Execute a program under the supervision of a valid init process (tini)

Command line options:

–version: Show version and exit.
-h: Show this help message and exit.
-s: Register as a process subreaper (requires Linux >= 3.4).
-p SIGNAL: Trigger SIGNAL when parent dies, e.g. “-p SIGKILL”.
-v: Generate more verbose output. Repeat up to 3 times.
-w: Print a warning when processes are getting reaped.
-g: Send signals to the child’s process group.
-e EXIT_CODE: Remap EXIT_CODE (from 0 to 255) to 0.
-l: Show license and exit.

Environment variables:

TINI_SUBREAPER: Register as a process subreaper (requires Linux >= 3.4).
TINI_VERBOSITY: Set the verbosity level (default: 1).
TINI_KILL_PROCESS_GROUP: Send signals to the child’s process group.

Here is an example of podman run if you want to access run the container:

[vdev@vmvalentin-fedbox ~]$ sudo podman images  | grep empanadas
localhost/empanadas       latest      011e3cc8b82f  3 days ago    3.09 GB
[vdev@vmvalentin-fedbox ~]$ sudo podman run -it --rm 011e3cc8b82f bash
[root@704b3b9ecf2e /]#

a complete example you’ll find on my repository: create-custom-rocky-linux-ami/run_empanadas.sh at main · valentin-nasta/create-custom-rocky-linux-ami · GitHub

I executed this command in the container and got this error

imagefactory --debug --verbose --timeout 3600 base_image --parameter generate_icicle false --parameter oz_overrides “{‘libvirt’: {‘memory’: 2048}, ‘custom’: {‘useuefi’: ‘no’}}” --file-parameter install_script /transfer/kickstarts/Rocky-9-EC2-Base.ks /transfer/iso-template.xml 2>&1 | tee /transfer/run-output-iso.txt
2023-03-10 12:03:31,350 DEBUG root thread(MainThread) Message: Enabling faulthandler
2023-03-10 12:03:31,352 DEBUG root thread(MainThread) Message: Enabled faulthandler
2023-03-10 12:03:31,353 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (Docker) loaded…
2023-03-10 12:03:31,354 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (GCE) loaded…
2023-03-10 12:03:31,355 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (HyperV) loaded…
2023-03-10 12:03:31,356 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (IndirectionCloud) loaded…
2023-03-10 12:03:31,356 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (OVA) loaded…
2023-03-10 12:03:31,357 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (RHEVM) loaded…
2023-03-10 12:03:31,358 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (TinMan) loaded…
2023-03-10 12:03:31,359 INFO imgfac.PluginManager.PluginManager thread(MainThread) Message: Plugin (vSphere) loaded…
2023-03-10 12:03:31,359 ERROR root thread(MainThread) Message: Unable to read file /transfer/kickstarts/Rocky-9-EC2-Base.ks referenced in --file-parameter argument

where I can find this file /transfer/kickstarts/Rocky-9-EC2-Base.ks I don’t see this file in any repo

The run_empanadas.sh script does clone the required repositories (including the kickstarts):