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

    Terraform Error jsonrpc2: code 10 message

    Scheduled Pinned Locked Moved Infrastructure as Code
    4 Posts 4 Posters 380 Views 4 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.
    • T Offline
      TITUS MAXIMUS
      last edited by TITUS MAXIMUS

      Error Message:

      │ Error: jsonrpc2: code 10 message: invalid parameters: {"errors":[{"instancePath":"/affinityHost","schemaPath":"#/properties/affinityHost/minLength","keyword":"minLength","params":{"limit":1},"message":"must NOT have fewer than 1 characters"}]}
      │
      │   with xenorchestra_vm.fun,
      │   on fun.tf line 9, in resource "xenorchestra_vm" "fun":
      │    9: resource "xenorchestra_vm" "fun" {
      

      Config:

      resource "xenorchestra_cloud_config" "cloud_config" {
        name = "cloud_config"
        # Template the cloudinit if needed
        template = templatefile("cloud_config.tftpl", {
          hostname = "fun"
        })
      }
      
      resource "xenorchestra_vm" "fun" {
        memory_max = 2147483648
        cpus = 2
        name_label = "fun"
        name_description = "fun"
        cloud_config = xenorchestra_cloud_config.cloud_config.template
        template = data.xenorchestra_template.vm_template.id
        wait_for_ip = true
        auto_poweron = true
      
      network {
          network_id = data.xenorchestra_network.net.id
        }
      
      disk {
          sr_id = data.xenorchestra_sr.sr.id
          name_label = "VM root volume"
          size = 10737418240
        }
      
      timeouts {
          create = "20m"
        }
      
      }
      

      What am I missing?

      EDIT:
      forgot to add the version of everything
      xo-server 5.111.1
      xo-web 5.114.0
      Terraform Provider version 24.1

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

        Hi,

        Since I suppose you are using XO from the sources, please provide your commit number 🙂 (see https://xen-orchestra.com/docs/community.html#report-a-bug)

        Maybe it's Terraform related, let me add ddelnano in the loop

        1 Reply Last reply Reply Quote 0
        • M Offline
          mlustosa @TITUS MAXIMUS
          last edited by

          TITUS MAXIMUS https://github.com/terra-farm/terraform-provider-xenorchestra/issues/243

          killroy1971 created this issue in terra-farm/terraform-provider-xenorchestra

          closed Can't create VM without specifying an affinity_host - issue with an empty string #243

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            ddelnano Terraform Team @mlustosa
            last edited by

            mlustosa apologies for the slow response on that issue. I'm hoping to around to addressing that within the next week or so and thanks for posting the workaround on the related issue.

            1 Reply Last reply Reply Quote 1
            • olivierlambertO olivierlambert moved this topic from Xen Orchestra on
            • First post
              Last post