[pve-devel] applied: [PATCH v3 qemu-server] fix 4493: cloud-init: fix generated Windows config

Mira Limbeck m.limbeck at proxmox.com
Wed Jul 31 10:02:04 CEST 2024



On 7/30/24 21:14, Thomas Lamprecht wrote:
> Am 30/07/2024 um 17:15 schrieb Mira Limbeck:
>> Cloudbase-Init, a cloud-init reimplementation for Windows, supports only
>> a subset of the configuration options of cloud-init. Some features
>> depend on support by the Metadata Service (ConfigDrive2 here) and have
>> further limitations [0].
>>
>> To support a basic setup the following changes were made:
>>  - password is saved as plaintext for any Windows guests (ostype)
>>  - DNS servers are added to each of the interfaces
>>  - SSH public keys are passed via metadata
>>
>> Network and metadata generation for Cloudbase-Init is separate from the
>> default ConfigDrive2 one so as to not interfere with any other OSes that
>> depend on the current ConfigDrive2 implementation.
>>
>> DNS search domains were removed because Cloudbase-Init's ENI parser
>> doesn't handle it at all.
>> The password set via `cipassword` is used for the Admin user configured
>> in the cloudbase-init.conf in the guest while the `ciuser` parameter is
>> ignored. The Admin user has to be set in the cloudbase-init.conf file
>> instead.
>> Specifying a different user does not work.
>>
>> For the password to work the `ostype` needs to be any Windows variant
>> before `cipassword` is set. Otherwise the password will be encrypted and
>> the encrypted password used as plaintext password in the guest.
>>
>> The `citype` needs to be `configdrive2`, which is the default for
>> Windows guests, for the generated configs to be compatible with
>> Cloudbase-Init.
>>
>> [0] https://cloudbase-init.readthedocs.io/en/latest/index.html
>>
>> Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
>> ---
>> v3:
>>  - removed `use URI` since we already `use URI::Escape`
>>  - sent a separate patch adding `liburi-perl` dependency in d/control
>> v2:
>>  - unchanged
>>
>>  PVE/API2/Qemu.pm            | 13 ++---
>>  PVE/QemuServer/Cloudinit.pm | 99 +++++++++++++++++++++++++++++++++++--
>>  2 files changed, 101 insertions(+), 11 deletions(-)
>>
>>
> 
> applied series, thanks!
> 
> Some tests would be nice for this CI stuff in general though, e.g. taking
> in CI properties and mocking the write/apply parts to test if the resulting
> output matches our expectation could already be a simple regression test
> providing some basic safety net.

Will look into it




More information about the pve-devel mailing list