]> git.proxmox.com Git - qemu-server.git/commit
fix 4493: cloud-init: fix generated Windows config
authorMira Limbeck <m.limbeck@proxmox.com>
Tue, 30 Jul 2024 15:15:39 +0000 (17:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Jul 2024 17:49:28 +0000 (19:49 +0200)
commitf63cc6dbeb00928343ee93926a9feb200b78acc1
tree00d48533f729a856c01d145c98a5d93f61d453cb
parent145ff0138fc603c70ec4af440b7b57f0ec209c64
fix 4493: cloud-init: fix generated Windows config

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@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuServer/Cloudinit.pm