vatesfr / terraform-provider-xenorchestra

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

Undocumented options with `xenorchestra_vm` #245

Closed RealStickman closed 1 year ago

RealStickman commented 1 year ago

Just started trying out Terraform and I found some additional options it wants to set with my first change.
I only added the cdrom argument.

  # xenorchestra_vm.he1app06 will be updated in-place
  ~ resource "xenorchestra_vm" "he1app06" {
      + core_os            = false
      + cpu_cap            = 0
      + cpu_weight         = 0
        id                 = "55c7b8c0-33e9-2f77-291a-70e924af7b8d"
        tags               = [
            "prod",
            "xo-offline-backup",
        ]
      + wait_for_ip        = false
        # (14 unchanged attributes hidden)

      + cdrom {
          + id = "316e7480-1598-488a-8e4e-4bca4bcbeaed"
        }

        # (3 unchanged blocks hidden)
    }

I couldn't find the options core_os, cpu_cap and cpu_weight mentioned anywhere.
cpu_cap and cpu_weight are also present in the Xen Orchestra interface. Though I think the cpu_weight should default to 256 as XO does.
I wasn't able to find concrete information on what core_os does.

ddelnano commented 1 year ago

HI @RealStickman, while those fields are present in the provider's plan output and state file they aren't sent in any of the XO API requests. This is functionality that should be added to the provider, but we haven't gotten around to implementing it.

It's been a long time since I looked at the core_os stuff, but I believe it's related to running containers. Here is a blog post that touches on it. That may not be something that xcp-ng aims to target, but it was enumerated as part of the vm creation API parameters and so I left a placeholder there to revisit it.

RealStickman commented 1 year ago

Hey, thanks for the explanation.
Those extra steps to setup core_os explain why I hadn't come across it before.

As you're already aware of these fields I'll go ahead and close this issue.
Thanks a lot and have a nice day!