XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Terraform and disk migrations

    Scheduled Pinned Locked Moved Infrastructure as Code
    4 Posts 3 Posters 419 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      carloum70
      last edited by

      Hi all,

      I have a general question about the Terraform provider.

      At the moment, all my VMs are managed by Terraform, so far, so good. However, there’s one feature I’m missing. Terraform doesn’t seem to support disk migration. When I change the sr_id in the xenorchestra_vm resource, I get the following error:

      Error: disk update action 'disk migration Update (Sr ID update)' not handled
      

      I’m aware that I can use "ignore_changes = [disk]", but in that case, I lose the ability to modify the disk size through Terraform.

      I’m not really happy with the idea of managing my VMs partly in Terraform and partly in XO. Another possible workaround is to set "ignore_changes = all", using Terraform only to create or remove systems, and handling all other changes through XO or Ansible.

      How are you handling this situation?

      CyrilleC 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Ping @Team-DevOps

        1 Reply Last reply Reply Quote 0
        • CyrilleC Offline
          Cyrille Vates 🪐 DevOps Team @carloum70
          last edited by Cyrille

          @carloum70 Disk migration isn't supported by the provider yet. What you can do it's only ignore the changes to the sr_id of a given disk.

          For example for the first disk:

            lifecycle {
              ignore_changes = [
                disk[0].sr_id
              ]
            }
          

          You can also manually do the migration in XO and then after edit your HCL to update the sr_id with the new ID. It should do the trick.

          1 Reply Last reply Reply Quote 1
          • C Offline
            carloum70
            last edited by

            This approach isn’t entirely foolproof since I can’t use a wildcard, and I don’t know how many disks will be attached to the VM. For now, it will never exceed two disks, so I can explicitly include both in the ignore_changes statement. That’s an acceptable solution for us. Thanks for your support.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post