Cloudbase-init on Windows
-
I've been working on getting Windows deployments (2022 in particular) to customize with Cloudbase-init.
So far I have it:
- Updating the hostname
- Updating the administrator account's password
- Running a command
- And configuring the NIC with a static IP when supplied with the MAC address.
If I don't supply the MAC in the network config, then cloudbase-init throws a bunch of errors in the log looking for the address and does not set the static IP. It doesn't make sense as their doc states that the field is optional. But seems to be necessary to find the NIC.
So to make it work, I need to specify a MAC address in XO when creating the VM. And then paste that into the network config yaml.
So is there a template variable for MAC like there is for {name} and {index} ? And if not... can we get one?
The working network config:
network:
version: 1
config:
- type: physical
name: eth0
mac_address: "56:a7:01:38:75:3f"
subnets:
- type: static
address: 192.168.1.3/24
gateway: 192.168.1.1
dns_nameservers:
- 192.168.1.2
dns_search:
- company.nameOr am I just doing it wrong?
Thanks!
jonathan -
Would you mind sharing your cloudbase conf and yaml files to get that far?
-
@onthegrid Sure!
So with the network config above. Gotta make your own MAC address and have it match the one in the interface field when cloning the template. (Variable would be nice here.)
Cloud config in XO:
Installed cloudbase with defaults. Did not run sysprep. Did not reboot. I plan to handle those IDs later. And trying to sysprep Windows 11 didn't work/broke.
Cloudbase-init.conf:
If i recall correctly, it was just the last three lines I changed/added. Tested on Server 2022 and Windows 11. If we do go into produciton on this platform, I'll do the other config stuff later. I just wanted to make sure I could get the OS config'd with an IP, update the hostname, and reset the administrator password.