I create an ISO with autoinstall that needs to be generic. It should work on VMs, physical machines with legacy bios, EFI bios, with and without RAID.
In my autoinstall.yml,
I don't have anything related to storage (as I want it to be as generic as possible for all the platforms):
#cloud-config
autoinstall:
version: 1
identity:
hostname: fooapp
username: foouser
password: "XXXXXXX"
network:
ethernets: {}
version: 2
source:
id: ubuntu-server-minimal
early-commands:
- cat /cdrom/casper/install-sources.yaml | awk 'NR>1 && /^-/{exit};1' > /run/my-sources.yaml
- mount -o ro,bind /run/my-sources.yaml /cdrom/casper/install-sources.yaml
late-commands:
- cp -r /cdrom/copy_to_iso/ /target/opt/
user-data:
runcmd:
- |
echo -e "\033[32mDuring installation, please don't touch until the installation will be finished....\033[0m"
mkdir -vp /opt/INIT/ >> /root/application_installation.log 2>&1
mv -v /opt/copy_to_iso/upgrade_or_install_packages/ /opt/ >> /root/application_installation.log 2>&1
mv -v /opt/copy_to_iso/foo_installation/* /opt/INIT/ >> /root/application_installation.log 2>&1
mv -v /opt/copy_to_iso/application_scripts /opt/application_scripts >> /root/application_installation.log 2>&1
rm -rvf /opt/copy_to_iso >> /root/application_installation.log 2>&1
bash -x /opt/application_scripts/copy_system_files.sh >> /root/application_installation.log 2>&1
bash -x /opt/application_scripts/setup_system_config.sh install_mode >> /root/application_installation.log 2>&1
echo -e "\033[32mInstallation was completed...\033[0m"
The installation of the ISO is done successfully in all the platforms, except EFI bios with RAID1 (UEFI Option ROM Control > Virtual RAID on CPU). Note - without RAID, same platform, it works.
During the ISO installation, it fails on the stage of cmd-install/stage-partitioning/builtin/cmd-block-meta/clear-holders
on the following error:
mdadm: stop failed, retrying in 0.2 seconds
mdadm: stop on /dev/md127 attempt 58
/sys/class/block/md127/md/sync_action/sync_max =
mdadm: setting array sync_action=idle
mdadm: (non-fatal) write to /sys/class/block/md127/md/sync_action failed [Errno 13] Permission denied: '/sys/class/block/md127/md/sync_action'
/sys/class/block/md127/md/sync_max/sync_max =
mdadm: setting array sync_{min,max}=0
mdadm: (non-fatal) write to /sys/class/block/md127/md/sync_max failed [Errno 13] Permission denied: '/sys/class/block/md127/md/sync_max'
Running command ['mdadm', '--manage', '--stop', '/dev/md127'] with allowed return codes [0] (capture=True)
mdadm stop failed, retrying
/proc/mdstat:
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md126 : active raid1 nvme0n1[1] nvme1n1[0]
3711654912 blocks super external:/md127/0 [2/2] [UU]
[>....................] resync = 0.0% (3059008/3711654912) finish=286.7min speed=215522K/sec
md127 : inactive nvme1n1[1](S) nvme0n1[0](S)
10402 blocks super external:imsm
unused devices: <none>
mdadm: stop failed, retrying in 0.2 seconds
mdadm: stop on /dev/md127 attempt 59
/sys/class/block/md127/md/sync_action/sync_max =
mdadm: setting array sync_action=idle
mdadm: (non-fatal) write to /sys/class/block/md127/md/sync_action failed [Errno 13] Permission denied: '/sys/class/block/md127/md/sync_action'
/sys/class/block/md127/md/sync_max/sync_max =
mdadm: setting array sync_{min,max}=0
mdadm: (non-fatal) write to /sys/class/block/md127/md/sync_max failed [Errno 13] Permission denied: '/sys/class/block/md127/md/sync_max'
Running command ['mdadm', '--manage', '--stop', '/dev/md127'] with allowed return codes [0] (capture=True)
mdadm stop failed, retrying
/proc/mdstat:
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md126 : active raid1 nvme0n1[1] nvme1n1[0]
3711654912 blocks super external:/md127/0 [2/2] [UU]
[>....................] resync = 0.0% (3059008/3711654912) finish=286.7min speed=215522K/sec
md127 : inactive nvme1n1[1](S) nvme0n1[0](S)
10402 blocks super external:imsm
unused devices: <none>
mdadm: stop failed, retrying in 0.2 seconds
finish: cmd-install/stage-partitioning/builtin/cmd-block-meta/clear-holders: FAIL: removing previous storage devices
TIMED BLOCK_META: 15.083
finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: curtin command block-meta
Traceback (most recent call last):
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/commands/main.py", line 202, in main
ret = args.func(args)
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/log.py", line 97, in wrapper
return log_time("TIMED %s: " % msg, func, *args, **kwargs)
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/log.py", line 79, in log_time
return func(*args, **kwargs)
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/commands/block_meta.py", line 108, in block_meta
meta_clear(devices, state.get('report_stack_prefix', ''))
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/commands/block_meta.py", line 1984, in meta_clear
clear_holders.clear_holders(devices)
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/block/clear_holders.py", line 638, in clear_holders
shutdown_function(dev_info['device'])
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/block/clear_holders.py", line 205, in shutdown_mdadm
mdadm.mdadm_stop(blockdev)
File "/snap/subiquity/3698/lib/python3.8/site-packages/curtin/block/mdadm.py", line 353, in mdadm_stop
raise OSError('Failed to stop mdadm device %s', devpath)
OSError: [Errno Failed to stop mdadm device %s] /dev/md127
[Errno Failed to stop mdadm device %s] /dev/md127
Do you have a suggestion? I tried to add to early-commands:
the following -
- mdadm --manage --stop /dev/md126
- mdadm --manage --stop /dev/md127
It didn't help; same error.