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

你好!有人修复了 ProxMox 8.1 吗?
我有一个想法要彻底解决这个问题,但我不知道该怎么做,哈哈

我们正在寻找一位能够帮助我们解决 ProxMox 基础设施上持续存在的问题的开发人员。

我们通过cloud-init配置Linux和Windows VPS。cloud-init到底是Linux型VPS自动配置的一个功能,Windows上有一个替代方案,称为Cloudbase-init。

ProxMox 可以很好地管理 Linux VPS 配置,但不知道如何管理本机 Windows 配置!每次更新 ProxMox 时,我们都必须通过 ProxMox 社区中某些人创建的补丁来重新修复qemu.pmcloudinit.pm文件,但不幸的是并不总是得到维护,因此经常会带来问题。

在我看来,这主要与以下事实有关:cloudbase-init无法接收加密形式的Windows密码,而只能接收明文(明文)形式的密码以及用于IP地址配置、磁盘大小调整等的其他元素。

我在 ProxMox 中看到你还可以创建脚本脚本。所以我告诉自己,我们也许可以创建一个钩子脚本,对虚拟机创建而不是硬件进行必要的修改,以传输正确的信息来进行配置,而不是自动制作每次更新 ProxMox 时都会被破坏的东西。知道在 Windows VM 模板中我们有信息表明操作系统类型是 Windows。所以我认为我们当然可以通过明确的脚本来管理这个问题,而不需要通过繁琐的事情!

目前,直到 ProxMox 8.0 版本稳定,GECO IT 的补丁都运行良好!从 ProxMox 8.1 版本开始,该补丁不再有效!

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

我正在寻找一位经验丰富的开发人员,他可以找到最有效的解决方案,并掌握 ProxMox、cloud-init 和脚本的具体细节,找到该问题的解决方案!
8.0版本的兼容补丁已上传。
 

Attachments

  • Qemu.pm.patch.txt
    985 bytes · Views: 34
  • Cloudinit.pm.patch.txt
    5.1 KB · Views: 33
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

This is due to cloudbase-init removing all assigned IPs from the NIC when assign a new one, which means that when assigning the IPv6 address in a dual stack scenario (comes after IPv4) the previously assigned IPv4 address gets wiped.

I'm looking for a way to fix this myself.
 

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!