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
vscsito list virtual SCSI devices.
npivto list NPIV devices.
netto list shared Ethernet adapters.
vnicto list server virtual NIC adapters.
amsto list paging space devices that are used in active memory sharing.
suspendto list suspended virtual adapters.
clusterto list shared storage pool mappings.
allto 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
netandamscomponents.- types (optional, list, None)
Specifies the type of devices to display
diskto list physical backing devices.
lvto list logical volume backing devices.
opticalto list optical backing devices.
tapeto list tape backed devices.
fileto list file backed devices.
file_diskto list file backed disk devices.
file_optto list file backed optical devices.
cl_diskto list clustered backing devices.
usb_diskto list USB disks.Only applicable for
vscsiandamscomponents- vtd (optional, str, None)
Specifies the active memory sharing (AMS) paging device to be displayed.
Only applicable for
amscomponent- hostname (optional, str, None)
Specifies the host name or IP address of the VIOS partition.
Only applicable for
clustercomponent- state (True, str, None)
factsgathers 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+ViewSPPCreate 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.