New Question
0

Cloudbase +Win10 +MaaS = cloudinit.sources.DataSourceNotFoundException

asked 2024-07-30 09:12:27 +0200

scottblackburn gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2024-07-31 01:46:13 +0200

scottblackburn gravatar image

updated 2024-07-31 01:49:43 +0200

Hello Avladu - thanks for taking a look. I confirm that the MAAS_API_KEY[0] is not literal, and is just a placeholder as I didn't want to publish the actual key (but I still wanted to show what parts of the API key were going where)

Curtin hooks are present, and were installed during the image creation process via the config.ini setting image_type=MAAS. Just to confirm as well, the virtual_disk_format=RAW leaves me with file myimage.raw, which is then tar.gz'ed into a `'myimage.tgz' file. I'm uploading into MAAS using the below, which hasn't generated any errors, so I just figured it was OK. Will the file type of ddtgz make all the difference?

maas MY_LOGIN boot-resources create name='windows/win1022h2' title='Windows 10 22H2 (cloud)' architecture='amd64/generic' filetype='tgz' content@=Win10_22H2_English_x64v2_custom.tgz

edit flag offensive delete link more
0

answered 2024-07-30 19:30:36 +0200

avladu gravatar image

Hello,

From your cloudbase-init config file, is your config value oauth_consumer_key=MAAS_API_KEY[0] literal value? or just replaced by you for security reasons?

On the image building side, please make sure that the submodules are fetched (see -> https://github.com/cloudbase/windows-... ) and maybe this comment can be of help: https://ask.cloudbase.it/question/309... .

Thanks.

edit flag offensive delete link more

Comments

Turns out that setting the file type to 'ddtgz' was EXACTLY the issue. Can't believe that's all it was. Many thanks avladu - this was a real bug-bear for me. If I could buy you a coffee I would!

scottblackburn gravatar imagescottblackburn ( 2024-07-31 02:50:31 +0200 )edit

Hello, glad that the comment link was helpful. All the best!

avladu gravatar imageavladu ( 2024-08-05 15:46:10 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-07-30 09:12:27 +0200

Seen: 190 times

Last updated: Jul 31