zhmc_storage_group_attachment – Attach storage groups to partitions
Synopsis
Gather facts about the attachment of a storage group to a partition of a CPC (Z system).
Attach and detach a storage group to and from a partition.
Parameters
- hmc_host
The hostname or IP address of the HMC.
required: Truetype: str- hmc_auth
The authentication credentials for the HMC, as a dictionary of
userid
,password
.required: Truetype: dict- userid
The userid (username) for authenticating with the HMC.
required: Truetype: str- password
The password for authenticating with the HMC.
required: Truetype: str
- cpc_name
The name of the CPC that has the partition and is associated with the storage group.
required: Truetype: str- storage_group_name
The name of the storage group for the attachment.
required: Truetype: str- partition_name
The name of the partition for the attachment.
required: Truetype: str- state
The desired state for the attachment:
detached
: Ensures that the storage group is not attached to the partition. If the storage group is currently attached to the partition and the partition is currently active, the module will fail.attached
: Ensures that the storage group is attached to the partition.facts
: Does not change anything on the attachment and returns the attachment status.
required: Truetype: strchoices: detached, attached, facts- log_file
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.
required: Falsetype: str
Examples
---
# Note: The following examples assume that some variables named 'my_*' are set.
- name: Gather facts about the attachment
zhmc_storage_group_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
storage_group_name: "{{ my_storage_group_name }}"
partition_name: "{{ my_partition_name }}"
state: facts
register: sga1
- name: Ensure the storage group is attached to the partition
zhmc_storage_group_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
storage_group_name: "{{ my_storage_group_name }}"
partition_name: "{{ my_partition_name }}"
state: attached
- name: "Ensure the storage group is not attached to the partition."
zhmc_storage_group_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
storage_group_name: "{{ my_storage_group_name }}"
partition_name: "{{ my_partition_name }}"
state: detached
Notes
Note
This module manages only the knowledge of the Z system about its storage, but does not perform any actions against the storage subsystems or SAN switches attached to the Z system.
Return Values
- changed
Indicates if any change has been made by the module. For
state=facts
, always will be false.returned: alwaystype: bool- msg
An error message that describes the failure.
returned: failuretype: str- storage_group_attachment
Attachment state of the storage group. If no check mode was requested, the attachment state after any changes is returned. If check mode was requested, the actual attachment state is returned.
returned: successtype: dictsample:{ "attached": false }
- attached
Attachment state of the storage group: Indicates whether the storage group is attached to the partition.
type: bool