MAAS Deployment failed - DELL PowerEdgeR640 - cloud-init error

Hi,
I have installed MAAS following the MANIAC doc [see attachment]. The snap version of MAAS installed is 3.2.6-12016-g.19812b4da

Using MAAS UI, I added a DELL PowerEdge 640 baremetal server manually, named it ‘metal30’ and MAAS comissioned it successfully, moving the node to ‘Ready’ state. But when I try deploying a selected target OS on the node, the action fails with ‘failed deployment’. I was able to move the node into Rescue mode and ssh in and saw that the target image OS has been installed successfully. The logs show a cloud-init error while running the add-apt-repositoty command to download firmware-testing-ppa.

Error from logs:

Nov 7 11:51:31 metal30 cloud-init[2716]: 2022-11-07 11:51:31,254 - cc_apt_configure.py[ERROR]: add-apt-repository failed.
Nov 7 11:51:31 metal30 cloud-init[2716]: Traceback (most recent call last):
Nov 7 11:51:31 metal30 cloud-init[2716]: File “/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_configure.py”, line 574, in add_apt_sources
Nov 7 11:51:31 metal30 cloud-init[2716]: subp.subp(
Nov 7 11:51:31 metal30 cloud-init[2716]: File “/usr/lib/python3/dist-packages/cloudinit/subp.py”, line 335, in subp
Nov 7 11:51:31 metal30 cloud-init[2716]: raise ProcessExecutionError(
Nov 7 11:51:31 metal30 cloud-init[2716]: cloudinit.subp.ProcessExecutionError: Unexpected error while running command.
Nov 7 11:51:31 metal30 cloud-init[2716]: Command: [‘add-apt-repository’, ‘–no-update’, ‘ppa:firmware-testing-team/ppa-fwts-stable’]
Nov 7 11:51:31 metal30 cloud-init[2716]: Exit code: 1
Nov 7 11:51:31 metal30 cloud-init[2716]: Reason: -
Nov 7 11:51:31 metal30 cloud-init[2716]: Stdout: Cannot add PPA: ‘ppa:~firmware-testing-team/ubuntu/ppa-fwts-stable’.
Nov 7 11:51:31 metal30 cloud-init[2716]: ERROR: ‘~firmware-testing-team’ user or team does not exist.
Nov 7 11:51:31 metal30 cloud-init[2716]: Stderr:
Nov 7 11:51:31 metal30 cloud-init[2716]: 2022-11-07 11:51:31,277 - util.py[WARNING]: Running module apt-configure (<module ‘cloudinit.config.cc_apt_configure’ from ‘/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_configure.py’>) failed
Nov 7 11:51:31 metal30 systemd[1]: Stopping Network Time Synchronization…

Steps to reproduce the issue:

  1. Using MAAS UI, add a baremetal server manual and commission it and confirm the state change to ‘Ready’.
  2. Using MAAS UI, select Deploy from ‘Take Action’ and select the OS image you want installed.
  3. After you get ‘Failed Deployment’ , look out the logs for cloud-init failure.

I have attached all the logs from the MAAS server. Any help would be appreciated.

Adding to the issue posted here. Looking into the cloud-init error, the team was able to figure out the following.

  1. Logging into the deployed node, we were able to verify that /etc/apt/apt.conf.d/90-cloud-init-aptproxy had "Acquire::http::Proxy “http://10.250.110.36:8000/”; set.
  2. The environmental variables http_proxy and https_proxy were not set. ubuntu@metal30:~$ printenv | grep -i proxy
    ubuntu@metal30:~$
  3. Exporting http_proxy and https_proxy with the built-in MAAS proxy server details and using sudo -E when running the add-apt-repository command seems to work. We tried doing this manually and the command runs successfully then. Have attached screenshot of the same

We need help to set this proxy automatically via cloud-config to get deployment to pass

. Any help would be welcome.