Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws: launch and customize a new instance with remote Ignition file from a S3 bucket #657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HuijingHei
Copy link
Member

Then you can launch the instance using the same command as xref:#_customized_example[], passing the minimal configuration you just created.
Then you can launch the instance using the following command, passing the minimal configuration you just created.

Note: You need to create an IAM profile with `s3:GetObject` permission, and attach the role to the instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add here the command to do that as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an URL here about how to create an IAM profile, WDYT?

modules/ROOT/pages/provisioning-aws.adoc Outdated Show resolved Hide resolved
@HuijingHei HuijingHei force-pushed the update-aws-s3-support branch 6 times, most recently from 70c05ed to c4a09de Compare August 6, 2024 07:16
Copy link

@deby1122 deby1122 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t

@HuijingHei
Copy link
Member Author

@travier @prestist could you help to review again as I made some changes, thanks!

Copy link
Member

@c4rt0 c4rt0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HuijingHei I tried multiple times to go through this without success.
I am able to create roles & profiles I am just constantly getting stuck at Job ignition-fetch.service/start "running" forever.

I noticed that creating an ignition with --pretty results with:

Ignition has failed. Please ensure your config is valid.

the ignition file I used for this:

{"ignition":{"config":{"replace":{"source":"arn:aws:s3:::apiaseck-inf/bootstrap.ign"}},"version":"3.4.0"}}

I also tried:

{"ignition":{"config":{"replace":{"source":"s3://apiaseck-inf/bootstrap.ign"}},"version":"3.4.0"}}

The above was correct as per created bucket through commands provided.

adamsky@fedorapc Work/aws » NAME='apiaseck-inf'                                                                                                                                                                                           
adamsky@fedorapc Work/aws » aws s3 mb s3://$NAME --region us-east-2 

At this stage I can only present the last result of my failed attempt:

[   26.335382] NetworkManager[758]: <info>  [1729886778.9297] manager: NetworkManager state is now CONNECTED_GLOBAL
[   26.392925] NetworkManager[758]: <info>  [1729886778.9304] manager: startup complete
[   26.427019] systemd[1]: Starting ignition-fetch.service - Ignition (fetch)...
[   26.461496] systemd[1]: Starting nm-wait-online-initrd.service...
[   26.489977] (ignition)[773]: ignition-fetch.service: Referenced but unset environment variable evaluates to an empty string: IGNITION_ARGS
[   26.550563] systemd[1]: Finished nm-wait-online-initrd.service.
[   26.578781] systemd[1]: Starting dracut-initqueue.service - dracut initqueue hook...
[   26.616773] systemd[1]: Finished dracut-initqueue.service - dracut initqueue hook.
[   26.652396] systemd[1]: Reached target remote-fs-pre.target - Preparation for Remote File Systems.
[   26.701118] systemd[1]: Reached target remote-cryptsetup.target - Remote Encrypted Volumes.
[   26.737374] systemd[1]: Reached target remote-fs.target - Remote File Systems.
[   26.770933] systemd[1]: coreos-livepxe-rootfs.service - Acquire Live PXE rootfs Image was skipped because of an unmet condition check (ConditionPathExists=/run/ostree-live).
[   26.845810] systemd[1]: coreos-livepxe-persist-osmet.service - Persist Osmet Files (PXE) was skipped because of an unmet condition check (ConditionPathExists=/run/ostree-live).
[   26.922726] systemd[1]: Starting dracut-pre-mount.service - dracut pre-mount hook...
[   26.957961] systemd[1]: Finished dracut-pre-mount.service - dracut pre-mount hook.
[***   ] Job ignition-fetch.service/start running (6min 42s / no limit)

I will come back to this next week (I might need a reminder ;) )

@HuijingHei
Copy link
Member Author

HuijingHei commented Oct 28, 2024

Thanks @c4rt0 for the testing. Let me clarify the two configs:

  • The uploaded file bootstrap.ign is the real configuration and provisions the system based on that configuration, for example:
{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"name":"core","sshAuthorizedKeys":["ssh-rsa xxx "]}]}}
  • And --user-data config will retrieve the remote Ignition file from a s3 bucket, like what you used above:

{"ignition":{"config":{"replace":{"source":"s3://apiaseck-inf/bootstrap.ign"}},"version":"3.4.0"}}

It might be failed if using the wrong configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants