Closed rosskirkpat closed 1 month ago
The fix should be relatively simple - I threw together a commit here.
Unfortunately, I am unable to fully build cloudbase-init from source for Windows amd64 to verify that these changes work
Hi @rosskirkpat,
I have managed to fix the Github Actions to produce cloudbase-init installers. I have triggered a run with your master branch and it produced a working MSI artifact that you can use and test:
https://github.com/ader1990/cloudbase-init-installer-1/actions
You can also fork the installer project and trigger the github actions.
Once you get to test the artifact in your environment, please give me a ping so that we can proceed with the formal review.
Thank you, Adrian
Ran into this exact same issue trying to use it with proxmox cloud-init integration. The proposed patch does not work for me, and I'm pretty sure it won't fix a bunch of other respective issues as well.
Initial error:
2022-05-15 08:57:38.043 3360 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] F:\meta-data not found _meta_data_file_exists C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:58
2022-05-15 08:57:38.043 3360 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for a Config Drive with label 'cidata' on 'F:\'. Found mismatching label 'cidata'. _check_for_config_drive C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:70
Error after patch:
2022-05-15 09:35:56.862 3528 WARNING cloudbaseinit.metadata.services.osconfigdrive.windows [-] Config type iso not found in cdrom location; Error: 'TypeError("join() argument must be str or bytes, not 'list'",)'
For reference:
ls F:\
Directory: F:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
--r-- 5/15/2022 8:18 AM 54 META_DATA
--r-- 5/15/2022 8:18 AM 218 NETWORK_CONFIG
--r-- 5/15/2022 8:18 AM 306 USER_DATA
--r-- 5/15/2022 8:18 AM 0 VENDOR_DATA
PS C:\Users\Administrator> cat F:\META_DATA
instance-id: bf2100ee538186a86bae00e6f2cf332ca33e0448
PS C:\Users\Administrator> cat F:\NETWORK_CONFIG
version: 1
config:
- type: physical
name: eth0
mac_address: '7a:a7:57:d1:24:54'
subnets:
- type: dhcp4
- type: nameserver
address:
- '172.29.0.1'
search:
- 'lan'
PS C:\Users\Administrator> cat F:\USER_DATA
#cloud-config
hostname: ci
manage_etc_hosts: true
password: ...
ssh_authorized_keys:
- ...
chpasswd:
expire: False
users:
- default
package_upgrade: true
PS C:\Users\Administrator> cat F:\VENDOR_DATA
Is there any workaround for this problem? I'm hitting this issue when provisioning a Windows 2022 VM in Proxmox 8.1 as well.
Is there any workaround for this problem? I'm hitting this issue when provisioning a Windows 2022 VM in Proxmox 8.1 as well.
Hello @balaji-dutt,
I will create an MSI installer with the above possible fix. Will update this thread when it is ready.
Thanks.
Hello @balaji-dutt,
I will create an MSI installer with the above possible fix. Will update this thread when it is ready.
Thanks.
Hi @ader1990 please note that as Proxmox 8.1 (Source) Proxmox generates NoCloud config files such as user-data
or meta-data
which as per the original issue should be recognised by Cloudbase-init. So it's confusing why we get errors like "Found mismatching label".
@balaji-dutt can you share an ISO here? should be rather small and you can use the dd tool to get it.
@balaji-dutt can you share an ISO here? should be rather small and you can use the dd tool to get it.
Hi @ader1990 sure. I'll need some time to remove a bunch of sensitive data in the user-data
file but will upload it here once I'm ready.
@balaji-dutt can you share an ISO here? should be rather small and you can use the dd tool to get it.
Hi @ader1990 sure. I'll need some time to remove a bunch of sensitive data in the
user-data
file but will upload it here once I'm ready.
Sure. It's best to have a closest to real one, so that I can reproduce the issue and fix it.
@ader1990 Sorry for the delay in getting back on this. Attached is a NoConfig image generated by Proxmox in ISO format, that is triggering the "Found mismatching label" when used with a Windows 2022 VM on Proxmox 8.1.
Please note I have to upload it as a Zip file as GitHub does not allow ISO files to be directly uploaded.
Hello @balaji-dutt,
The mismatching label is an incomplete debug log, which needs fixing. In your case, https://github.com/cloudbase/cloudbase-init/blob/master/cloudbaseinit/metadata/services/osconfigdrive/windows.py#L65, it cannot find the meta-data/user-data file, because the ISO has META_DATA/USER_DATA files. Will come back with a fix.
Thanks.
Hello,
I have created a WIP branch here: https://github.com/ader1990/cloudbase-init-1/tree/fix_nocloud_metadata . As it is rather opaque and maybe undesired behaviour to have both meta_data/user_data and meta-data/user-data being tried and used, I have made those values configurable via the cloudbase-init config file.
Example of the default options in the cloudbase-init.conf file:
[nocloud]
metadata_file = "meta-data"
userdata_file = "user-data"
Thanks.
@balaji-dutt You can find a test MSI installer here -> https://github.com/ader1990/cloudbase-init-installer-1/actions/runs/7453600623.
Tested with your provided ISO and it worked as expected.
You need to set the NoCloud metadata service and the correct paths for the meta/user data.
[DEFAULT]
## other configs
metadata_services=cloudbaseinit.metadata.services.nocloudservice.NoCloudConfigDriveService
[nocloud]
metadata_file=META_DATA
userdata_file=USER_DATA
Hi @ader1990
@balaji-dutt You can find a test MSI installer here -> https://github.com/ader1990/cloudbase-init-installer-1/actions/runs/7453600623.
Tested with your provided ISO and it worked as expected.
You need to set the NoCloud metadata service and the correct paths for the meta/user data.
[DEFAULT] ## other configs metadata_services=cloudbaseinit.metadata.services.nocloudservice.NoCloudConfigDriveService [nocloud] metadata_file=META_DATA userdata_file=USER_DATA
I can confirm that this dev version does indeed work with the NoCloud ISO that is generated by Proxmox. Debug log below the fold for reference:
I have a question - currently the [nocloud]
section only supports metadata_file
and userdata_file
. Given that the Proxmox NoCloud ISO also includes NETWORK_CONFIG
and VENDOR_DATA
would it be better to include options to set the path for these files as well?
Hi @ader1990 the beta version of the Cloudbase-init MSI is as of December 2023, which does not incorporate the fix which is in the Test MSI. May I know when the next beta release is expected?
We (The K8s on Windows team at SUSE Rancher) are unable to use cloudbase-init with the NoCloud metadata service due to cloudbase-init not handling underscores in the
user-data.iso
that is generated by go-diskfs.When user-data.iso files are created by rancher/machine using go-diskfs, a linux host will have meta-data and user-data files in the ISO once it is mounted on a vSphere host. cloudinit handles the uppercase names using underscores: https://github.com/canonical/cloud-init/blob/main/cloudinit/cmd/query.py#L139-L205
When user-data.iso files are created by rancher/machine using go-diskfs, a Windows host will have META_DATA and USER_DATA files in the ISO once it is mounted on a vSphere host. This causes cloudbase-init to fail as it is looking for meta-data or META-DATA.
The ISO standard does not allow for
-
to be used in the name (see below).Ref: https://github.com/rancher/rancher/issues/36653 https://github.com/rancher/windows/issues/155