[TUTORIAL] HOWTO: Scripts to make cloudbase work like cloudinit for your windows based instances

And what if someone else does it, so not proxmox or the poster of arbitrary code themselves?
Yeah no, that's not how it works. On signing the CLA and contributing code to Proxmox projects you agree that you hold the rights on that code to do so (i.e., implemented it yourself, or somebody else gave you the rights on that), so just taking some code and submitting it on their behalf doesn't "magically" removes copyright.

I mean, in practice this is naturally more muddy and a lot of changes are probably to small to warrant a clean room implementation, but we're pretty strict to avoid muddying our code base, and it's strong AGPLv3 license - which helps to keep Proxmox projects alive and well funded in the first place.

I think, if the original authors really aren't interested in up streaming this (or don't have the time for it, all valid reasons after all) it would be probably quicker to just reimplementing this without looking at their patches - for that it might be helpful to open a Bugzilla enhancement request for qemu-server and add some infos about what the goal is and what cloud-init properties are required (ideally with some reference to cloud-init docs or code resources).
 
Agreed @t.lamprecht , I thought so already, just making sure.

@gecoit
Will you give a try to upstream your code yourself? Or should we make a bugzilla feature request so the code can be written in another way?
 
  • Like
Reactions: t.lamprecht
Hello,

First of all, sorry for the lack of answers. As stated previously by one of my colleague, we are a busy with a lot of projects and we haven't updated our production systems to Proxmox 7 yet :

We are actually using this patch with 6.4 in production. We have done the tests for version 7.1 in a lab environment, but we are not in production with 7.1 or 7.2.

We have spoken about up streaming it, but I suppose there are some points that need to be treated in order to make a commit. Like clear text password and readopting to version 7.2 etc. We actually don't really have time to do it right now, but will seek an opportunity to do it in the future.

But it is on our roadmap, that's for sure. We plan on updating to Proxmox 7 in the near future as we still use and deploy Proxmox a lot.
I'll try to update you guys as soon as I have any more updates from our technical team and as we're trying to communicate more regarding such projects.
 
Has anyone had a problem that when you create a copy, at first startup - requires inside the machine to change the password?
 
So sorry for reply late, I just upgrade to 7.3.

Bash:
root@pve1:~# apt show qemu-server
Package: qemu-server
Version: 7.3-3

Patch for Proxmox VE 7.3+
A little concerned about running this...

