Error during deploy custom RHEL image which generate by maas image builder

Hello all,

I’m trying to deploy a custom RHEL image in maas 2.6.2.
I have generated an RHEL image with the following command:

maas-image-builder -a amd64 -o rhel7-amd64-root-tgz rhel --rhel-iso rhel-server-7.4-x86_64-dvd.iso

I have created a boot-resource with the following command:

maas admin boot-resources create name=rhel/7 title="RedHat Enterprise Linux 7" architecture=amd64/generic content@=rhel7-amd64-root-tgz

When I then deploy to the node, I get the following error:

2020-02-14 11:04:56,144 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.rhel.Distro'>
2020-02-14 11:04:56,144 - __init__.py[DEBUG]: Looking for for data source in: ['MAAS'], via packages ['', u'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK']
2020-02-14 11:04:56,144 - __init__.py[DEBUG]: Searching for network data source in: [u'DataSourceMAAS']
2020-02-14 11:04:56,144 - handlers.py[DEBUG]: start: init-network/search-MAAS: searching for network data from DataSourceMAAS
2020-02-14 11:04:56,144 - __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceMAAS.DataSourceMAAS'>
2020-02-14 11:04:56,152 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [0/120s]: unexpected error [oauth support is not available]
2020-02-14 11:04:56,153 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
2020-02-14 11:04:57,154 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [1/120s]: unexpected error [oauth support is not available]
2020-02-14 11:04:57,154 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
2020-02-14 11:04:58,156 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [2/120s]: unexpected error [oauth support is not available]
2020-02-14 11:04:58,156 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
2020-02-14 11:04:59,163 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [3/120s]: unexpected error [oauth support is not available]
2020-02-14 11:04:59,163 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
2020-02-14 11:05:00,166 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [4/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:00,166 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
2020-02-14 11:05:01,176 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [5/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:01,176 - url_helper.py[DEBUG]: Please wait 2 seconds while we wait to try again
2020-02-14 11:05:03,181 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [7/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:03,181 - url_helper.py[DEBUG]: Please wait 2 seconds while we wait to try again
2020-02-14 11:05:05,183 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [9/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:05,184 - url_helper.py[DEBUG]: Please wait 2 seconds while we wait to try again
2020-02-14 11:05:07,186 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [11/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:07,186 - url_helper.py[DEBUG]: Please wait 2 seconds while we wait to try again
2020-02-14 11:05:09,188 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [13/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:09,189 - url_helper.py[DEBUG]: Please wait 2 seconds while we wait to try again
2020-02-14 11:05:11,191 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [15/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:11,191 - url_helper.py[DEBUG]: Please wait 3 seconds while we wait to try again
2020-02-14 11:05:14,194 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [18/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:14,194 - url_helper.py[DEBUG]: Please wait 3 seconds while we wait to try again
2020-02-14 11:05:17,197 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [21/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:17,198 - url_helper.py[DEBUG]: Please wait 3 seconds while we wait to try again
2020-02-14 11:05:20,200 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [24/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:20,200 - url_helper.py[DEBUG]: Please wait 3 seconds while we wait to try again
2020-02-14 11:05:23,204 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [27/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:23,204 - url_helper.py[DEBUG]: Please wait 3 seconds while we wait to try again
2020-02-14 11:05:26,207 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [30/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:26,207 - url_helper.py[DEBUG]: Please wait 4 seconds while we wait to try again
2020-02-14 11:05:30,211 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [34/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:30,212 - url_helper.py[DEBUG]: Please wait 4 seconds while we wait to try again
2020-02-14 11:05:34,216 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [38/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:34,216 - url_helper.py[DEBUG]: Please wait 4 seconds while we wait to try again
2020-02-14 11:05:38,220 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [42/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:38,220 - url_helper.py[DEBUG]: Please wait 4 seconds while we wait to try again
2020-02-14 11:05:42,224 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [46/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:42,225 - url_helper.py[DEBUG]: Please wait 4 seconds while we wait to try again
2020-02-14 11:05:46,229 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [50/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:46,229 - url_helper.py[DEBUG]: Please wait 5 seconds while we wait to try again
2020-02-14 11:05:51,234 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [55/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:51,234 - url_helper.py[DEBUG]: Please wait 5 seconds while we wait to try again
2020-02-14 11:05:56,239 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [60/120s]: unexpected error [oauth support is not available]
2020-02-14 11:05:56,239 - url_helper.py[DEBUG]: Please wait 5 seconds while we wait to try again
2020-02-14 11:06:01,244 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [65/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:01,244 - url_helper.py[DEBUG]: Please wait 5 seconds while we wait to try again
2020-02-14 11:06:06,250 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [70/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:06,250 - url_helper.py[DEBUG]: Please wait 5 seconds while we wait to try again
2020-02-14 11:06:11,255 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [75/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:11,255 - url_helper.py[DEBUG]: Please wait 6 seconds while we wait to try again
2020-02-14 11:06:17,261 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [81/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:17,261 - url_helper.py[DEBUG]: Please wait 6 seconds while we wait to try again
2020-02-14 11:06:23,268 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [87/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:23,268 - url_helper.py[DEBUG]: Please wait 6 seconds while we wait to try again
2020-02-14 11:06:29,274 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [93/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:29,274 - url_helper.py[DEBUG]: Please wait 6 seconds while we wait to try again
2020-02-14 11:06:35,280 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [99/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:35,280 - url_helper.py[DEBUG]: Please wait 6 seconds while we wait to try again
2020-02-14 11:06:41,287 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [105/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:41,287 - url_helper.py[DEBUG]: Please wait 7 seconds while we wait to try again
2020-02-14 11:06:48,294 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [112/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:48,294 - url_helper.py[DEBUG]: Please wait 7 seconds while we wait to try again
2020-02-14 11:06:55,301 - url_helper.py[DEBUG]: Calling 'http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id' failed [119/120s]: unexpected error [oauth support is not available]
2020-02-14 11:06:55,301 - url_helper.py[DEBUG]: Please wait 7 seconds while we wait to try again
2020-02-14 11:07:02,308 - DataSourceMAAS.py[CRITICAL]: Giving up on md from ['http://10.101.196.20:5248/MAAS/metadata/2012-03-01/meta-data/instance-id'] after 126 seconds
2020-02-14 11:07:02,308 - handlers.py[DEBUG]: finish: init-network/search-MAAS: SUCCESS: no network data found from DataSourceMAAS
2020-02-14 11:07:02,309 - util.py[WARNING]: No instance datasource found! Likely bad things to come!
2020-02-14 11:07:02,309 - util.py[DEBUG]: No instance datasource found! Likely bad things to come!
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 236, in main_init
    init.fetch(existing=existing)
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 343, in fetch
    return self._get_data_source(existing=existing)
  File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 253, in _get_data_source
    pkg_list, self.reporter)
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/__init__.py", line 320, in find_source
    raise DataSourceNotFoundException(msg)
DataSourceNotFoundException: Did not find any data source, searched classes: (DataSourceMAAS)

Can anyone tell me what that error means and possible how to address it?

Thanks

you are missing oauth libraries in a image . I’ve never worked with maas-image-builder, but there should be ability to let it install packages during installation. Install packages python2-oauthlib or python-oauthlib.noarch to a base image and it should work.