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

cansoylu

New Member
hi gecoit.
I will recive error with dir "Program Files (x86) " not found ,when i run ModifyConf.ps1 on x86 system.
View attachment 37072
Hey, I think it's OS 32-64 bit detection problem. Try changing this line:
Code:
$fileNames = Get-ChildItem "C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\conf" -Recurse | select -expand fullname
to this
Code:
$fileNames = Get-ChildItem "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf" -Recurse | select -expand fullname
Can you tell me if your virtual machine is indeed 32bit so I can update the script?
 

cansoylu

New Member
Upstreaming likely would've prevented the mentioned issue, which was triggered by a recent refactoring.
You can use this file to manually add the patch to the new version, there are also explications on what every function does.
https://git.geco-it.net/GECO-IT-PUBLIC/Geco-Cloudbase-Init/src/branch/master/MANUALPATCH.md

If you already have the patches and want to contribute back, why not upstream it?
https://pve.proxmox.com/wiki/Developer_Documentation

Hello everyone, sorry for the late reply. We are a bit busy with a lot of projects going on.

So 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.
 
Last edited:
  • Like
Reactions: Bruno Garcia

snknick

New Member
Mar 19, 2022
8
2
3
37

cansoylu

New Member
Going through to see if I can get it running on 7.2. Documentation misses out the following lines from Qemu.pm

Code:
 my $conf = PVE::QemuConfig->load_config($vmid);
 my $ostype = $conf->{ostype};
I've added those lines in manual patch.
I've just downgraded qemu-server, and it's working at PvE 7.2

apt-install qemu-server=7.1-4

The incompatibility is at the qemu-server
qemu-server is the package that installs and updates those files.
 

snknick

New Member
Mar 19, 2022
8
2
3
37
I've added those lines in manual patch.

qemu-server is the package that installs and updates those files.

Cheers, appreciate it!

Other thing I've noticed is Cloud-Init now offers to install as a service from the start. Is that preferred or does it break anything vs running the script you have to change it over?

So far no luck in 7.2 following the instructions carefully. Everything looks like it works but cloning the machine just fires it up with the same account and login details as it had in the template. Given we're running an OOBE sysprep this seems pretty unusual.

I've reverted all changes and am going to try again from scratch to see how that goes.
 

Daniel S.

Member
May 15, 2019
21
0
6
It does not work on latest release proxmox 7.2-4.

Not to mention that after manually patching, a lot of errors show up regarding Cloudinit.pm when trying to regenerate a cloudinit drive for a VM.
This is reffering to: sub configdrive2_gen_metadata {

Password for windows administrator is never set.

Used the guide exactly as written in the docs, no luck on latest release.
Maybe you should check and make the neccessary changes.

I used windows server 2019 on my vm.
 

SPDY

New Member
Aug 18, 2022
1
0
1
Hi gecoit,

I have tried to use your script but it doesn't create the windows Image correctly. And, I have tried multiple times.

once I put all the script you given into /LocalScript/ but it doesn't function well. And, how to excute the password from proxmox cloud-init once I edit it.
 

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 your own in 60 seconds.

Buy now!