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.

Hi @mounika-alavala and @bdeepakala,

Thank you for reaching out and providing detailed information about the issue you’re facing with cloud-init during the deployment process.

I’m just the technical author, but based on the error message you shared, I’m gonna go out on a limb and try to give you hand up. Please recognize that you may want to take my suggestions with a spoonful of salt, but here goes.

IIUC, it seems that the add-apt-repository command is failing due to the PPA repository not being accessible or the repository information being incorrect. Additionally, it appears that there is a proxy configuration issue that is preventing the successful execution of the command.

To address the proxy configuration issue, I think you can try setting the proxy details automatically via cloud-config in the user data section of the MAAS UI. You can provide the proxy configuration using maybe something like this?

#cloud-config
apt:
  preserve_sources_list: true
  proxy: http://10.250.110.36:8000/

Don’t forget to eplace http://10.250.110.36:8000/ with the appropriate proxy server details. This should ensure that the proxy settings are applied during the deployment process.

Alternatively, you can set the proxy environment variables (http_proxy and https_proxy) for the deployed node using the MAAS UI. Make sure to export the variables and use sudo -E when running the add-apt-repository command.

If the issue persists or if you have any further questions, please let us know. We’ll be glad to assist you further on a best-effort basis.