Open suhasini-ops opened 2 months ago
Ok I found the issue, here is how I got through
@alexsander-souza I get this error now while deploying using maas while executing /curtin/setup-bootloaded [https://github.com/canonical/packer-maas/blob/main/ubuntu/scripts/setup-bootloader], any hint ?
+ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck
Installing for x86_64-efi platform.
grub-install: error: failed to get canonical path of `/boot/efi'.
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED subp(['udevadm', 'settle']): 0.020
Running command ['mount', '--make-private', '/tmp/tmpeh1eok2z/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpeh1eok2z/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpeh1eok2z/target/sys'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpeh1eok2z/target/sys'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpeh1eok2z/target/run'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpeh1eok2z/target/run'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpeh1eok2z/target/proc'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpeh1eok2z/target/proc'] with allowed return codes [0] (capture=False)
Running command ['mount', '--make-private', '/tmp/tmpeh1eok2z/target/dev'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpeh1eok2z/target/dev'] with allowed return codes [0] (capture=False)
Traceback (most recent call last):
File "/tmp/tmpeh1eok2z/target/curtin/curtin-hooks", line 118, in <module>
main()
File "/tmp/tmpeh1eok2z/target/curtin/curtin-hooks", line 113, in main
curthook(config, target, state)
File "/tmp/tmpeh1eok2z/target/curtin/curtin-hooks", line 97, in curthook
run_hook_in_target(target, "setup-bootloader")
File "/tmp/tmpeh1eok2z/target/curtin/curtin-hooks", line 41, in run_hook_in_target
in_chroot.subp(["/curtin/" + hook])
File "/curtin/curtin/util.py", line 792, in subp
return subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 280, in subp
return _subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 144, in _subp
raise ProcessExecutionError(stdout=out, stderr=err,
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpeh1eok2z/target', '/curtin/setup-bootloader']
Exit code: 1
It appears that system does not have an EFI partition, which is required for UEFI booting. Instead, it seems to have a BIOS/MBR setup.
this is strange, the output of parted
you posted before shows a EFI
partition:
$ sudo parted custom-ubuntu-lvm.dd print
Model: (file)
Disk /home/jenkins/custom-ubuntu-lvm.dd: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 565MB 564MB fat32 boot, esp
2 565MB 2444MB 1879MB ext4
3 2444MB 8589MB 6145MB
is it empty?
we also fixed an issue in the setup-bootloader
script recently, please make sure you are running the latest version
j1-atos-5.redlab.datadirectnet.com-.zip
@alexsander-souza I attached Machine output (YAML), curtin logs and Installation output for your reference, I use iso image + lvm to create a maas image and I use latest packer maas code
any hints will be helpful
sda1 is the efi parition, but it not mounted or mounted as a different path as I get below error
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck
Installing for x86_64-efi platform.
grub-install: error: failed to get canonical path of `/boot/efi'.
Below helped but upon auto reboot after installation it didn't come up with network!!
@alexsander-souza another issue with lvm image, ubuntu--vg-ubuntu--lv not expanding to full disk size
ubuntu@j1-atos-5:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 63.9M 1 loop /snap/core20/2105
loop1 7:1 0 87M 1 loop /snap/lxd/27037
loop2 7:2 0 40.4M 1 loop /snap/snapd/20671
loop3 7:3 0 38.8M 1 loop /snap/snapd/21759
loop4 7:4 0 63.9M 1 loop /snap/core20/2318
loop5 7:5 0 87M 1 loop /snap/lxd/28373
sda 8:0 1 3.5T 0 disk
├─sda1 8:1 1 538M 0 part /boot/efi
├─sda2 8:2 1 1.8G 0 part /boot
└─sda3 8:3 1 5.7G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 5.7G 0 lvm /
ubuntu@j1-atos-5:~$
ubuntu@j1-atos-5:~$ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
New size (1464 extents) matches existing size (1464 extents).
I was able to manually fix it by doing the following but can we handle this during the deployment ?
ubuntu@j1-atos-5:~$ sudo parted /dev/sda
GNU Parted 3.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 7484699312 blocks) or continue with the current setting?
Fix/Ignore? Fix
Model: ATA Micron_5300_MTFD (scsi)
Disk /dev/sda: 3841GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 565MB 564MB fat32 boot, esp
2 565MB 2444MB 1879MB ext4
3 2444MB 8589MB 6145MB
(parted) resizepart 3 100%
(parted) quit
Information: You may need to update /etc/fstab.
ubuntu@j1-atos-5:~$ sudo pvresize /dev/sda3
Physical volume "/dev/sda3" changed
1 physical volume(s) resized or updated / 0 physical volume(s) not resized
ubuntu@j1-atos-5:~$ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Size of logical volume ubuntu-vg/ubuntu-lv changed from <5.72 GiB (1464 extents) to 3.49 TiB (915124 extents).
Logical volume ubuntu-vg/ubuntu-lv successfully resized.
ubuntu@j1-atos-5:~$ sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 447
The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 937086976 (4k) blocks long.
ubuntu@j1-atos-5:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 63.9M 1 loop /snap/core20/2105
loop1 7:1 0 87M 1 loop /snap/lxd/27037
loop2 7:2 0 40.4M 1 loop /snap/snapd/20671
loop3 7:3 0 38.8M 1 loop /snap/snapd/21759
loop4 7:4 0 63.9M 1 loop /snap/core20/2318
loop5 7:5 0 87M 1 loop /snap/lxd/28373
sda 8:0 1 3.5T 0 disk
├─sda1 8:1 1 538M 0 part /boot/efi
├─sda2 8:2 1 1.8G 0 part /boot
└─sda3 8:3 1 3.5T 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 3.5T 0 lvm /
ubuntu@j1-atos-5:~$
I am using ubuntu-lvm.pkr.hcl to create a custom image for MAAS. I have added the following configuration to ubuntu-lvm.pkr.hcl:
I have also added a verification step to ensure that the files are being placed under the /curtin directory with the appropriate permissions. However, during deployment, the curtin/curtin-hooks are not being used, and I am not getting the kernel I wanted.
scripts/curtin.sh
Log Output:
Despite the verification showing that the files are present in /curtin with the correct permissions, the curtin-hooks are not being utilized during deployment. Any assistance on this issue would be appreciated.
Additionally, here are some commands and their outputs to provide more context that files are present in the /curtin directory: