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

Boot order remains on Try Install after first reboot #2

Closed
Emanuele94 opened this issue Mar 31, 2023 · 3 comments
Closed

Boot order remains on Try Install after first reboot #2

Emanuele94 opened this issue Mar 31, 2023 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@Emanuele94
Copy link

Hi,
thanks for this, it's very usefull.
I'm facing and issue were after cloud init autoinstall, the vm reboots but i can see that the disk is not being unmounted and when it starts it launches installation once again.
Have you got any ideas about this?
I'm trying to work with qemuargs at the moment to set boot order.

@shantanoo-desai
Copy link
Owner

shantanoo-desai commented Mar 31, 2023

@Emanuele94 In most cases when you see the installation again, the user-data was not successfully executed. Can you run qemu in graphics mode to see the logs from cloud-init?

Local Tests

Cloud-Init

check if cloud-init user-data file is valid (maybe new cloud-init updates might render it buggy)

make validate-cloudinit

QEMU graphics

if possible set the headless value in the Packer template to false and try booting the image on a local device with qemu and kvm.

I would still recommend adding the boot sequence into the late-commands because that is what has worked for me

  late-commands:
    - "sudo apt update && sudo apt install -y efibootmgr"
    - "sudo efibootmgr"
    - "sudo efibootmgr -o 0007,0001,0000,0002,0003,0004,0005,0006"

Check efibootmgr sequence

if you are able to crash the cloud-init installation try getting some information from efibootmgr and determine where the image should be in the sequence and place the image disk first

@shantanoo-desai shantanoo-desai added bug Something isn't working question Further information is requested labels Mar 31, 2023
@Emanuele94
Copy link
Author

Hi, thanks for the response. unfortunately i cannot use headless false. Though, i'm trying to set the efibootmgr, fist by checking efibootmgr -v once i get the vm working.
The cloud-init validate works fine, i get no errors.

@Emanuele94
Copy link
Author

Thanks again man!
i've solved by checking manually efibootmgr -v and than changing as you suggested the order in cloud-init user-data efibootmgr -o

shantanoo-desai added a commit that referenced this issue May 2, 2023
- resolves #2 by adding a smarter logic for UEFI detection
  in `late-commands` in the user-data cloud-init file
- closes #9 by adding a `host_distro` variable and a map to
  set the OVMF Paths in the template to make it generic

Signed-off-by: Shantanoo 'Shan' Desai <shantanoo.desai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants