vatesfr / terraform-provider-xenorchestra

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

Disk size does not expand #328

Open Dmitry-Dymnov opened 1 month ago

Dmitry-Dymnov commented 1 month ago

The disk size does not change via terraform. If VM is running, terraform says OK. But the disk size does not change.

Terraform will perform the following actions:

  # xenorchestra_vm.vm_projects["test-vm"] will be updated in-place
  ~ resource "xenorchestra_vm" "vm_projects" {
        id                                  = "6689dd5c-9258-e516-1d45-239f0d5244bb"
        tags                                = [
            "test",
            "ubuntu",
        ]
        # (25 unchanged attributes hidden)

      ~ disk {
          ~ size             = 21474836480 -> 32212254720
            # (7 unchanged attributes hidden)
        }

        # (3 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

xenorchestra_vm.vm_projects["test-vm"]: Modifying... [id=6689dd5c-9258-e516-1d45-239f0d5244bb]
xenorchestra_vm.vm_projects["test-vm"]: Still modifying... [id=6689dd5c-9258-e516-1d45-239f0d5244bb, 10s elapsed]
xenorchestra_vm.vm_projects["test-vm"]: Still modifying... [id=6689dd5c-9258-e516-1d45-239f0d5244bb, 20s elapsed]
xenorchestra_vm.vm_projects["test-vm"]: Modifications complete after 26s [id=6689dd5c-9258-e516-1d45-239f0d5244bb]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

If VM is turned off, we get an error.

xenorchestra_vm.vm_projects["test-vm"]: Modifying... [id=6689dd5c-9258-e516-1d45-239f0d5244bb]
Error: jsonrpc2: code 13 message: VM state is halted but should be running: {"objectId":"6689dd5c-9258-e516-1d45-239f0d5244bb","expected":"running","actual":"halted"} with xenorchestra_vm.vm_projects["test-vm"], on vm-projects.tf line 13, in resource "xenorchestra_vm" "vm_projects": 13: resource "xenorchestra_vm" "vm_projects"

Terraform v1.8.2 on darwin_amd64

Proposed changes:

ddelnano commented 1 month ago

This is a duplicate of #178. The error you received from attempting this with the VM halted might be a bug in the recent power_state management (https://github.com/vatesfr/terraform-provider-xenorchestra/pull/278).

Can you please provide the logs with the TF_LOG=debug environment variable set during the upgrade when a VM is running?

When you say disk size is not updated, are you talking about from within the VM or from within the XO console? The latter is expected to be updated based on the reports on #178. What happens inside the VM is dependent on what is installed within the VM, the distro used, etc.

Dmitry-Dymnov commented 1 month ago

I meant that when changing the disk size via terraform, nothing happens at all. terraform.log