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

    CPU topology (sockets/cores) for new VMs deployed via Terraform

    Scheduled Pinned Locked Moved Infrastructure as Code
    4 Posts 3 Posters 66 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
      tmk
      last edited by

      Does anyone know if there is a way to specify the cpu topology (the number of sockets and cores per socket) of a new VM when using Terraform for cloning from a VM template? From what I can tell the vatesfr/xenorchestra Terraform provider doesn't allow us to specify anything other than the total number of cpus.

      The issue that I ran into is when deploying new VMs, they will inherit the number of cores per socket from the template and increase the number of sockets to match the number of cpus specified. This has caused some weird performance issues in the underlying guest OSes where they see a large number of sockets and a small number of cores per socket. I suspect this has something to do with NUMA and CPU scheduling in the guest but not 100% sure. Either way, reducing the sockets and increasing the cores fixed the performance issues.

      As a work-around I tried setting the cpu topology for the template to be 1 socket and the actual number of cores for a single socket that exist on the host (in my case it was 28 cores). This got me closer as the new VM that was deployed from template had only 1 socket and the correct number of VCPUs-at-startup specified but the cpu topology of the new VM still showed 1 socket, 28 cores per socket and 8/28 for CPU limits. This seems to indicate that CPU hotadd was enabled with the VCPUs-max set to 28 for the VM.

      I guess my question around this would be does anyone know if there are any performance penalties for configuring different VCPUs-at-startup and VCPUs-max values? I know enabling CPU hotadd in VMWare incurres up to a 10% performance penalty. I also found in this scenario that if I tried to deploy a vm from that same template with more than 28 cores it would fail with the error: Not a divisor of the VMs max CPUs.

      It would be nice to just to specify a cpu topology for a new vm during deployment. This issue has turned what was a completely automated deployment into one that now requires manual intervention for each VM that's being deployed.

      If there is no other answer does anyone know the best place to submit feature requests for the Xen Orchestra terraform provider?

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

        Question for @Team-DevOps

        1 Reply Last reply Reply Quote 0
        • nathanael-hN Offline
          nathanael-h Vates 🪐 DevOps Team
          last edited by

          Hello @tmk, I will consider your post as a perfect feature request for the XO Terraform provider. I think that we also want to add support for CPU core/socket config.

          T 1 Reply Last reply Reply Quote 2
          • T Offline
            tmk @nathanael-h
            last edited by

            Sounds good thanks!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post