vatesfr / terraform-provider-xenorchestra

Xen Orchestra provider for Terraform
MIT License
150 stars 33 forks source link

Windows VMs unable to mount config drive #229

Open Roche-Mike opened 1 year ago

Roche-Mike commented 1 year ago

I have been using Terraform with the Xenorchestra and Cloudinit providers to create config drives with the nocloud settings I need. Works like a champ.

The 10MB config drives are vfat partitions that Linux is able to mount and can clearly see all the settings I sent to the VM via Terraform. Very nice, it works.

However, I also need to build Windows VMs. I'm using "cloudbase-init" (a cloud-init compatible application for Windows computers) and no matter what I do - well, it doesn't seem to matter. Cloudbase-init doesn't even get the chance to mount the config drive.

It simply cannot be mounted. Windows sees the drive, but it has no partition, appearing as a raw disk. The drive is visible in Disk Manager, diskpart, etc. but cannot be mounted for any reason.

For fun, I disconnected the nocloud config drive from the Windows VM, attached it to an existing Linux VM and voila - it was easy to mount, and there were all the files I needed. The drive had the correct "cidata" label and vfat filesystem.

I wonder if I'm missing something - I've been "googling" for weeks now, trying to find someone else doing what I'm doing on Xen Orchestra and I'm unable to figure out by prior examples and other people's work, whether there is something wrong.

I have tried running both the Linux and Windows versions of Terraform, to no avail.

Is it possible for this provider to create an ISO file instead? I would try that instead if it was an option.

4censord commented 1 year ago

Is windows able to mount raw filesystems that are not on in a partition? I haven't used windows in a while, but I seem to remember something like this.

If we were to consider changes to the how of cloudinit, those changes would have to be made together with the xen-orchestra team, as cloud-init disk generation is handled by that currently, AFAIK.

Roche-Mike commented 1 year ago

OK then, I'll take this up with the XO team, thank you for the speedy response.

ddelnano commented 1 year ago

I agree that discussing this with the Xen Orchestra team would be best as it may result in changes to XO. Please link the forum or other discussion if you don't mind. I'm interested in following along, but unfortunately can't help much with my lack of Windows experience.

Roche-Mike commented 1 year ago

Sure no problem, thanks for your time: https://xcp-ng.org/forum/topic/7082/xen-orchestra-terraform-provider-and-windows