vatesfr / terraform-provider-xenorchestra

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

Add `xenorchestra_vdi` resource #225

Closed ddelnano closed 1 year ago

ddelnano commented 1 year ago

This PR resolves #193. There is still more work to be done, but opening this up to review an early version of it and receive feedback on it.

This also provides the groundwork for the XO client package to work with the new XO rest api.

Todo

Testing

=== Skipped === SKIP: xoa TestAccXenorchestraVm_createVmThatInstallsFromTheNetwork (0.00s) resource_xenorchestra_vm_test.go:461: For now this test is not implemented. See #156 for more details

DONE 88 tests, 1 skipped in 2192.009s

ddelnano commented 1 year ago

As for use cases for VHD, I personally don't use that at all. Imho it would be more useful to support qcow2 images.

@4censord are you suggesting some type of qemu-img conversion for using VHD? Citrix Hypervisor / XCP-ng don't support qcow2 do they?

ddelnano commented 1 year ago

At this point the PR is ready to be merged. The later remote file support will be followed up on as mentioned in more detail here.

olivierlambert commented 1 year ago

Until SMAPIv3 is production ready, there's no support for qcow2. And when it will, it will depends on the SR type you are in (since SMAPIv3 will allow us to create any kind of SR driver supporting any kind of "way to store" VM disks)

4censord commented 1 year ago

As for use cases for VHD, I personally don't use that at all. Imho it would be more useful to support qcow2 images.

@4censord are you suggesting some type of qemu-img conversion for using VHD?

I didn't articulate well enough what i meant.

Afaik xcp-ng supports import of raw and vhd type images. Many cloud-ready images from upstream are provided in qcow2 format. Conversion is rather easy, qemu-img convert img.qcow2 img.raw, but is still a step to be done manually.

If either Xo or the provider would support converting from qcow2 to raw, that would eliminate this manual step.

As for use cases for vhd images: Same story of "some images might be VHD" so if we can support them that's great.

As far as I understood the provider just needs to set the parameters correctly, and shouldn't need to parse the vhd at all.