.. _zhmc_partition: zhmc_partition - Manages partitions +++++++++++++++++++++++++++++++++++ .. contents:: :local: :depth: 2 Synopsis -------- * Gathers facts about a partition, including its child resources (HBAs, NICs and virtual functions). * Creates, updates, deletes, starts, and stops partitions in a CPC. The child resources of the partition are are managed by separate Ansible modules. * The targeted CPC must be in the Dynamic Partition Manager (DPM) operational mode. Requirements (on host that executes module) ------------------------------------------- * Network access to HMC * zhmcclient >=0.14.0 * ansible >=2.2.0.0 Options ------- .. raw:: html
parameter | required | default | choices | comments | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cpc_name |
yes |
The name of the CPC with the target partition.
|
|||||||||||||||||
faked_session |
no | Real HMC will be used. |
A
zhmcclient_mock.FakedSession object that has a mocked HMC set up. If provided, it will be used instead of connecting to a real HMC. This is used for testing purposes only. |
||||||||||||||||
hmc_auth |
yes |
The authentication credentials for the HMC.
| |||||||||||||||||
|
|||||||||||||||||||
hmc_host |
yes |
The hostname or IP address of the HMC.
|
|||||||||||||||||
log_file |
no |
File path of a log file to which the logic flow of this module as well as interactions with the HMC are logged. If null, logging will be propagated to the Python root logger.
|
|||||||||||||||||
name |
yes |
The name of the target partition.
|
|||||||||||||||||
properties |
no | No input properties |
Dictionary with input properties for the partition, for
state=stopped and state=active . Key is the property name with underscores instead of hyphens, and value is the property value in YAML syntax. Integer properties may also be provided as decimal strings. Will be ignored for state=absent .The possible input properties in this dictionary are the properties defined as writeable in the data model for Partition resources (where the property names contain underscores instead of hyphens), with the following exceptions:
*
name : Cannot be specified because the name has already been specified in the name module parameter.*
type : Cannot be changed once the partition exists, because updating it is not supported.*
boot_storage_device : Cannot be specified because this information is specified using the artificial property boot_storage_hba_name .*
boot_network_device : Cannot be specified because this information is specified using the artificial property boot_network_nic_name .*
boot_storage_hba_name : The name of the HBA whose URI is used to construct boot_storage_device . Specifying it requires that the partition exists.*
boot_network_nic_name : The name of the NIC whose URI is used to construct boot_network_device . Specifying it requires that the partition exists.*
crypto_configuration : The crypto configuration for the partition, in the format of the crypto-configuration property of the partition (see HMC API book for details), with the exception that adapters are specified with their names in field crypto_adapter_names instead of their URIs in field crypto_adapter_uris . If the crypto_adapter_names field is null, all crypto adapters of the CPC will be used.Properties omitted in this dictionary will remain unchanged when the partition already exists, and will get the default value defined in the data model for partitions in the HMC API book when the partition is being created.
|
||||||||||||||||
state |
yes |
|
The desired state for the target partition:
absent : Ensures that the partition does not exist in the specified CPC.stopped : Ensures that the partition exists in the specified CPC, has the specified properties, and is in the 'stopped' status.active : Ensures that the partition exists in the specified CPC, has the specified properties, and is in the 'active' or 'degraded' status.facts : Does not change anything on the partition and returns the partition properties and the properties of its child resources (HBAs, NICs, and virtual functions). |
name | description | returned | type | sample |
---|---|---|---|---|
partition |
For
state=absent , an empty dictionary.For
state=stopped and state=active , a dictionary with the resource properties of the partition (after changes, if any). The dictionary keys are the exact property names as described in the data model for the resource, i.e. they contain hyphens (-), not underscores (_). The dictionary values are the property values using the Python representations described in the documentation of the zhmcclient Python package.For
state=facts , a dictionary with the resource properties of the partition, including its child resources (HBAs, NICs, and virtual functions). The dictionary keys are the exact property names as described in the data model for the resource, i.e. they contain hyphens (-), not underscores (_). The dictionary values are the property values using the Python representations described in the documentation of the zhmcclient Python package. The properties of the child resources are represented in partition properties named 'hbas', 'nics', and 'virtual-functions', respectively. |
success | dict | {
"name": "part-1",
"description": "partition #1",
"status": "active",
"boot-device": "storage-adapter",
...
}
|