Giter VIP home page Giter VIP logo

Comments (4)

bpg avatar bpg commented on August 9, 2024

Hi @sergelogvinov! 👋🏼

I think having numa inside the cpu block makes more sense.

We may also need to add interface attribute e.g. interface = "numa1", to identify numa blocks and simplify mapping to the API without relying on ordering of the blocks.

Just putting it here for reference:

 numa: <boolean> (default = 0)

    Enable/disable NUMA.
numa[n]: cpus=<id[-id];...> [,hostnodes=<id[-id];...>] [,memory=<number>] [,policy=<preferred|bind|interleave>]

    NUMA topology.

    cpus=<id[-id];...>

        CPUs accessing this NUMA node.
    hostnodes=<id[-id];...>

        Host NUMA nodes to use.
    memory=<number>

        Amount of memory this NUMA node provides.
    policy=<bind | interleave | preferred>

        NUMA allocation policy.

from terraform-provider-proxmox.

sergelogvinov avatar sergelogvinov commented on August 9, 2024

Yep, and inside memory block looks like good place too.

I am little bit confused now )

from terraform-provider-proxmox.

sergelogvinov avatar sergelogvinov commented on August 9, 2024

What about node value as numa node index, and we have a key conflict...

resource "proxmox_virtual_environment_vm" "example" {
  cpu {
    cores = 8
    limit = 64

    affinity = "0-3,16-19"

    numa = true
    numa {
      node      = 0
      cpus      = "0-3"
      hostnodes = "0"
      memory    = 128
      policy    = bind
    }
    numa {
      node      = 1
      cpus      = "16-19"
      hostnodes = "1"
      memory    = 128
      policy    = bind
    }
  }
  memory {
    dedicated = 256
  }
}

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

Yep, and inside memory block looks like good place too.

I think NUMA is more related to CPU than memory, it depends on number of cores configured on the VM, etc.

What about node value as numa node index, and we have a key conflict...

node cold be confusing, as there is also hostnode which may or may not match the node.
I believe hostnode is what actually shown as "node" in numactl --hardware hardware output.
Also hostnode could have a range or a list as per doc (<id[-id];...)

It feels like some form of stable ID is needed one way or another, as people may inserting numa {...} blocks between other numa blocks messing up definitions on the PVE side.

So I have something like this in mind:

resource "proxmox_virtual_environment_vm" "example" {
  cpu {
    cores = 8
    limit = 64

    affinity = "0-3,16-19"

    numa = true
    numa {
      interface = "numa0"
      cpus      = "0-3"
      hostnodes = "0;2"
      memory    = 128
      policy    = "bind"
    }
    numa {
      interface = "numa1"
      cpus      = "16-19"
      hostnodes = "1;3"
      memory    = 128
      policy    = bind
    }
  }
  memory {
    dedicated = 256
  }
}

What do you think?

from terraform-provider-proxmox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.