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.
-
@jkatz
Hi,
I'm trying to do the same thing.
So, did you just shutdown the VM after cloudbase init installation and do the changes in config files ?
Which one you change unattended ?
How will you manage sysprep ?I came from VMware world, and everything there just works.
Here you have to put your problem on forum ( most of them are just basic/standard VM deployment and administration stuff ) and pray for an answer with a resolution.Best regards
-
-
@Andrew7 said in Cloudbase-init on Windows:
I came from VMware world, and everything there just works.
Here you have to put your problem on forum ( most of them are just basic/standard VM deployment and administration stuff ) and pray for an answer with a resolution.Best regards
You're welcome to go back to VMWare as well.
As the saying goes, "if you're free to stay, you're free to go".
If you want to buy support for your environment then do so and you can create a private ticket with the Vates company and not have to post on the forums. You can't have your cake and eat it too.
-
No problem.
I'm just a infrastructure engineer/architect as many of us here looking for VMware alternatives.
I work in big global company that builds and deploys solutions for different clients.
Most of them are asking if there is a real enterprise solution that we can work with, aside from VMware.
That's why I'm here trying to figure it out, how this product works. How to do things that you normal do on daily basis in vCenter and ESXi's.No one have to provide any answers here. I wonder for how long this product will survive then ?
I would like to remind you that VMware market share and popularity came from free ESXi, vCenter with 3 months trial with full features and easy access to get into product and get help on forums.My frustration is coming from basic things that I am not able to do here.
It's not that I'm asking about some advanced features. We are talking about VM provisioning on the basic level.
Template creation and deploying VMs from that template with changes that needs to be done during deployment like hostname, IPs and Windows SIDs.If it's too much to ask how to do it, fine. I will move to check out other hypervisors.
-
@Andrew7 XCP-ng has always been free to use, the same for Xen Orchestra (from source) you can look at my profile to find a link or read the documentation to deploy it yourself.
You've hijacked someone else's thread to ask your question because their question was similar to yours, I guess?
And you seem to have an arrogance about your inquiry of "it just works on this other product that we're fleeing from that would cost us as much as 300% more every year forever".
And on the same coin, other side you're saying you haven't the faintest reason why anyone would be upset with your tone, while asking for free help.
Support for a 3 host pack, is as cheap as $1000/year or $3000, with essentially unlimited and confidential access for a product which has a long tract record.
-
Cloudbase-init is currently the recommended method for personalizing Windows templates in XO. It supports multiple configuration plugins (hostname/credentials/licensing etc.), which are available from the linked page above.
For customizing deployed VMs, what I like to do is to prepare a "skeleton" cloud-init file and set it in XO Settings -> Cloud config. Then I can load this config at any time and fill in the details later for each batch of VM I want to deploy.
We do have a Packer repo for making master VM templates from @nathanael-h; it will prepare an XVA image ready for specialization using cloudbase-init. I'll try to work to publish that and provide some documentation next.
As for Sysprep support specifically, I've put in a request to the XO team, although I can't promise anything specific for now.
-
Thank you for the replay.
I understand that cloudbase-init is a way to go. I did similar config to @jkatz and don't know why it doesn't work for me.
I did exactly as you suggested, created Cloud Config settings in XO and then use that during deployment screen.
I've tried to set it up with this guide
https://docs.xen-orchestra.com/vm-templatesSo I've added those fields :
config_drive_vfat=true
...
metadata_services=cloudbaseinit.metadata.services.nocloudservice.NoCloudConfigDriveService
plugins=cloudbaseinit.plugins.common.userdata.UserDataPlugininto config files.
I'm probably doing something wrong but I don't know where to look.
It seems that cloudbase-init doesn't even start or it is skipped because my input is totally incorrect in those "User config " and "Network Config" fields.The log folder here is empty
Do you have any ideas why it doesn't work ?
It might be the case that I'm just an idiot and did some rookie mistake as I have never used cloudbase-init before.
So, I don't really know if the problem is my Custom Config settings in XO or cloudbase-init config on VM.@dinhngtu said in Cloudbase-init on Windows:
As for Sysprep support specifically, I've put in a request to the XO team, although I can't promise anything specific for now.
Thank you.