vios_mapping_facts – Returns the VIOS mapping of physical, logical, and virtual devices as facts.

Synopsis

Returns the VIOS mapping of physical, logical, and virtual devices as facts.

Requirements

The below requirements are needed on the host that executes this module.

  • VIOS >= 2.2.5.0

  • Python >= 3.9

Parameters

hmc_host (True, str, None)

The IP Address or hostname of the HMC

hmc_auth (True, dict, None)

Username and Password credential of the HMC

username (True, str, None)

HMC username

password (True, str, None)

HMC password

system_name (optional, str, None)

The name or mtms (machine type model serial) of the managed system

vios_name (True, str, None)

The name of the Virtual I/O Server

component (optional, str, all)

Type of mapping to retrieve

vscsi to list virtual SCSI devices.

npiv to list NPIV devices.

net to list shared Ethernet adapters.

vnic to list server virtual NIC adapters.

ams to list paging space devices that are used in active memory sharing.

suspend to list suspended virtual adapters.

cluster to list shared storage pool mappings.

all to list all devices.

vadapter (optional, str, None)

Specifies the device name of a server virtual adapter.

Mutually exclusive with physloc

physloc (optional, str, None)

Specifies the device physical location code of a server virtual adapter.

Mutually exclusive with vadapter

cpid (optional, int, None)

Specifies the client partition ID, in decimal, for which to return device mapping information.

Use value 0 to display all mappings for the specified component.

Not applicable for net and ams components.

types (optional, list, None)

Specifies the type of devices to display

disk to list physical backing devices.

lv to list logical volume backing devices.

optical to list optical backing devices.

tape to list tape backed devices.

file to list file backed devices.

file_disk to list file backed disk devices.

file_opt to list file backed optical devices.

cl_disk to list clustered backing devices.

usb_disk to list USB disks.

Only applicable for vscsi and ams components

vtd (optional, str, None)

Specifies the active memory sharing (AMS) paging device to be displayed.

Only applicable for ams component

hostname (optional, str, None)

Specifies the host name or IP address of the VIOS partition.

Only applicable for cluster component

state (True, str, None)

facts gathers and returns information about mapping between physical, logical, and virtual devices

Notes

Note

  • This module requires the HMC login user to have specific permissions. To achieve this, the user should create a task role based on hmcsuperadmin with additional permissions, including ViosAdminOp, VirtualIOServerCommand and other permissions for managing lpar and cec resources. The following example demonstrates the same

  • Create a task role with above mentioned additional permissions using following command mkaccfg -t taskrole -i name=new_task_role,parent=hmcsuperadmin, resources=lpar:ActivateLPAR+CapturePartitionTemplate+ChangeLPARProperty+ ChangeNPortLogin+ChangeProfileProperty+CloseVTerm+Connect5250VTerm+ CreateProfile+Delete5250VTerm+DeleteLPAR+DeleteProfile+DisableEnableVirtualEthernet+ DlparOperation+HibernateLPAR+ListLPARProperty+ListProfileProperty+ManageLPARDebugData+ ManageLPARServEvents+ManageLicenseKeys+ManageProfile+MigrateLPAR+ Open5250VTerm+OpenVTerm+PartProfileCopy+RRStartLPAR+RebootLPAR+RemoteRestartLPAR+ ShutdownLPAR+VirtualIOServerCommand+ViosAdminOp, cec:ActivateSystemProfile+BackupProfileData+CECPowerOff+CECPowerOn+ CaptureSystemTemplate+ChangeCECPassword+ChangeCECProperty+ChangeCoD+ChangePowerManagement+ ChangeSnmpAlerts+ChangeSystemConnectionProperty+ChangeSystemProfileProperty+ ChangeTrustedSystemKey+ChangeVETCode+CoDPoolManagement+CollectCECVPDInfo+ ConfigProcessorRecovery+CreateLPAR+CreatePassThruCommand+CreateSystemProfile+ DLPARRestoreHWResources+DeleteSystemProfile+DeployPartitionTemplate+DeploySystemPlan+ DeploySystemTemplate+DeviceMaintenance+DisconnectOtherHmc+EditCECMTMS+ InitializeProfileData+InitializeSPFailover+LSProfileSpace+LaunchAsm+ ListCECProperty+ListCoDInformation+ListCoDNotifications+ListNPortLogin+ ListPCIeTopology+ListRioTopology+ListSSP+ListSnmpAlerts+ListSystemProfileProperty+ ListTrustedSystemKey+ListUtilizationData+ListVETInfo+MakeSystemPlan+ ManageCECServEvents+ManageCoDNotifications+ManageDumps+ ManageSPP+ManageSSP+ManageSriovAdapter+ManageSysProfile+ManageUtilizationData+ ManageVirtualNetwork+ManageVirtualStorage+MoveSriovAdapter+PartitionConfigurationImage+ RebuildCEC+RecoverPartitionData+RemoveCECConnection+RemoveCEConnection+RemoveProfileData+ RestoreProfileData+SetCECKeylockPosition+SysProfileCopy+UpdateLIC+ValidateSystemProfile+ ViewDumps+ViewPowerManagement+ViewSPP

  • Create a user with the above created task role.

Examples

- name: Populate the mapping facts with the mapping information for VSCSI
  vios_mapping_facts:
    hmc_host: <hmc_host>
    hmc_auth:
      username: <hmc_username>
      password: <hmc_password>
    system_name: <system_name>
    vios_name: <vios_name>
    component: vscsi
    state: facts

- name: Populate the mapping facts with the mapping information for NPIV device vfchost0
  vios_mapping_facts:
    hmc_host: <hmc_host>
    hmc_auth:
      username: <hmc_username>
      password: <hmc_password>
    system_name: <system_name>
    vios_name: <vios_name>
    vadapter: vfchost0
    component: npiv
    state: facts

- name: Populate the mapping facts with the mapping information for all devices
  vios_mapping_facts:
    hmc_host: <hmc_host>
    hmc_auth:
      username: <hmc_username>
      password: <hmc_password>
    system_name: <system_name>
    vios_name: <vios_name>
    component: all
    state: facts

- name: Populate the mapping facts with the mapping information for optical backing devices
  vios_mapping_facts:
    hmc_host: <hmc_host>
    hmc_auth:
      username: <hmc_username>
      password: <hmc_password>
    system_name: <system_name>
    vios_name: <vios_name>
    types: optical
    state: facts

Return Values

mapping_facts (on success for retrieving facts, dict, )

Respective configuration mapping information

Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]

  • This module is maintained by community.

Authors

  • Sreenidhi S(@SreenidhiS1)