Code:
                if(PVE::QemuServer::windows_version($ostype) && ($id eq "eth0")) {

Will this cause a break if my interface is NOT called "eth0"?
 
A little concerned about running this...

Code:
                if(PVE::QemuServer::windows_version($ostype) && ($id eq "eth0")) {

Will this cause a break if my interface is NOT called "eth0"?
"eth0" be defined auto in Windows (VM), not in PVE (host)
 
Last edited:
  • Like
Reactions: node
Hello everyone,

On my machines not working IPv4 and IPv6.
If I configure only IPv4 it works fine.
If I configure both(IPv4 and IPv6) cloud-init configures only IPv6. :(


Log:
Bash:
2023-04-20 15:00:10.135 3620 DEBUG cloudbaseinit.utils.debiface [-] Found new interface: {'name': 'eth0', 'mac': None, 'address': '176.123.0.147', 'address6': None, 'netmask': '255.255.255.0', 'netmask6': None, 'broadcast': None, 'gateway': '176.123.0.1', 'gateway6': None, 'dnsnameservers': ['8.8.8.8']} _add_nic C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\debiface.py:104
2023-04-20 15:00:10.135 3620 DEBUG cloudbaseinit.utils.debiface [-] Found new interface: {'name': 'eth0', 'mac': None, 'address': '2001:678:6d4:4010::38', 'address6': None, 'netmask': '64', 'netmask6': None, 'broadcast': None, 'gateway': '2001:678:6d4:4010::1', 'gateway6': None, 'dnsnameservers': None} _add_nic C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\debiface.py:104
2023-04-20 15:00:10.151 3620 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-04-20 15:00:10.354 3620 INFO cloudbaseinit.plugins.common.networkconfig [-] Configuring network adapter: Ethernet
2023-04-20 15:00:10.495 3620 DEBUG cloudbaseinit.osutils.windows [-] Removing existing IP address "fe80::39:63f9:9dd0:2f03%3" from adapter "Ethernet" _set_static_network_config C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:982
2023-04-20 15:00:10.510 3620 DEBUG cloudbaseinit.osutils.windows [-] Removing existing IP address "2001:678:6d4:4010::38" from adapter "Ethernet" _set_static_network_config C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:982
 2023-04-20 15:00:10.557 3620 DEBUG cloudbaseinit.osutils.windows [-] Removing existing route "ff00::/8" from adapter "Ethernet" _set_static_network_config C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:991
2023-04-20 15:00:10.557 3620 DEBUG cloudbaseinit.osutils.windows [-] Removing existing route "::/0" from adapter "Ethernet" _set_static_network_config C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:991
 
Last edited:
So sorry for reply late, I just upgrade to 7.3.

Bash:
root@pve1:~# apt show qemu-server
Package: qemu-server
Version: 7.3-3

Patch for Proxmox VE 7.3+
Thank you very much for your work, could you please update this patch to the appropriate GitHub repository ( https://github.com/GECO-IT/Geco-Cloudbase-Init )? On another note, Debian 12 has been released and Proxmox VE has been updated to 8.0, are there any plans to patch it?
 
Last edited:
  • Like
Reactions: spschumacher
pve 8.0.3:

i will update this as i go.

the 7.1.4 patch checking came back positive for me on pve 8.0.3. so i applied them.

created windows vm, ran into the same issue as the poster before me, fixed by removing cloud init drive for the moment.

will use ide 0+1 for windows cd and virtio. will remove both later and instead attach cloudinit drive to ide0 + serial port. (no idead if this will work, it's my first time dabbling with this)

systemctl restart pvedaemon.service after this of reboot after so proxmox uses patched files (fml, will probably have to restart..)

after windows updates and virtio install is done, reboot.

log in with your user, in my case tmpuser

install CONTINUOUS cloudbase (nice docs, jfc..), choose tmpuser as username, uncheck run as system.

dont run sysprep, just click finish

Copy these two conf files to C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf. link doesnt work, so i have no clue which 2 conf files u mean in your github.

edit: those 2:
https://github.com/GECO-IT/Geco-Cloudbase-Init/tree/master/conf

will look into more progress on this..
 
Last edited:
Hello! Someone have a fix for ProxMox 8.1?
I had an idea of to fix definitly this but I don't know how to do lol

We are looking for a developer who can help us resolve a persistent problem on our ProxMox infrastructures.

We provision Linux and Windows VPS via cloud-init. Cloud-init is a feature for the automatic deployment of Linux-type VPS originally and there is an alternative for Windows called Cloudbase-init.

ProxMox manages Linux VPS provisioning very well but does not know how to manage native Windows provisioning! Each time ProxMox is updated, we must repatch the qemu.pm and cloudinit.pm files via patches created by certain people in the ProxMox community but unfortunately not always maintained, so this regularly poses a problem.

It seems to me that this is mainly linked to the fact that cloudbase-init cannot receive the Windows password in encrypted form but only in clear text (plaintext) and other elements for IP address configuration, disk resizing, etc. ..

I saw that in ProxMox you can also create script hooks. So I told myself that instead of making patches which are destroyed each time ProxMox is updated, we could perhaps create a hook script which makes the modifications necessary for the creation of the VM or its hardware modification to transmit the right information to do automatic provisioning. Knowing that in the Windows VM template we have the information which says that the OS type is Windows. So I think that we can certainly manage this with a definitive script and no longer via tedious patches!

Currently until version 8.0 of ProxMox the patch from GECO IT worked quite well! Since version 8.1 of ProxMox the patch no longer works!

https://forum.proxmox.com/threads/h...init-for-your-windows-based-instances.103375/

I'm looking for an experienced developer who can find the most efficient solution and who has mastered the nuts and bolts of ProxMox, cloud-init and scripting to find a solution to this problem!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!