community.general.pmem (8.5.0) — module

Configure Intel Optane Persistent Memory modules

| "added in version" 4.5.0 of community.general"

Authors: Masayoshi Mizuma (@mizumm)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module allows Configuring Intel Optane Persistent Memory modules (PMem) using ipmctl and ndctl command line tools.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure the Pmem as AppDirect 10, Memory Mode 70, and the Reserved 20 percent.
  community.general.pmem:
    appdirect: 10
    memorymode: 70
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure the Pmem as AppDirect 10, Memory Mode 80, and the Reserved 10 percent.
  community.general.pmem:
    appdirect: 10
    memorymode: 80
    reserved: 10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure the Pmem as AppDirect with not interleaved 10, Memory Mode 70, and the Reserved 20 percent.
  community.general.pmem:
    appdirect: 10
    appdirect_interleaved: false
    memorymode: 70
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure the Pmem each socket.
  community.general.pmem:
    socket:
      - id: 0
        appdirect: 10
        appdirect_interleaved: false
        memorymode: 70
        reserved: 20
      - id: 1
        appdirect: 10
        memorymode: 80
        reserved: 10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure the two namespaces.
  community.general.pmem:
    namespace:
      - size: 1GB
        type: pmem
        mode: raw
      - size: 320MB
        type: pmem
        mode: sector

Inputs

    
socket:
    description:
    - This enables to set the configuration for each socket by using the socket ID.
    - Total of O(appdirect), O(memorymode) and O(reserved) must be V(100) within one socket.
    elements: dict
    suboptions:
      appdirect:
        description:
        - Percentage of the total capacity to use in AppDirect Mode (V(0)-V(100)) within
          the socket ID.
        required: true
        type: int
      appdirect_interleaved:
        default: true
        description:
        - Create AppDirect capacity that is interleaved any other PMem modules within
          the socket ID.
        required: false
        type: bool
      id:
        description: The socket ID of the PMem module.
        required: true
        type: int
      memorymode:
        description:
        - Percentage of the total capacity to use in Memory Mode (V(0)-V(100)) within
          the socket ID.
        required: true
        type: int
      reserved:
        description:
        - Percentage of the capacity to reserve (V(0)-V(100)) within the socket ID.
        type: int
    type: list

reserved:
    description:
    - Percentage of the capacity to reserve (V(0)-V(100)). O(reserved) will not be mapped
      into the system physical address space and will be presented as reserved capacity
      with Show Device and Show Memory Resources Commands.
    - O(reserved) will be set automatically if this is not configured.
    required: false
    type: int

appdirect:
    description:
    - Percentage of the total capacity to use in AppDirect Mode (V(0)-V(100)).
    - Create AppDirect capacity utilizing hardware interleaving across the requested PMem
      modules if applicable given the specified target.
    - Total of O(appdirect), O(memorymode) and O(reserved) must be V(100)
    type: int

namespace:
    description:
    - This enables to set the configuration for the namespace of the PMem.
    elements: dict
    suboptions:
      mode:
        choices:
        - raw
        - sector
        - fsdax
        - devdax
        description:
        - The mode of namespace. The detail of the mode is in the man page of ndctl-create-namespace.
        required: true
        type: str
      size:
        description:
        - The size of namespace. This option supports the suffixes V(k) or V(K) or V(KB)
          for KiB, V(m) or V(M) or V(MB) for MiB, V(g) or V(G) or V(GB) for GiB and V(t)
          or V(T) or V(TB) for TiB.
        - This option is required if multiple namespaces are configured.
        - If this option is not set, all of the available space of a region is configured.
        required: false
        type: str
      type:
        choices:
        - pmem
        - blk
        description:
        - The type of namespace. The detail of the type is in the man page of ndctl-create-namespace.
        required: false
        type: str
    type: list

memorymode:
    description:
    - Percentage of the total capacity to use in Memory Mode (V(0)-V(100)).
    type: int

namespace_append:
    default: false
    description:
    - Enable to append the new namespaces to the system.
    - The default is V(false) so the all existing namespaces not listed in O(namespace)
      are removed.
    required: false
    type: bool

appdirect_interleaved:
    default: true
    description:
    - Create AppDirect capacity that is interleaved any other PMem modules.
    required: false
    type: bool

Outputs

reboot_required:
  description: Indicates that the system reboot is required to complete the PMem configuration.
  returned: success
  sample: true
  type: bool
result:
  contains:
    appdirect:
      description: AppDirect size in bytes.
      type: int
    memorymode:
      description: Memory Mode size in bytes.
      type: int
    namespace:
      description: The list of the detail of namespace.
      type: list
    reserved:
      description: Reserved size in bytes.
      type: int
    socket:
      description: The socket ID to be configured.
      type: int
  description:
  - Shows the value of AppDirect, Memory Mode and Reserved size in bytes.
  - If O(socket) argument is provided, shows the values in each socket with C(socket)
    which contains the socket ID.
  - If O(namespace) argument is provided, shows the detail of each namespace.
  elements: dict
  returned: success
  sample:
  - appdirect: 111669149696
    memorymode: 970662608896
    reserved: 3626500096
    socket: 0
  - appdirect: 111669149696
    memorymode: 970662608896
    reserved: 3626500096
    socket: 1
  type: list