New Question

Revision history [back]

click to hide/show revision 1
initial version

Cloudbase +Win10 +MaaS = cloudinit.sources.DataSourceNotFoundException

I'm having a bit of a rough time attempting to set up a Windows 10 image for a MaaS service. (note: this is not a production thing at this stage)

Thus far, I've set up the service which is happily downloading Ubuntu cloud images and installing them into either Proxmox virtual machines or physical workstations. Of course, the challenge now has been to do the same with a Win10 image and Cloudbase-init (at least in a virtual sense).

I've used the Cloudbase Windows Imaging Tools, customizing config.ini and cloudbase-init.conf and cloudbase-init-unattend.conf files, then building the image.

This has resulted in a no-error build that leaves me with a (rather large) RAW image file that is compressed to tgz. I upload to maas and import to boot-resources without error. The image sync's and tells me it's ready. (at this point, I almost feel accomplished since this isn't my usual jam...)

Yet - there is where the fun stops. On deployment, cloud-init reports the following:

Ubuntu 22.04.4 LTS ubuntu tty1

ubuntu login: [  OK  ] Listening on Socket for unix for snap application lxd.daemon.
[  OK  ]  Listening on Socket for unix for snap application lxd.user-daemon.
          Starting Service for snap application lxd.activate...
[  OK  ]  Finished Service for snap applicaiton lxd.activate.
[  OK  ]  Started snap.lxd.hook.configure-8223c7b7-ca9d-4d5b-b1b8-cdde8aca77f3.scope.
          Starting Time & Date Service...
[  OK  ]  Started Time & Date Service.
[  27.743767]  cloud-init [1519]: Can not apply stage config, no datasource found!  Likely bad things to come!
[  27.743894]  cloud-init [1519]: ---------------------------------------------------------
[  27.744192]  cloud-init [1519]: Traceback (most recent call last):
[  27.744273]  cloud-init [1519]:  File "/usr/lib.python3/dist-packages/cloudinit/cmd/main.py", line 597, in main_modules
[  27.744334]  cloud-init [1519]:     init.fetch(exisitng="trust")
[  27.744382]  cloud-init [1519]:  File "/usr/lib.python3/dist-packages/cloudinit/stages.py", line 501, in fetch
[  27.744440]  cloud-init [1519]:    return self._get_data_source(existing=existing)
[  27.744494]  cloud-init [1519]:  File "/usr/lib.python3/dist-packages/cloudinit/stages.py", line 366, in _get_data_source  
[  27.744557]  cloud-init [1519]:    (ds, dnsname) = sources.find.source(
[  27.744604]  cloud-init [1519]:  File "/usr/lib.python3/dist-packages/cloudinit/sources/__init__.py", line 1039, in find_sources
[  27.744665]  cloud-init [1519]:    raise DataSourceNotFoundException(msg)
[  27.744713]  cloud-init [1519]: cloudinit.sources.DataSourceNotFoundException: Did not find any data source, searched classes: () 
[  27.744774]  cloud-init [1519]: ---------------------------------------------------------

I'm unsure if I have a MaaS problem, or an image/config problem (I'm leaning towards the latter since ubuntu cloud images deploy flawlessly).

The only areas that I'm aware of for cloudbase that configure metadata services are the two cloudbase-init(-unattend).conf files. For this case, the configuration is set to the following:

cloudbase-init.conf

[DEFAULT]
username=Administrator
groups=Administrators
inject_user_password=true
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
debug=true
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
log_file=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
logging_serial_port_settings=
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
check_latest_version=true
# MAAS Specific settings
https_allow_insecure=true
metadata_services=cloudbaseinit.metadata.services.maasservice.MaaSHttpService
metadata_base_url=http://192.168.1.225:5248/MAAS/metadata/
oauth_consumer_key=MAAS_API_KEY[0]
oauth_consumer_secret=''
oauth_token_key=MAAS_API_KEY[1]
oauth_token_secret=MAAS_API_KEY[2]

cloud-init-unattend.conf

[DEFAULT]
username=Administrator
groups=Administrators
inject_user_password=true
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
debug=true
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
log_file=cloudbase-init-unattend.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
logging_serial_port_settings=
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
netbios_host_name_compatibility=true
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
check_latest_version=false
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,
    cloudbaseinit.metadata.services.httpservice.HttpService,
    cloudbaseinit.metadata.services.maasservice.MaaSHttpService
plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,
    cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,
    cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin
allow_reboot=true
stop_service_on_exit=false
# MAAS Specific settings
https_allow_insecure=true
metadata_base_url=http://192.168.1.225:5248/MAAS/metadata/
oauth_consumer_key=MAAS_API_KEY[0]
oauth_consumer_secret=''
oauth_token_key=MAAS_API_KEY[1]
oauth_token_secret=MAAS_API_KEY[2]

I've had a peek at what's happening during the build process and confirm that curtin hooks and the config files are being injected.

I've worked through a ton of things to get this far with the whole set up, but I'm not sure how to debug this one further. Any help / advice that could be offered would be greatly appreciated.

Other bits and pieces:
MaaS server: 192.168.1.225
MaaS URL: http://192.168.1.225:5240/MAAS/
MaaS proxy: off
MaaS = v3.5
MaaS = Installed via Snap (upgrade from v3.4x)
(note: DNS & DHCP services are handled by a virtualized pfSense router)