| 1 |
.. _host_module: |
| 2 |
|
| 3 |
|
| 4 |
host -- Manage Host operations on Unity |
| 5 |
======================================= |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
The Host module contains the operations Creation of a Host, Addition of initiators to Host, Removal of initiators from Host, Modification of host attributes, Get details of a Host, Deletion of a Host, Addition of network address to Host, Removal of network address from Host. |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
Requirements |
| 20 |
------------ |
| 21 |
The below requirements are needed on the host that executes this module. |
| 22 |
|
| 23 |
- A Dell Unity Storage device version 5.1 or later. |
| 24 |
- Ansible-core 2.17 or later. |
| 25 |
- Python 3.11, or 3.12. |
| 26 |
- Storops Python SDK 1.2.12. |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
Parameters |
| 31 |
---------- |
| 32 |
|
| 33 |
host_name (optional, str, None) |
| 34 |
Name of the host. |
| 35 |
|
| 36 |
Mandatory for host creation. |
| 37 |
|
| 38 |
|
| 39 |
host_id (optional, str, None) |
| 40 |
Unique identifier of the host. |
| 41 |
|
| 42 |
Host Id is auto generated during creation. |
| 43 |
|
| 44 |
Except create, all other operations require either *host_id* or Ihost_name). |
| 45 |
|
| 46 |
|
| 47 |
description (optional, str, None) |
| 48 |
Host description. |
| 49 |
|
| 50 |
|
| 51 |
host_os (optional, str, None) |
| 52 |
Operating system running on the host. |
| 53 |
|
| 54 |
|
| 55 |
new_host_name (optional, str, None) |
| 56 |
New name for the host. |
| 57 |
|
| 58 |
Only required in rename host operation. |
| 59 |
|
| 60 |
|
| 61 |
initiators (optional, list, None) |
| 62 |
List of initiators to be added/removed to/from host. |
| 63 |
|
| 64 |
|
| 65 |
initiator_state (optional, str, None) |
| 66 |
State of the initiator. |
| 67 |
|
| 68 |
|
| 69 |
network_address (optional, str, None) |
| 70 |
Network address to be added/removed to/from the host. |
| 71 |
|
| 72 |
Enter valid IPV4 or host name. |
| 73 |
|
| 74 |
|
| 75 |
network_address_state (optional, str, None) |
| 76 |
State of the Network address. |
| 77 |
|
| 78 |
|
| 79 |
state (True, str, None) |
| 80 |
State of the host. |
| 81 |
|
| 82 |
|
| 83 |
unispherehost (True, str, None) |
| 84 |
IP or FQDN of the Unity management server. |
| 85 |
|
| 86 |
|
| 87 |
username (True, str, None) |
| 88 |
The username of the Unity management server. |
| 89 |
|
| 90 |
|
| 91 |
password (True, str, None) |
| 92 |
The password of the Unity management server. |
| 93 |
|
| 94 |
|
| 95 |
validate_certs (optional, bool, True) |
| 96 |
Boolean variable to specify whether or not to validate SSL certificate. |
| 97 |
|
| 98 |
``true`` - Indicates that the SSL certificate should be verified. |
| 99 |
|
| 100 |
``false`` - Indicates that the SSL certificate should not be verified. |
| 101 |
|
| 102 |
|
| 103 |
port (optional, int, 443) |
| 104 |
Port number through which communication happens with Unity management server. |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
Notes |
| 111 |
----- |
| 112 |
|
| 113 |
.. note:: |
| 114 |
- The *check_mode* is not supported. |
| 115 |
- The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform. |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
Examples |
| 121 |
-------- |
| 122 |
|
| 123 |
.. code-block:: yaml+jinja |
| 124 |
|
| 125 |
|
| 126 |
- name: Create empty Host |
| 127 |
host: |
| 128 |
unispherehost: "{{unispherehost}}" |
| 129 |
username: "{{username}}" |
| 130 |
password: "{{password}}" |
| 131 |
validate_certs: "{{validate_certs}}" |
| 132 |
host_name: "ansible-test-host" |
| 133 |
host_os: "Linux" |
| 134 |
description: "ansible-test-host" |
| 135 |
state: "present" |
| 136 |
|
| 137 |
- name: Create Host with Initiators |
| 138 |
host: |
| 139 |
unispherehost: "{{unispherehost}}" |
| 140 |
username: "{{username}}" |
| 141 |
password: "{{password}}" |
| 142 |
validate_certs: "{{validate_certs}}" |
| 143 |
host_name: "ansible-test-host-1" |
| 144 |
host_os: "Linux" |
| 145 |
description: "ansible-test-host-1" |
| 146 |
initiators: |
| 147 |
- "iqn.1994-05.com.redhat:c38e6e8cfd81" |
| 148 |
- "20:00:00:90:FA:13:81:8D:10:00:00:90:FA:13:81:8D" |
| 149 |
initiator_state: "present-in-host" |
| 150 |
state: "present" |
| 151 |
|
| 152 |
- name: Modify Host using host_id |
| 153 |
host: |
| 154 |
unispherehost: "{{unispherehost}}" |
| 155 |
username: "{{username}}" |
| 156 |
password: "{{password}}" |
| 157 |
validate_certs: "{{validate_certs}}" |
| 158 |
host_id: "Host_253" |
| 159 |
new_host_name: "ansible-test-host-2" |
| 160 |
host_os: "Mac OS" |
| 161 |
description: "Ansible tesing purpose" |
| 162 |
state: "present" |
| 163 |
|
| 164 |
- name: Add Initiators to Host |
| 165 |
host: |
| 166 |
unispherehost: "{{unispherehost}}" |
| 167 |
username: "{{username}}" |
| 168 |
password: "{{password}}" |
| 169 |
validate_certs: "{{validate_certs}}" |
| 170 |
host_name: "ansible-test-host-2" |
| 171 |
initiators: |
| 172 |
- "20:00:00:90:FA:13:81:8C:10:00:00:90:FA:13:81:8C" |
| 173 |
initiator_state: "present-in-host" |
| 174 |
state: "present" |
| 175 |
|
| 176 |
- name: Get Host details using host_name |
| 177 |
host: |
| 178 |
unispherehost: "{{unispherehost}}" |
| 179 |
username: "{{username}}" |
| 180 |
password: "{{password}}" |
| 181 |
validate_certs: "{{validate_certs}}" |
| 182 |
host_name: "ansible-test-host-2" |
| 183 |
state: "present" |
| 184 |
|
| 185 |
- name: Get Host details using host_id |
| 186 |
host: |
| 187 |
unispherehost: "{{unispherehost}}" |
| 188 |
username: "{{username}}" |
| 189 |
password: "{{password}}" |
| 190 |
validate_certs: "{{validate_certs}}" |
| 191 |
host_id: "Host_253" |
| 192 |
state: "present" |
| 193 |
|
| 194 |
- name: Delete Host |
| 195 |
host: |
| 196 |
unispherehost: "{{unispherehost}}" |
| 197 |
username: "{{username}}" |
| 198 |
password: "{{password}}" |
| 199 |
validate_certs: "{{validate_certs}}" |
| 200 |
host_name: "ansible-test-host-2" |
| 201 |
state: "absent" |
| 202 |
|
| 203 |
- name: Add network address to Host |
| 204 |
host: |
| 205 |
unispherehost: "{{unispherehost}}" |
| 206 |
username: "{{username}}" |
| 207 |
password: "{{password}}" |
| 208 |
validate_certs: "{{validate_certs}}" |
| 209 |
host_name: "{{host_name}}" |
| 210 |
network_address: "192.168.1.2" |
| 211 |
network_address_state: "present-in-host" |
| 212 |
state: "present" |
| 213 |
|
| 214 |
- name: Delete network address from Host |
| 215 |
host: |
| 216 |
unispherehost: "{{unispherehost}}" |
| 217 |
username: "{{username}}" |
| 218 |
password: "{{password}}" |
| 219 |
validate_certs: "{{validate_certs}}" |
| 220 |
host_name: "{{host_name}}" |
| 221 |
network_address: "192.168.1.2" |
| 222 |
network_address_state: "absent-in-host" |
| 223 |
state: "present" |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
Return Values |
| 228 |
------------- |
| 229 |
|
| 230 |
changed (always, bool, True) |
| 231 |
Whether or not the resource has changed. |
| 232 |
|
| 233 |
|
| 234 |
host_details (When host exists., dict, {'auto_manage_type': 'HostManageEnum.UNKNOWN', 'datastores': None, 'description': 'ansible-test-host-1', 'existed': True, 'fc_host_initiators': [{'id': 'HostInitiator_1', 'name': 'HostName_1', 'paths': [{'id': 'HostInitiator_1_Id1', 'is_logged_in': True}, {'id': 'HostInitiator_1_Id2', 'is_logged_in': True}]}], 'hash': 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER', 'health': {'UnityHealth': {'hash': 8764429420954}}, 'host_container': None, 'host_luns': [], 'host_polled_uuid': None, 'host_pushed_uuid': None, 'host_uuid': None, 'host_v_vol_datastore': None, 'id': 'Host_2198', 'iscsi_host_initiators': [{'id': 'HostInitiator_2', 'name': 'HostName_2', 'paths': [{'id': 'HostInitiator_2_Id1', 'is_logged_in': True}, {'id': 'HostInitiator_2_Id2', 'is_logged_in': True}]}], 'last_poll_time': None, 'name': 'ansible-test-host-1', 'network_addresses': [], 'os_type': 'Linux', 'registration_type': None, 'storage_resources': None, 'tenant': None, 'type': 'HostTypeEnum.HOST_MANUAL', 'vms': None}) |
| 235 |
Details of the host. |
| 236 |
|
| 237 |
|
| 238 |
id (, str, ) |
| 239 |
The system ID given to the host. |
| 240 |
|
| 241 |
|
| 242 |
name (, str, ) |
| 243 |
The name of the host. |
| 244 |
|
| 245 |
|
| 246 |
description (, str, ) |
| 247 |
Description about the host. |
| 248 |
|
| 249 |
|
| 250 |
fc_host_initiators (, list, ) |
| 251 |
Details of the FC initiators associated with the host. |
| 252 |
|
| 253 |
|
| 254 |
id (, str, ) |
| 255 |
Unique identifier of the FC initiator path. |
| 256 |
|
| 257 |
|
| 258 |
name (, str, ) |
| 259 |
FC Qualified Name (WWN) of the initiator. |
| 260 |
|
| 261 |
|
| 262 |
paths (, list, ) |
| 263 |
Details of the paths associated with the FC initiator. |
| 264 |
|
| 265 |
|
| 266 |
id (, str, ) |
| 267 |
Unique identifier of the path. |
| 268 |
|
| 269 |
|
| 270 |
is_logged_in (, bool, ) |
| 271 |
Indicates whether the host initiator is logged into the storage system. |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
iscsi_host_initiators (, list, ) |
| 277 |
Details of the ISCSI initiators associated with the host. |
| 278 |
|
| 279 |
|
| 280 |
id (, str, ) |
| 281 |
Unique identifier of the ISCSI initiator path. |
| 282 |
|
| 283 |
|
| 284 |
name (, str, ) |
| 285 |
ISCSI Qualified Name (IQN) of the initiator. |
| 286 |
|
| 287 |
|
| 288 |
paths (, list, ) |
| 289 |
Details of the paths associated with the ISCSI initiator. |
| 290 |
|
| 291 |
|
| 292 |
id (, str, ) |
| 293 |
Unique identifier of the path. |
| 294 |
|
| 295 |
|
| 296 |
is_logged_in (, bool, ) |
| 297 |
Indicates whether the host initiator is logged into the storage system. |
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
network_addresses (, list, ) |
| 303 |
List of network addresses mapped to the host. |
| 304 |
|
| 305 |
|
| 306 |
os_type (, str, ) |
| 307 |
Operating system running on the host. |
| 308 |
|
| 309 |
|
| 310 |
type (, str, ) |
| 311 |
HostTypeEnum of the host. |
| 312 |
|
| 313 |
|
| 314 |
host_luns (, list, ) |
| 315 |
Details of luns attached to host. |
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
Status |
| 323 |
------ |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
Authors |
| 330 |
~~~~~~~ |
| 331 |
|
| 332 |
- Rajshree Khare (@kharer5) <[email protected]> |
| 333 |
|