Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
===============================
Dellemc.PowerFlex Change Logs
===============================
.. contents:: Topics
v1.5.0
======
Minor Changes
-------------
- Info module is enhanced to support the listing replication consistency groups.
- Renamed gateway_host to hostname
- Renamed verifycert to validate_certs.
- Updated modules to adhere with ansible community guidelines.
New Modules
-----------
- dellemc.powerflex.replication_consistency_group - Manage replication consistency groups on Dell PowerFlex
v1.4.0
======
Minor Changes
-------------
- Added support for 4.0.x release of PowerFlex OS.
- Info module is enhanced to support the listing volumes and storage pools with statistics data.
- Storage pool module is enhanced to get the details with statistics data.
- Volume module is enhanced to get the details with statistics data.
v1.3.0
======
Minor Changes
-------------
- Added execution environment manifest file to support building an execution environment with ansible-builder.
- Enabled the check_mode support for info module
New Modules
-----------
- dellemc.powerflex.mdm_cluster - Manage MDM cluster on Dell PowerFlex
v1.2.0
======
Minor Changes
-------------
- Names of previously released modules have been changed from dellemc_powerflex_\<module name> to \<module name>.
New Modules
-----------
- dellemc.powerflex.protection_domain - Manage Protection Domain on Dell PowerFlex
v1.1.1
======
Deprecated Features
-------------------
- The dellemc_powerflex_gatherfacts module is deprecated and replaced with dellemc_powerflex_info
v1.1.0
======
Minor Changes
-------------
- Added dual licensing.
- Gatherfacts module is enhanced to list devices.
New Modules
-----------
- dellemc.powerflex.device - Manage device on Dell PowerFlex
- dellemc.powerflex.sds - Manage SDS on Dell PowerFlex
v1.0.0
======
New Modules
-----------
- dellemc.powerflex.info - Gathering information about Dell PowerFlex
- dellemc.powerflex.sdc - Manage SDCs on Dell PowerFlex
- dellemc.powerflex.snapshot - Manage Snapshots on Dell PowerFlex
- dellemc.powerflex.storagepool - Managing Dell PowerFlex storage pool
- dellemc.powerflex.volume - Manage volumes on Dell PowerFlex

View File

@@ -0,0 +1,530 @@
{
"files": [
{
"name": ".",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "requirements.yml",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "796d9d259e4da6c8655b665586ffaf095d1a5a45b18c768b5ba748385910cf8e",
"format": 1
},
{
"name": "LICENSE",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "8b1ba204bb69a0ade2bfcf65ef294a920f6bb361b317dba43c7ef29d96332b9b",
"format": 1
},
{
"name": "meta",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "meta/runtime.yml",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "3593e8970a00d95a557377bd7af2f50e5212620def3ed4134c989a33dfd8ec4f",
"format": 1
},
{
"name": "meta/execution-environment.yml",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "6275c6cd307d5afbdf72bd71abcffea19e755fd452f37be43d7036dc1ed4d5a4",
"format": 1
},
{
"name": "MODULE-LICENSE",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
"format": 1
},
{
"name": "CHANGELOG.rst",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "33b23a8f0c817a8e2648e255269cb51dc3882c613cc9e94c1c605d885a163f4c",
"format": 1
},
{
"name": "plugins",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "plugins/doc_fragments",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "plugins/doc_fragments/powerflex.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "042fd3430b1ecc1ce01ce3efafa2f2d0fca1d814b891a756f686b5b543eb3bef",
"format": 1
},
{
"name": "plugins/module_utils",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "plugins/module_utils/storage",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "plugins/module_utils/storage/dell",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "plugins/module_utils/storage/dell/logging_handler.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "fdd1b7ef81bde300864051fe060d5f393c074201279e3f739584a5c2c44153a2",
"format": 1
},
{
"name": "plugins/module_utils/storage/dell/__init__.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"format": 1
},
{
"name": "plugins/module_utils/storage/dell/utils.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "87e9c4d3570ace6a236080e285e3b3c12b4e5c763064334b861ddb38ea37b264",
"format": 1
},
{
"name": "plugins/modules",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "plugins/modules/sdc.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "b8104d04864a2270a5ceb5cf7e66f681125dec8510faf60d0054f4ae0e8739c2",
"format": 1
},
{
"name": "plugins/modules/protection_domain.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "53142b5ab071e1b841af1857e0408df1d2d29b9e5a261a04b0acf1e84a3eb851",
"format": 1
},
{
"name": "plugins/modules/mdm_cluster.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "3bd51cc09a4f91e05d96d696600149275ffb2c1904b3ecdaf794212da1bb90a5",
"format": 1
},
{
"name": "plugins/modules/snapshot.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "3f653d2f3c1f0dc8a2d496cab89e240fe7a77e7d3d5e7f88a47f718ae0dbc07c",
"format": 1
},
{
"name": "plugins/modules/info.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "4d8525b1e2b4a5ef671b93082d329193331181b4a85c37a0e8e5b172d8c9734c",
"format": 1
},
{
"name": "plugins/modules/replication_consistency_group.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "e187923e495ab03d4f52f5001a450aed291500f0f9a8d5b03645bec0907131a6",
"format": 1
},
{
"name": "plugins/modules/sds.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "dc02c40e9b6d49c9df942e275de073a4854cfb6e0b27f2a876583e3d094b7803",
"format": 1
},
{
"name": "plugins/modules/storagepool.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "7f9c9179a1cfe50510946135ee8ff0eb7b9b027e4f7d7afa53cc20e35f6a1b5d",
"format": 1
},
{
"name": "plugins/modules/device.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "9531ecfeaa468b126d90e0932723d12d434dd604a089de4770b0b2dfcd5b9253",
"format": 1
},
{
"name": "plugins/modules/volume.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "4c8e0677e4071d2288a6b13969279e10873e41410eaabf80c344f56206dcedb9",
"format": 1
},
{
"name": "tests",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "tests/sanity",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "tests/sanity/ignore-2.12.txt",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "f1ef9cddda5a94dce31f5e8f4719e3e963adec5c2295f8f0c584faddcc0bf110",
"format": 1
},
{
"name": "tests/sanity/ignore-2.14.txt",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "f1ef9cddda5a94dce31f5e8f4719e3e963adec5c2295f8f0c584faddcc0bf110",
"format": 1
},
{
"name": "tests/sanity/ignore-2.13.txt",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "f1ef9cddda5a94dce31f5e8f4719e3e963adec5c2295f8f0c584faddcc0bf110",
"format": 1
},
{
"name": "tests/requirements.txt",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "65e6091d1c8d88a703555bd13590bb95248fb0b7376d3ed1d660e2b9d65581c8",
"format": 1
},
{
"name": "tests/unit",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "tests/unit/plugins",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "tests/unit/plugins/__init__.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_volume_api.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "5e61698f03d1a7ec229c5ffb6a4def656e806e5dd234a0e15b2136fba839a2d7",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_mdm_cluster_api.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "a319347b17bfd7eca567a2a259313809b2ef3e3a33e545cc2b2a4b5187d27ee4",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_replication_consistency_group_api.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "5bf628a051d160856652bda22e45d35303db612874edc75ed4e2e8b4a270fba3",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_api_exception.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "6a9639349df9561e15df73ad72a28fb0120121b9ef2f8f72e6a7ef8c01c1edeb",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_info_api.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "1c47b5eeb60987f156d5891f514ec891099e39e42b42fb7e9ec3f91125491ed1",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_sdk_response.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "82b029313ed53922594cdabcf9129708a5a1ee8b4b00382994ed054e58637b89",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_protection_domain_api.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "1005c8842b81ff4c5613992e5f80fb25cfa6ac36d1a9274e574caf04d7510584",
"format": 1
},
{
"name": "tests/unit/plugins/module_utils/mock_storagepool_api.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "f2552190a68b46919f44632fe65972825624ab201e330771e1992e57de253d27",
"format": 1
},
{
"name": "tests/unit/plugins/modules",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "tests/unit/plugins/modules/test_storagepool.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "4f78779e6b346b612915d92323ca0d1850e68da65b95f32205cc585b622b48be",
"format": 1
},
{
"name": "tests/unit/plugins/modules/test_volume.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "4742f5675d613a39bd5929b24e6f515d034bebf8defc1c98bb8fe69444785015",
"format": 1
},
{
"name": "tests/unit/plugins/modules/__init__.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"format": 1
},
{
"name": "tests/unit/plugins/modules/test_info.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "66d4d0adaaa1197363ffe1f25e4c5f7def1b6996fdcf5678af40528c5652a64b",
"format": 1
},
{
"name": "tests/unit/plugins/modules/test_replication_consistency_group.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "7071e60cf4c57f36a59be9249964ceb9ef6ed0b8b6dca8a86a62515dbea087d3",
"format": 1
},
{
"name": "tests/unit/plugins/modules/test_mdm_cluster.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "4a242b57ed85421cb8823e0814484d077407f00c761e23169542ac34cc9aa0d3",
"format": 1
},
{
"name": "tests/unit/plugins/modules/test_protection_domain.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "8d2d1e320a857f994db4e48ce5406ca5bbfe21cd7c37d9f8d3bb1e07db8d333e",
"format": 1
},
{
"name": "tests/unit/__init__.py",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"format": 1
},
{
"name": "requirements.txt",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "b02f408522b5f335ac6c1ef0d7ee5dd72a0a24492de516545ac4071d315882db",
"format": 1
},
{
"name": "README.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "98ddfc70b930fb944fb944d6e981fd33da656495bca6b5f56562144546149252",
"format": 1
},
{
"name": "changelogs",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "changelogs/.plugin-cache.yaml",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "2969cb15eb1ae0ca0f5033d427a1ff70fe84bcf1a655c1e51059d8d03f34ebb3",
"format": 1
},
{
"name": "changelogs/config.yaml",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "c7ab69438be06910388bd76d2cc4cc60b31bf5b501513435673879d5df230a0a",
"format": 1
},
{
"name": "changelogs/changelog.yaml",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "f0fb1c23651bf566498150c8eda7e9baa2aa6f7e8436bfe6928dfc202b3e1817",
"format": 1
},
{
"name": "docs",
"ftype": "dir",
"chksum_type": null,
"chksum_sha256": null,
"format": 1
},
{
"name": "docs/Product Guide.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "26906ca9341bd49c5ed3d7c8c633d570d7f92f91c5b595460e47003cc6a7fc89",
"format": 1
},
{
"name": "docs/CODE_OF_CONDUCT.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "10e328fb91562dc4e0b6c5da59f213295b4f25af28a53235612698e4a8465acc",
"format": 1
},
{
"name": "docs/ISSUE_TRIAGE.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "530744bbed97aad7ce03e7d367ab53882a53a69b2307f7a1ded46f19a6d410ab",
"format": 1
},
{
"name": "docs/SUPPORT.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "c5ff5c4c06bcd6e7432653d13fab3fbf230685ae0337f6ecabec6f38aacb0ef7",
"format": 1
},
{
"name": "docs/Release Notes.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "c83ab7f6bcbfe80040e285730b0309ce9457839880babfd1d14de8dd4bb73650",
"format": 1
},
{
"name": "docs/CONTRIBUTING.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "a1579da61311237aaa707ceea81dff9269d6826fdf90f32c5fcf9b513d2c4513",
"format": 1
},
{
"name": "docs/INSTALLATION.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "9b07d28298ed19f6de063a772a607f4cb865d2e706c4bd676599ab7fc49c64dc",
"format": 1
},
{
"name": "docs/MAINTAINER_GUIDE.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "dc7f5f908d7eb407ce9f93982892b7615e99a6abdb0f836b4b0e59ab2b3c1dcb",
"format": 1
},
{
"name": "docs/SECURITY.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "062552a1455d62b9e3c6683ad9d1b42343a82f7ffc33ac412fce7e40d1f52c28",
"format": 1
},
{
"name": "docs/BRANCHING.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "06567f4a7d818fbc89030b88b40ac7d7965e42c4a3408e7e8629662a8104e215",
"format": 1
},
{
"name": "docs/COMMITTER_GUIDE.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "b41b38fe09cfcbfb4499c39ed4822a9f8c3f5d562e68dad45b5f2389f18053b5",
"format": 1
},
{
"name": "docs/ADOPTERS.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "c81933a41503275063d789f0685472e1603e4614376f3918b42c4bfb210a2c01",
"format": 1
},
{
"name": "docs/MAINTAINERS.md",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "e748fd39a38ac2a61aa6f48eac2179dffcc5a3e8f261f54042946d969bbfadf6",
"format": 1
}
],
"format": 1
}

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -0,0 +1,39 @@
{
"collection_info": {
"namespace": "dellemc",
"name": "powerflex",
"version": "1.5.0",
"authors": [
"Akash Shendge <ansible.team@dell.com>",
"Arindam Datta <ansible.team@dell.com>",
"P Srinivas Rao <ansible.team@dell.com>",
"Rajshree Khare <ansible.team@dell.com>",
"Bhavneet Sharma <ansible.team@dell.com>",
"Ananthu S Kuttattu <ansible.team@dell.com>",
"Trisha Datta <ansible.team@dell.com>"
],
"readme": "README.md",
"tags": [
"storage"
],
"description": "Ansible modules for PowerFlex",
"license": [
"GPL-3.0-or-later",
"Apache-2.0"
],
"license_file": null,
"dependencies": {},
"repository": "https://github.com/dell/ansible-powerflex/tree/1.5.0",
"documentation": "https://github.com/dell/ansible-powerflex/tree/1.5.0/docs",
"homepage": "https://github.com/dell/ansible-powerflex/tree/1.5.0",
"issues": "https://www.dell.com/community/Automation/bd-p/Automation"
},
"file_manifest_file": {
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "9d8254015c7f5f969370d97d3badb243137e3e8a2f13cbfea625fc543f6f685b",
"format": 1
},
"format": 1
}

View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,60 @@
# Ansible Modules for Dell Technologies PowerFlex
The Ansible Modules for Dell Technologies (Dell) PowerFlex allow Data Center and IT administrators to use RedHat Ansible to automate and orchestrate the provisioning and management of Dell PowerFlex storage systems.
The capabilities of the Ansible modules are managing SDCs, volumes, snapshots, storage pools, replication consistency groups, SDSs, devices, protection domains, MDM cluster, and to gather high level facts from the storage system. The options available are list, show, create, modify and delete. These tasks can be executed by running simple playbooks written in yaml syntax. The modules are written so that all the operations are idempotent, so making multiple identical requests has the same effect as making a single request.
## Table of contents
* [Code of conduct](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/CODE_OF_CONDUCT.md)
* [Maintainer guide](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/MAINTAINER_GUIDE.md)
* [Committer guide](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/COMMITTER_GUIDE.md)
* [Contributing guide](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/CONTRIBUTING.md)
* [Branching strategy](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/BRANCHING.md)
* [List of adopters](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/ADOPTERS.md)
* [Maintainers](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/MAINTAINERS.md)
* [Support](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/SUPPORT.md)
* [License](#license)
* [Security](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/SECURITY.md)
* [Prerequisites](#prerequisites)
* [List of Ansible modules for Dell PowerFlex](#list-of-ansible-modules-for-dell-powerflex)
* [Installation and execution of Ansible modules for Dell PowerFlex](#installation-and-execution-of-ansible-modules-for-dell-powerflex)
* [Releasing, Maintenance and Deprecation](#releasing-maintenance-and-deprecation)
## License
The Ansible collection for PowerFlex is released and licensed under the GPL-3.0 license. See [LICENSE](https://github.com/dell/ansible-powerflex/blob/1.5.0/LICENSE) for the full terms. Ansible modules and modules utilities that are part of the Ansible collection for PowerFlex are released and licensed under the Apache 2.0 license. See [MODULE-LICENSE](https://github.com/dell/ansible-powerflex/blob/1.5.0/MODULE-LICENSE) for the full terms.
## Prerequisites
| **Ansible Modules** | **PowerFlex/VxFlex OS Version** | **SDK version** | **Python version** | **Ansible** |
|---------------------|-----------------------|-------|--------------------|--------------------------|
| v1.5.0 |3.5 <br> 3.6 <br> 4.0 | 1.6.0 | 3.9.x <br> 3.10.x <br> 3.11.x | 2.12 <br> 2.13 <br> 2.14 |
* Please follow PyPowerFlex installation instructions on [PyPowerFlex Documentation](https://github.com/dell/python-powerflex)
## Idempotency
The modules are written in such a way that all requests are idempotent and hence fault-tolerant. It essentially means that the result of a successfully performed request is independent of the number of times it is executed.
## List of Ansible modules for Dell PowerFlex
* [Info module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#info-module)
* [Snapshot module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#snapshot-module)
* [SDC module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#sdc-module)
* [Storage pool module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#storage-pool-module)
* [Volume module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#volume-module)
* [SDS module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#sds-module)
* [Device Module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#device-module)
* [Protection Domain Module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#protection-domain-module)
* [MDM Cluster Module](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/Product%20Guide.md#mdm-cluster-module)
## Installation and execution of Ansible modules for Dell PowerFlex
The installation and execution steps of Ansible modules for Dell PowerFlex can be found [here](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/INSTALLATION.md).
## Releasing, Maintenance and Deprecation
Ansible Modules for Dell Technnologies PowerFlex follows [Semantic Versioning](https://semver.org/).
New version will be release regularly if significant changes (bug fix or new feature) are made in the collection.
Released code versions are located on "release" branches with names of the form "release-x.y.z" where x.y.z corresponds to the version number. More information on branching strategy followed can be found [here](https://github.com/dell/ansible-powerflex/blob/1.5.0/docs/BRANCHING.md).
Ansible Modules for Dell Technologies PowerFlex deprecation cycle is aligned with that of [Ansible](https://docs.ansible.com/ansible/latest/dev_guide/module_lifecycle.html).

View File

@@ -0,0 +1,67 @@
objects:
role: {}
plugins:
become: {}
cache: {}
callback: {}
cliconf: {}
connection: {}
httpapi: {}
inventory: {}
lookup: {}
module:
device:
description: Manage device on Dell PowerFlex
name: device
namespace: ''
version_added: 1.1.0
info:
description: Gathering information about Dell PowerFlex
name: info
namespace: ''
version_added: 1.0.0
mdm_cluster:
description: Manage MDM cluster on Dell PowerFlex
name: mdm_cluster
namespace: ''
version_added: 1.3.0
protection_domain:
description: Manage Protection Domain on Dell PowerFlex
name: protection_domain
namespace: ''
version_added: 1.2.0
replication_consistency_group:
description: Manage replication consistency groups on Dell PowerFlex
name: replication_consistency_group
namespace: ''
version_added: 1.5.0
sdc:
description: Manage SDCs on Dell PowerFlex
name: sdc
namespace: ''
version_added: 1.0.0
sds:
description: Manage SDS on Dell PowerFlex
name: sds
namespace: ''
version_added: 1.1.0
snapshot:
description: Manage Snapshots on Dell PowerFlex
name: snapshot
namespace: ''
version_added: 1.0.0
storagepool:
description: Managing Dell PowerFlex storage pool
name: storagepool
namespace: ''
version_added: 1.0.0
volume:
description: Manage volumes on Dell PowerFlex
name: volume
namespace: ''
version_added: 1.0.0
netconf: {}
shell: {}
strategy: {}
vars: {}
version: 1.5.0

View File

@@ -0,0 +1,82 @@
ancestor: null
releases:
1.0.0:
modules:
- description: Gathering information about Dell PowerFlex
name: info
namespace: ''
- description: Manage SDCs on Dell PowerFlex
name: sdc
namespace: ''
- description: Manage Snapshots on Dell PowerFlex
name: snapshot
namespace: ''
- description: Managing Dell PowerFlex storage pool
name: storagepool
namespace: ''
- description: Manage volumes on Dell PowerFlex
name: volume
namespace: ''
release_date: '2021-03-24'
1.1.0:
changes:
minor_changes:
- Added dual licensing.
- Gatherfacts module is enhanced to list devices.
modules:
- description: Manage device on Dell PowerFlex
name: device
namespace: ''
- description: Manage SDS on Dell PowerFlex
name: sds
namespace: ''
release_date: '2021-09-28'
1.1.1:
changes:
deprecated_features:
- The dellemc_powerflex_gatherfacts module is deprecated and replaced with dellemc_powerflex_info
trivial:
- Product Guide, Release Notes and ReadMe updated as per community guidelines.
release_date: '2021-12-16'
1.2.0:
changes:
minor_changes:
- Names of previously released modules have been changed from dellemc_powerflex_\<module
name> to \<module name>.
modules:
- description: Manage Protection Domain on Dell PowerFlex
name: protection_domain
namespace: ''
release_date: '2022-03-25'
1.3.0:
changes:
minor_changes:
- Added execution environment manifest file to support building an execution
environment with ansible-builder.
- Enabled the check_mode support for info module
modules:
- description: Manage MDM cluster on Dell PowerFlex
name: mdm_cluster
namespace: ''
release_date: '2022-06-28'
1.4.0:
changes:
minor_changes:
- Added support for 4.0.x release of PowerFlex OS.
- Info module is enhanced to support the listing volumes and storage pools with
statistics data.
- Storage pool module is enhanced to get the details with statistics data.
- Volume module is enhanced to get the details with statistics data.
release_date: '2022-09-27'
1.5.0:
changes:
minor_changes:
- Info module is enhanced to support the listing replication consistency groups.
- Renamed gateway_host to hostname
- Renamed verifycert to validate_certs.
- Updated modules to adhere with ansible community guidelines.
modules:
- description: Manage replication consistency groups on Dell PowerFlex
name: replication_consistency_group
namespace: ''
release_date: '2022-12-22'

View File

@@ -0,0 +1,33 @@
---
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sanitize_changelog: true
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Dellemc.PowerFlex
trivial_section_name: trivial
use_fqcn: true

View File

@@ -0,0 +1,5 @@
---
version: 1
dependencies:
galaxy: requirements.yml #Absolute/relative path of requirements.yml
python: requirements.txt #Absolute/relative path of requirements.txt

View File

@@ -0,0 +1,39 @@
---
requires_ansible: ">=2.12"
plugin_routing:
modules:
dellemc_powerflex_gatherfacts:
redirect: dellemc.powerflex.info
deprecation:
removal_date: "2024-03-31"
warning_text: Use info module instead.
dellemc_powerflex_device:
redirect: dellemc.powerflex.device
deprecation:
removal_date: "2024-03-31"
warning_text: Use device module instead.
dellemc_powerflex_sdc:
redirect: dellemc.powerflex.sdc
deprecation:
removal_date: "2024-03-31"
warning_text: Use sdc module instead.
dellemc_powerflex_sds:
redirect: dellemc.powerflex.sds
deprecation:
removal_date: "2024-03-31"
warning_text: Use sds module instead.
dellemc_powerflex_snapshot:
redirect: dellemc.powerflex.snapshot
deprecation:
removal_date: "2024-03-31"
warning_text: Use snapshot module instead.
dellemc_powerflex_storagepool:
redirect: dellemc.powerflex.storagepool
deprecation:
removal_date: "2024-03-31"
warning_text: Use storagepool module instead.
dellemc_powerflex_volume:
redirect: dellemc.powerflex.volume
deprecation:
removal_date: "2024-03-31"
warning_text: Use volume module instead.

View File

@@ -0,0 +1,61 @@
# Copyright: (c) 2020, Dell Technologies.
# Apache License version 2.0 (see MODULE-LICENSE or http://www.apache.org/licenses/LICENSE-2.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class ModuleDocFragment(object):
# Documentation fragment for PowerFlex
DOCUMENTATION = r'''
options:
hostname:
required: true
description:
- IP or FQDN of the PowerFlex host.
type: str
aliases:
- gateway_host
username:
type: str
required: true
description:
- The username of the PowerFlex host.
password:
type: str
required: true
description:
- The password of the PowerFlex host.
validate_certs:
type: bool
default: true
aliases:
- verifycert
description:
- Boolean variable to specify whether or not to validate SSL
certificate.
- C(true) - Indicates that the SSL certificate should be verified.
- C(false) - Indicates that the SSL certificate should not be
verified.
port:
description:
- Port number through which communication happens with PowerFlex
host.
type: int
default: 443
timeout:
description:
- Time after which connection will get terminated.
- It is to be mentioned in seconds.
type: int
required: False
default: 120
requirements:
- A Dell PowerFlex storage system version 3.5 or later.
- Ansible-core 2.12 or later.
- PyPowerFlex 1.6.0.
- Python 3.9, 3.10 or 3.11.
notes:
- The modules present in the collection named as 'dellemc.powerflex'
are built to support the Dell PowerFlex storage platform.
'''

View File

@@ -0,0 +1,24 @@
# Copyright: (c) 2022, Dell Technologies
# Apache License version 2.0 (see MODULE-LICENSE or http://www.apache.org/licenses/LICENSE-2.0.txt)
"""Custom rotating file handler for PowerFlex"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from datetime import datetime
from logging.handlers import RotatingFileHandler
class CustomRotatingFileHandler(RotatingFileHandler):
def rotation_filename(self, default_name):
"""
Modify the filename of a log file when rotating.
:param default_name: The default name of the log file.
"""
src_file_name = default_name.split('.')
dest_file_name = "{0}_{1}.{2}.{3}".format(
src_file_name[0], '{0:%Y%m%d}'.format(datetime.now()),
src_file_name[1], src_file_name[2]
)
return dest_file_name

View File

@@ -0,0 +1,186 @@
# Copyright: (c) 2021, Dell Technologies
# Apache License version 2.0 (see MODULE-LICENSE or http://www.apache.org/licenses/LICENSE-2.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import logging
import math
import re
from decimal import Decimal
from ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell.logging_handler \
import CustomRotatingFileHandler
import traceback
from ansible.module_utils.basic import missing_required_lib
"""import PyPowerFlex lib"""
try:
from PyPowerFlex import PowerFlexClient
from PyPowerFlex.objects.sds import Sds
from PyPowerFlex.objects import protection_domain
from PyPowerFlex.objects import storage_pool
from PyPowerFlex.objects import sdc
from PyPowerFlex.objects import volume
from PyPowerFlex.objects import system
from PyPowerFlex.objects.system import SnapshotDef
HAS_POWERFLEX_SDK, POWERFLEX_SDK_IMP_ERR = True, None
except ImportError:
HAS_POWERFLEX_SDK, POWERFLEX_SDK_IMP_ERR = False, traceback.format_exc()
"""importing pkg_resources"""
try:
from pkg_resources import parse_version
import pkg_resources
PKG_RSRC_IMPORTED, PKG_RSRC_IMP_ERR = True, None
except ImportError:
PKG_RSRC_IMPORTED, PKG_RSRC_IMP_ERR = False, traceback.format_exc()
"""importing dateutil"""
try:
import dateutil.relativedelta
HAS_DATEUTIL, DATEUTIL_IMP_ERR = True, None
except ImportError:
HAS_DATEUTIL, DATEUTIL_IMP_ERR = False, traceback.format_exc()
def get_powerflex_gateway_host_parameters():
"""Provides common access parameters required for the
ansible modules on PowerFlex Storage System"""
return dict(
hostname=dict(type='str', aliases=['gateway_host'], required=True),
username=dict(type='str', required=True),
password=dict(type='str', required=True, no_log=True),
validate_certs=dict(type='bool', aliases=['verifycert'], required=False, default=True),
port=dict(type='int', required=False, default=443),
timeout=dict(type='int', required=False, default=120)
)
def get_powerflex_gateway_host_connection(module_params):
"""Establishes connection with PowerFlex storage system"""
if HAS_POWERFLEX_SDK:
conn = PowerFlexClient(
gateway_address=module_params['hostname'],
gateway_port=module_params['port'],
verify_certificate=module_params['validate_certs'],
username=module_params['username'],
password=module_params['password'],
timeout=module_params['timeout'])
conn.initialize()
return conn
def ensure_required_libs(module):
"""Check required libraries"""
if not HAS_DATEUTIL:
module.fail_json(msg=missing_required_lib("python-dateutil"),
exception=DATEUTIL_IMP_ERR)
if not PKG_RSRC_IMPORTED:
module.fail_json(msg=missing_required_lib("pkg_resources"),
exception=PKG_RSRC_IMP_ERR)
if not HAS_POWERFLEX_SDK:
module.fail_json(msg=missing_required_lib("PyPowerFlex V 1.6.0 or above"),
exception=POWERFLEX_SDK_IMP_ERR)
min_ver = '1.6.0'
try:
curr_version = pkg_resources.require("PyPowerFlex")[0].version
supported_version = (parse_version(curr_version) >= parse_version(min_ver))
if not supported_version:
module.fail_json(msg="PyPowerFlex {0} is not supported. "
"Required minimum version is "
"{1}".format(curr_version, min_ver))
except Exception as e:
module.fail_json(msg="Getting PyPowerFlex SDK version, failed with "
"Error {0}".format(str(e)))
def get_logger(module_name, log_file_name='ansible_powerflex.log', log_devel=logging.INFO):
"""
Initialize logger and return the logger object.
:param module_name: Name of module to be part of log message
:param log_file_name: Name of file in which the log messages get appended
:param log_devel: Log level
:return LOG object
"""
FORMAT = '%(asctime)-15s %(filename)s %(levelname)s : %(message)s'
max_bytes = 5 * 1024 * 1024
logging.basicConfig(filename=log_file_name, format=FORMAT)
LOG = logging.getLogger(module_name)
LOG.setLevel(log_devel)
handler = CustomRotatingFileHandler(log_file_name, maxBytes=max_bytes, backupCount=5)
formatter = logging.Formatter(FORMAT)
handler.setFormatter(formatter)
LOG.addHandler(handler)
LOG.propagate = False
return LOG
KB_IN_BYTES = 1024
MB_IN_BYTES = 1024 * 1024
GB_IN_BYTES = 1024 * 1024 * 1024
TB_IN_BYTES = 1024 * 1024 * 1024 * 1024
def get_size_bytes(size, cap_units):
"""Convert the given size to bytes"""
if size is not None and size > 0:
if cap_units in ('kb', 'KB'):
return size * KB_IN_BYTES
elif cap_units in ('mb', 'MB'):
return size * MB_IN_BYTES
elif cap_units in ('gb', 'GB'):
return size * GB_IN_BYTES
elif cap_units in ('tb', 'TB'):
return size * TB_IN_BYTES
else:
return size
else:
return 0
def convert_size_with_unit(size_bytes):
"""Convert size in byte with actual unit like KB,MB,GB,TB,PB etc."""
if not isinstance(size_bytes, int):
raise ValueError('This method takes Integer type argument only')
if size_bytes == 0:
return "0B"
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size_bytes, 1024)))
p = math.pow(1024, i)
s = round(size_bytes / p, 2)
return "%s %s" % (s, size_name[i])
def get_size_in_gb(size, cap_units):
"""Convert the given size to size in GB, size is restricted to 2 decimal places"""
size_in_bytes = get_size_bytes(size, cap_units)
size = Decimal(size_in_bytes / GB_IN_BYTES)
size_in_gb = round(size)
return size_in_gb
def is_version_less_than_3_6(version):
"""Verifies if powerflex version is less than 3.6"""
version = re.search(r'R\s*([\d.]+)', version.replace('_', '.')).group(1)
return \
pkg_resources.parse_version(version) < pkg_resources.parse_version('3.6')
def is_invalid_name(name):
"""Validates string against regex pattern"""
if name is not None:
regexp = re.compile(r'^[a-zA-Z0-9!@#$%^~*_-]*$')
if not regexp.search(name):
return True

View File

@@ -0,0 +1,907 @@
#!/usr/bin/python
# Copyright: (c) 2022, Dell Technologies
# Apache License version 2.0 (see MODULE-LICENSE or http://www.apache.org/licenses/LICENSE-2.0.txt)
""" Ansible module for managing replication consistency groups on Dell Technologies (Dell) PowerFlex"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
module: replication_consistency_group
version_added: '1.5.0'
short_description: Manage replication consistency groups on Dell PowerFlex
description:
- Managing replication consistency groups on PowerFlex storage system includes
getting details, creating, modifying, creating snapshots, pause, resume, freeze, unfreeze,
activate, inactivate and deleting a replication consistency group.
author:
- Trisha Datta (@Trisha-Datta) <ansible.team@dell.com>
- Jennifer John (@Jennifer-John) <ansible.team@dell.com>
extends_documentation_fragment:
- dellemc.powerflex.powerflex
options:
rcg_name:
description:
- The name of the replication consistency group.
- It is unique across the PowerFlex array.
- Mutually exclusive with I(rcg_id).
type: str
rcg_id:
description:
- The ID of the replication consistency group.
- Mutually exclusive with I(rcg_name).
type: str
create_snapshot:
description:
- Whether to create the snapshot of the replication consistency group.
type: bool
rpo:
description:
- Desired RPO in seconds.
type: int
protection_domain_id:
description:
- Protection domain id.
- Mutually exclusive with I(protection_domain_name).
type: str
protection_domain_name:
description:
- Protection domain name.
- Mutually exclusive with I(protection_domain_id).
type: str
activity_mode:
description:
- Activity mode of RCG.
- This parameter is supported for version 3.6 and above.
choices: ['Active', 'Inactive']
type: str
pause:
description:
- Pause or resume the RCG.
type: bool
freeze:
description:
- Freeze or unfreeze the RCG.
type: bool
pause_mode:
description:
- Pause mode.
- It is required if pause is set as True.
choices: ['StopDataTransfer', 'OnlyTrackChanges']
type: str
target_volume_access_mode:
description:
- Target volume access mode.
choices: ['ReadOnly', 'NoAccess']
type: str
is_consistent:
description:
- Consistency of RCG.
type: bool
new_rcg_name:
description:
- Name of RCG to rename to.
type: str
remote_peer:
description:
- Remote peer system.
type: dict
suboptions:
hostname:
required: true
description:
- IP or FQDN of the remote peer gateway host.
type: str
aliases:
- gateway_host
username:
type: str
required: true
description:
- The username of the remote peer gateway host.
password:
type: str
required: true
description:
- The password of the remote peer gateway host.
validate_certs:
type: bool
default: true
aliases:
- verifycert
description:
- Boolean variable to specify whether or not to validate SSL
certificate.
- C(true) - Indicates that the SSL certificate should be verified.
- C(false) - Indicates that the SSL certificate should not be verified.
port:
description:
- Port number through which communication happens with remote peer
gateway host.
type: int
default: 443
timeout:
description:
- Time after which connection will get terminated.
- It is to be mentioned in seconds.
type: int
default: 120
protection_domain_id:
description:
- Remote protection domain id.
- Mutually exclusive with I(protection_domain_name).
type: str
protection_domain_name:
description:
- Remote protection domain name.
- Mutually exclusive with I(protection_domain_id).
type: str
state:
description:
- State of the replication consistency group.
choices: ['present', 'absent']
default: present
type: str
notes:
- The I(check_mode) is supported.
- Idempotency is not supported for create snapshot operation.
- There is a delay in reflection of final state of RCG after few update operations on RCG.
- In 3.6 and above, the replication consistency group will return back to consistent mode on changing to inconsistent mode
if consistence barrier arrives. Hence idempotency on setting to inconsistent mode will return changed as True.
'''
EXAMPLES = r'''
- name: Get RCG details
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "{{rcg_name}}"
- name: Create a snapshot of the RCG
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_id: "{{rcg_id}}"
create_snapshot: True
state: "present"
- name: Create a replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
rpo: 60
protection_domain_name: "domain1"
activity_mode: "active"
remote_peer:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
protection_domain_name: "domain1"
- name: Modify replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
rpo: 60
target_volume_access_mode: "ReadOnly"
activity_mode: "Inactive"
is_consistent: True
- name: Rename replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
new_rcg_name: "rcg_test_rename"
- name: Pause replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
action: "pause"
pause_mode: "StopDataTransfer"
- name: Resume replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
action: "resume"
- name: Freeze replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
action: "freeze"
- name: UnFreeze replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
action: "unfreeze"
- name: Delete replication consistency group
dellemc.powerflex.replication_consistency_group:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
rcg_name: "rcg_test"
state: "absent"
'''
RETURN = r'''
changed:
description: Whether or not the resource has changed.
returned: always
type: bool
sample: 'false'
replication_consistency_group_details:
description: Details of the replication consistency group.
returned: When replication consistency group exists
type: dict
contains:
id:
description: The ID of the replication consistency group.
type: str
name:
description: The name of the replication consistency group.
type: str
protectionDomainId:
description: The Protection Domain ID of the replication consistency group.
type: str
peerMdmId:
description: The ID of the peer MDM of the replication consistency group.
type: str
remoteId:
description: The ID of the remote replication consistency group.
type: str
remoteMdmId:
description: The ID of the remote MDM of the replication consistency group.
type: str
currConsistMode:
description: The current consistency mode of the replication consistency group.
type: str
freezeState:
description: The freeze state of the replication consistency group.
type: str
lifetimeState:
description: The Lifetime state of the replication consistency group.
type: str
pauseMode:
description: The Lifetime state of the replication consistency group.
type: str
snapCreationInProgress:
description: Whether the process of snapshot creation of the replication consistency group is in progress or not.
type: bool
lastSnapGroupId:
description: ID of the last snapshot of the replication consistency group.
type: str
lastSnapCreationRc:
description: The return code of the last snapshot of the replication consistency group.
type: int
targetVolumeAccessMode:
description: The access mode of the target volume of the replication consistency group.
type: str
remoteProtectionDomainId:
description: The ID of the remote Protection Domain.
type: str
remoteProtectionDomainName:
description: The Name of the remote Protection Domain.
type: str
failoverType:
description: The type of failover of the replication consistency group.
type: str
failoverState:
description: The state of failover of the replication consistency group.
type: str
activeLocal:
description: Whether the local replication consistency group is active.
type: bool
activeRemote:
description: Whether the remote replication consistency group is active
type: bool
abstractState:
description: The abstract state of the replication consistency group.
type: str
localActivityState:
description: The state of activity of the local replication consistency group.
type: str
remoteActivityState:
description: The state of activity of the remote replication consistency group..
type: str
inactiveReason:
description: The reason for the inactivity of the replication consistency group.
type: int
rpoInSeconds:
description: The RPO value of the replication consistency group in seconds.
type: int
replicationDirection:
description: The direction of the replication of the replication consistency group.
type: str
disasterRecoveryState:
description: The state of disaster recovery of the local replication consistency group.
type: str
remoteDisasterRecoveryState:
description: The state of disaster recovery of the remote replication consistency group.
type: str
error:
description: The error code of the replication consistency group.
type: int
type:
description: The type of the replication consistency group.
type: str
sample: {
"protectionDomainId": "b969400500000000",
"peerMdmId": "6c3d94f600000000",
"remoteId": "2130961a00000000",
"remoteMdmId": "0e7a082862fedf0f",
"currConsistMode": "Consistent",
"freezeState": "Unfrozen",
"lifetimeState": "Normal",
"pauseMode": "None",
"snapCreationInProgress": false,
"lastSnapGroupId": "e58280b300000001",
"lastSnapCreationRc": "SUCCESS",
"targetVolumeAccessMode": "NoAccess",
"remoteProtectionDomainId": "4eeb304600000000",
"remoteProtectionDomainName": "domain1",
"failoverType": "None",
"failoverState": "None",
"activeLocal": true,
"activeRemote": true,
"abstractState": "Ok",
"localActivityState": "Active",
"remoteActivityState": "Active",
"inactiveReason": 11,
"rpoInSeconds": 30,
"replicationDirection": "LocalToRemote",
"disasterRecoveryState": "None",
"remoteDisasterRecoveryState": "None",
"error": 65,
"name": "test_rcg",
"type": "User",
"id": "aadc17d500000000"
}
'''
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell \
import utils
LOG = utils.get_logger('replication_consistency_group')
class PowerFlexReplicationConsistencyGroup(object):
"""Class with replication consistency group operations"""
def __init__(self):
""" Define all parameters required by this module"""
self.module_params = utils.get_powerflex_gateway_host_parameters()
self.module_params.update(get_powerflex_replication_consistency_group_parameters())
mut_ex_args = [['rcg_name', 'rcg_id'], ['protection_domain_id', 'protection_domain_name']]
required_one_of_args = [['rcg_name', 'rcg_id']]
# initialize the Ansible module
self.module = AnsibleModule(
argument_spec=self.module_params,
supports_check_mode=True,
mutually_exclusive=mut_ex_args,
required_one_of=required_one_of_args)
utils.ensure_required_libs(self.module)
try:
self.powerflex_conn = utils.get_powerflex_gateway_host_connection(
self.module.params)
LOG.info("Got the PowerFlex system connection object instance")
except Exception as e:
LOG.error(str(e))
self.module.fail_json(msg=str(e))
def get_rcg(self, rcg_name=None, rcg_id=None):
"""Get rcg details
:param rcg_name: Name of the rcg
:param rcg_id: ID of the rcg
:return: RCG details
"""
name_or_id = rcg_id if rcg_id else rcg_name
try:
rcg_details = None
if rcg_id:
rcg_details = self.powerflex_conn.replication_consistency_group.get(
filter_fields={'id': rcg_id})
if rcg_name:
rcg_details = self.powerflex_conn.replication_consistency_group.get(
filter_fields={'name': rcg_name})
if rcg_details:
rcg_details[0]['statistics'] = \
self.powerflex_conn.replication_consistency_group.get_statistics(rcg_details[0]['id'])
rcg_details[0].pop('links', None)
self.append_protection_domain_name(rcg_details[0])
return rcg_details[0]
except Exception as e:
errormsg = "Failed to get the replication consistency group {0} with" \
" error {1}".format(name_or_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def create_rcg_snapshot(self, rcg_id):
"""Create RCG snapshot
:param rcg_id: Unique identifier of the RCG.
:return: Boolean indicating if create snapshot operation is successful
"""
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.create_snapshot(
rcg_id=rcg_id)
return True
except Exception as e:
errormsg = "Create RCG snapshot for RCG with id {0} operation failed with " \
"error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def create_rcg(self, rcg_params):
"""Create RCG"""
try:
resp = None
# Get remote system details
self.remote_powerflex_conn = utils.get_powerflex_gateway_host_connection(
self.module.params['remote_peer'])
LOG.info("Got the remote peer connection object instance")
protection_domain_id = rcg_params['protection_domain_id']
if rcg_params['protection_domain_name']:
protection_domain_id = \
self.get_protection_domain(self.powerflex_conn, rcg_params['protection_domain_name'])['id']
remote_protection_domain_id = rcg_params['remote_peer']['protection_domain_id']
if rcg_params['remote_peer']['protection_domain_name']:
remote_protection_domain_id = \
self.get_protection_domain(self.remote_powerflex_conn,
rcg_params['remote_peer']['protection_domain_name'])['id']
if not self.module.check_mode:
resp = self.powerflex_conn.replication_consistency_group.create(
rpo=rcg_params['rpo'],
protection_domain_id=protection_domain_id,
remote_protection_domain_id=remote_protection_domain_id,
destination_system_id=self.remote_powerflex_conn.system.get()[0]['id'],
name=rcg_params['rcg_name'],
activity_mode=rcg_params['activity_mode'])
return True, resp
except Exception as e:
errormsg = "Create replication consistency group failed with error {0}".format(str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def modify_rpo(self, rcg_id, rpo):
"""Modify rpo
:param rcg_id: Unique identifier of the RCG.
:param rpo: rpo value in seconds
:return: Boolean indicates if modify rpo is successful
"""
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.modify_rpo(
rcg_id, rpo)
return True
except Exception as e:
errormsg = "Modify rpo for replication consistency group {0} failed with " \
"error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def modify_target_volume_access_mode(self, rcg_id, target_volume_access_mode):
"""Modify target volume access mode
:param rcg_id: Unique identifier of the RCG.
:param target_volume_access_mode: Target volume access mode.
:return: Boolean indicates if modify operation is successful
"""
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.modify_target_volume_access_mode(
rcg_id, target_volume_access_mode)
return True
except Exception as e:
errormsg = "Modify target volume access mode for replication consistency group {0} failed with " \
"error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def modify_activity_mode(self, rcg_id, rcg_details, activity_mode):
"""Modify activity mode
:param rcg_id: Unique identifier of the RCG.
:param rcg_details: RCG details.
:param activity_mode: RCG activity mode.
:return: Boolean indicates if modify operation is successful
"""
try:
if activity_mode == 'Active' and rcg_details['localActivityState'].lower() == 'inactive':
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.activate(rcg_id)
return True
elif activity_mode == 'Inactive' and rcg_details['localActivityState'].lower() == 'active':
if not self.module.check_mode:
rcg_details = self.powerflex_conn.replication_consistency_group.inactivate(rcg_id)
return True
except Exception as e:
errormsg = "Modify activity_mode for replication consistency group {0} failed with " \
"error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def pause_or_resume_rcg(self, rcg_id, rcg_details, pause, pause_mode=None):
"""Perform specified rcg action
:param rcg_id: Unique identifier of the RCG.
:param rcg_details: RCG details.
:param pause: Pause or resume RCG.
:param pause_mode: Specifies the pause mode if pause is True.
:return: Boolean indicates if rcg action is successful
"""
if pause and rcg_details['pauseMode'] == 'None':
if not pause_mode:
self.module.fail_json(msg="Specify pause_mode to perform pause on replication consistency group.")
return self.pause(rcg_id, pause_mode)
if not pause and rcg_details['pauseMode'] != 'None':
return self.resume(rcg_id)
def freeze_or_unfreeze_rcg(self, rcg_id, rcg_details, freeze):
"""Perform specified rcg action
:param rcg_id: Unique identifier of the RCG.
:param rcg_details: RCG details.
:param freeze: Freeze or unfreeze RCG.
:return: Boolean indicates if rcg action is successful
"""
if freeze and rcg_details['freezeState'].lower() == 'unfrozen':
return self.freeze(rcg_id)
if not freeze and rcg_details['freezeState'].lower() == 'frozen':
return self.unfreeze(rcg_id)
def freeze(self, rcg_id):
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.freeze(rcg_id)
return True
except Exception as e:
errormsg = "Freeze replication consistency group {0} failed with error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def unfreeze(self, rcg_id):
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.unfreeze(rcg_id)
return True
except Exception as e:
errormsg = "Unfreeze replication consistency group {0} failed with error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def pause(self, rcg_id, pause_mode):
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.pause(rcg_id, pause_mode)
return True
except Exception as e:
errormsg = "Pause replication consistency group {0} failed with error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def resume(self, rcg_id):
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.resume(rcg_id)
return True
except Exception as e:
errormsg = "Resume replication consistency group {0} failed with error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def set_consistency(self, rcg_id, rcg_details, is_consistent):
"""Set rcg to specified mode
:param rcg_id: Unique identifier of the RCG.
:param rcg_details: RCG details.
:param is_consistent: RCG consistency.
:return: Boolean indicates if set consistency is successful
"""
try:
if is_consistent and rcg_details['currConsistMode'].lower() not in ('consistent', 'consistentpending'):
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.set_as_consistent(rcg_id)
return True
elif not is_consistent and rcg_details['currConsistMode'].lower() not in ('inconsistent', 'inconsistentpending'):
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.set_as_inconsistent(rcg_id)
return True
except Exception as e:
errormsg = "Modifying consistency of replication consistency group failed with error {0}".format(str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def rename_rcg(self, rcg_id, rcg_details, new_name):
"""Rename rcg
:param rcg_id: Unique identifier of the RCG.
:param rcg_details: RCG details
:param new_name: RCG name to rename to.
:return: Boolean indicates if rename is successful
"""
try:
if rcg_details['name'] != new_name:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.rename_rcg(rcg_id, new_name)
return True
except Exception as e:
errormsg = "Renaming replication consistency group to {0} failed with error {1}".format(new_name, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def delete_rcg(self, rcg_id):
"""Delete RCG
:param rcg_id: Unique identifier of the RCG.
:return: Boolean indicates if delete rcg operation is successful
"""
try:
if not self.module.check_mode:
self.powerflex_conn.replication_consistency_group.delete(
rcg_id=rcg_id)
return True
except Exception as e:
errormsg = "Delete replication consistency group {0} failed with " \
"error {1}".format(rcg_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def get_protection_domain(self, conn, protection_domain_name=None, protection_domain_id=None):
"""
Get protection domain details
:param conn: local or remote connection
:param protection_domain_name: Name of the protection domain
:param protection_domain_id: ID of the protection domain
:return: Protection domain id if exists
:rtype: str
"""
name_or_id = protection_domain_id if protection_domain_id \
else protection_domain_name
try:
pd_details = []
if protection_domain_id:
pd_details = conn.protection_domain.get(
filter_fields={'id': protection_domain_id})
if protection_domain_name:
pd_details = conn.protection_domain.get(
filter_fields={'name': protection_domain_name})
if len(pd_details) == 0:
error_msg = "Unable to find the protection domain with " \
"'%s'." % name_or_id
self.module.fail_json(msg=error_msg)
return pd_details[0]
except Exception as e:
error_msg = "Failed to get the protection domain '%s' with " \
"error '%s'" % (name_or_id, str(e))
LOG.error(error_msg)
self.module.fail_json(msg=error_msg)
def validate_create(self, rcg_params):
"""Validate create RCG params"""
params = ['create_snapshot', 'new_rcg_name']
for param in params:
if rcg_params[param] is not None:
self.module.fail_json(msg="%s cannot be specified while creating replication consistency group" % param)
if not rcg_params['rpo']:
self.module.fail_json(msg='Enter rpo to create replication consistency group')
if not rcg_params['remote_peer']:
self.module.fail_json(msg='Enter remote_peer to create replication consistency group')
if not rcg_params['protection_domain_id'] and not rcg_params['protection_domain_name']:
self.module.fail_json(msg='Enter protection_domain_name or protection_domain_id to create replication consistency group')
if (not rcg_params['remote_peer']['protection_domain_id'] and not rcg_params['remote_peer']['protection_domain_name']) or \
(rcg_params['remote_peer']['protection_domain_id'] is not None and
rcg_params['remote_peer']['protection_domain_name'] is not None):
self.module.fail_json(msg='Enter remote protection_domain_name or protection_domain_id to create replication consistency group')
def modify_rcg(self, rcg_id, rcg_details):
create_snapshot = self.module.params['create_snapshot']
rpo = self.module.params['rpo']
target_volume_access_mode = self.module.params['target_volume_access_mode']
pause = self.module.params['pause']
freeze = self.module.params['freeze']
is_consistent = self.module.params['is_consistent']
activity_mode = self.module.params['activity_mode']
new_rcg_name = self.module.params['new_rcg_name']
changed = False
if create_snapshot is True:
changed = self.create_rcg_snapshot(rcg_id)
if rpo and rcg_details['rpoInSeconds'] and \
rpo != rcg_details['rpoInSeconds']:
changed = self.modify_rpo(rcg_id, rpo)
if target_volume_access_mode and \
rcg_details['targetVolumeAccessMode'] != target_volume_access_mode:
changed = \
self.modify_target_volume_access_mode(rcg_id, target_volume_access_mode)
if activity_mode and \
self.modify_activity_mode(rcg_id, rcg_details, activity_mode):
changed = True
rcg_details = self.get_rcg(rcg_id=rcg_details['id'])
if pause is not None and \
self.pause_or_resume_rcg(rcg_id, rcg_details, pause, self.module.params['pause_mode']):
changed = True
if freeze is not None and \
self.freeze_or_unfreeze_rcg(rcg_id, rcg_details, freeze):
changed = True
if is_consistent is not None and \
self.set_consistency(rcg_id, rcg_details, is_consistent):
changed = True
if new_rcg_name and self.rename_rcg(rcg_id, rcg_details, new_rcg_name):
changed = True
return changed
def validate_input(self, rcg_params):
try:
api_version = self.powerflex_conn.system.get()[0]['mdmCluster']['master']['versionInfo']
if rcg_params['activity_mode'] is not None and utils.is_version_less_than_3_6(api_version):
self.module.fail_json(msg='activity_mode is supported only from version 3.6 and above')
params = ['rcg_name', 'new_rcg_name']
for param in params:
if rcg_params[param] and utils.is_invalid_name(rcg_params[param]):
self.module.fail_json(msg='Enter a valid %s' % param)
if rcg_params['pause_mode'] and rcg_params['pause'] is None:
self.module.fail_json(msg='Specify pause as True to pause replication consistency group')
except Exception as e:
error_msg = "Validating input parameters failed with " \
"error '%s'" % (str(e))
LOG.error(error_msg)
self.module.fail_json(msg=error_msg)
def append_protection_domain_name(self, rcg_details):
try:
# Append protection domain name
if 'protectionDomainId' in rcg_details \
and rcg_details['protectionDomainId']:
pd_details = self.get_protection_domain(
conn=self.powerflex_conn,
protection_domain_id=rcg_details['protectionDomainId'])
rcg_details['protectionDomainName'] = pd_details['name']
except Exception as e:
error_msg = "Updating replication consistency group details with protection domain name failed with " \
"error '%s'" % (str(e))
LOG.error(error_msg)
self.module.fail_json(msg=error_msg)
def perform_module_operation(self):
"""
Perform different actions on replication consistency group based on parameters passed in
the playbook
"""
self.validate_input(self.module.params)
rcg_name = self.module.params['rcg_name']
new_rcg_name = self.module.params['new_rcg_name']
rcg_id = self.module.params['rcg_id']
state = self.module.params['state']
# result is a dictionary to contain end state and RCG details
changed = False
result = dict(
changed=False,
replication_consistency_group_details=[]
)
# get RCG details
rcg_details = self.get_rcg(rcg_name, rcg_id)
if rcg_details:
result['replication_consistency_group_details'] = rcg_details
rcg_id = rcg_details['id']
msg = "Fetched the RCG details {0}".format(str(rcg_details))
LOG.info(msg)
# perform create
if state == "present":
if not rcg_details:
self.validate_create(self.module.params)
changed, rcg_details = self.create_rcg(self.module.params)
if rcg_details:
rcg_id = rcg_details['id']
if rcg_details and self.modify_rcg(rcg_id, rcg_details):
changed = True
if state == "absent" and rcg_details:
changed = self.delete_rcg(rcg_id=rcg_details['id'])
# Returning the RCG details
if changed:
result['replication_consistency_group_details'] = \
self.get_rcg(new_rcg_name or rcg_name, rcg_id)
result['changed'] = changed
self.module.exit_json(**result)
def get_powerflex_replication_consistency_group_parameters():
"""This method provide parameter required for the replication_consistency_group
module on PowerFlex"""
return dict(
rcg_name=dict(), rcg_id=dict(),
create_snapshot=dict(type='bool'),
rpo=dict(type='int'), protection_domain_id=dict(),
protection_domain_name=dict(), new_rcg_name=dict(),
activity_mode=dict(choices=['Active', 'Inactive']),
pause=dict(type='bool'), freeze=dict(type='bool'),
pause_mode=dict(choices=['StopDataTransfer', 'OnlyTrackChanges']),
target_volume_access_mode=dict(choices=['ReadOnly', 'NoAccess']),
is_consistent=dict(type='bool'),
remote_peer=dict(type='dict',
options=dict(hostname=dict(type='str', aliases=['gateway_host'], required=True),
username=dict(type='str', required=True),
password=dict(type='str', required=True, no_log=True),
validate_certs=dict(type='bool', aliases=['verifycert'], default=True),
port=dict(type='int', default=443),
timeout=dict(type='int', default=120),
protection_domain_id=dict(),
protection_domain_name=dict())),
state=dict(default='present', type='str', choices=['present', 'absent'])
)
def main():
""" Create PowerFlex Replication Consistency Group object and perform actions on it
based on user input from playbook"""
obj = PowerFlexReplicationConsistencyGroup()
obj.perform_module_operation()
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,365 @@
#!/usr/bin/python
# Copyright: (c) 2021, Dell Technologies
# Apache License version 2.0 (see MODULE-LICENSE or http://www.apache.org/licenses/LICENSE-2.0.txt)
""" Ansible module for managing SDCs on Dell Technologies (Dell) PowerFlex"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
module: sdc
version_added: '1.0.0'
short_description: Manage SDCs on Dell PowerFlex
description:
- Managing SDCs on PowerFlex storage system includes getting details of SDC
and renaming SDC.
author:
- Akash Shendge (@shenda1) <ansible.team@dell.com>
extends_documentation_fragment:
- dellemc.powerflex.powerflex
options:
sdc_name:
description:
- Name of the SDC.
- Specify either I(sdc_name), I(sdc_id) or I(sdc_ip) for get/rename operation.
- Mutually exclusive with I(sdc_id) and I(sdc_ip).
type: str
sdc_id:
description:
- ID of the SDC.
- Specify either I(sdc_name), I(sdc_id) or I(sdc_ip) for get/rename operation.
- Mutually exclusive with I(sdc_name) and I(sdc_ip).
type: str
sdc_ip:
description:
- IP of the SDC.
- Specify either I(sdc_name), I(sdc_id) or I(sdc_ip) for get/rename operation.
- Mutually exclusive with I(sdc_id) and I(sdc_name).
type: str
sdc_new_name:
description:
- New name of the SDC. Used to rename the SDC.
type: str
state:
description:
- State of the SDC.
choices: ['present', 'absent']
required: true
type: str
notes:
- The I(check_mode) is not supported.
'''
EXAMPLES = r'''
- name: Get SDC details using SDC ip
dellemc.powerflex.sdc:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
sdc_ip: "{{sdc_ip}}"
state: "present"
- name: Rename SDC using SDC name
dellemc.powerflex.sdc:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
sdc_name: "centos_sdc"
sdc_new_name: "centos_sdc_renamed"
state: "present"
'''
RETURN = r'''
changed:
description: Whether or not the resource has changed.
returned: always
type: bool
sample: 'false'
sdc_details:
description: Details of the SDC.
returned: When SDC exists
type: dict
contains:
id:
description: The ID of the SDC.
type: str
name:
description: Name of the SDC.
type: str
sdcIp:
description: IP of the SDC.
type: str
osType:
description: OS type of the SDC.
type: str
mapped_volumes:
description: The details of the mapped volumes.
type: list
contains:
id:
description: The ID of the volume.
type: str
name:
description: The name of the volume.
type: str
volumeType:
description: Type of the volume.
type: str
sdcApproved:
description: Indicates whether an SDC has approved access to the
system.
type: bool
sample: {
"id": "07335d3d00000006",
"installedSoftwareVersionInfo": "R3_6.0.0",
"kernelBuildNumber": null,
"kernelVersion": "3.10.0",
"links": [
{
"href": "/api/instances/Sdc::07335d3d00000006",
"rel": "self"
},
{
"href": "/api/instances/Sdc::07335d3d00000006/relationships/
Statistics",
"rel": "/api/Sdc/relationship/Statistics"
},
{
"href": "/api/instances/Sdc::07335d3d00000006/relationships/
Volume",
"rel": "/api/Sdc/relationship/Volume"
},
{
"href": "/api/instances/System::4a54a8ba6df0690f",
"rel": "/api/parent/relationship/systemId"
}
],
"mapped_volumes": [],
"mdmConnectionState": "Disconnected",
"memoryAllocationFailure": null,
"name": "LGLAP203",
"osType": "Linux",
"peerMdmId": null,
"perfProfile": "HighPerformance",
"sdcApproved": true,
"sdcApprovedIps": null,
"sdcGuid": "F8ECB844-23B8-4629-92BB-B6E49A1744CB",
"sdcIp": "N/A",
"sdcIps": null,
"sdcType": "AppSdc",
"sdrId": null,
"socketAllocationFailure": null,
"softwareVersionInfo": "R3_6.0.0",
"systemId": "4a54a8ba6df0690f",
"versionInfo": "R3_6.0.0"
}
'''
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell\
import utils
LOG = utils.get_logger('sdc')
class PowerFlexSdc(object):
"""Class with SDC operations"""
def __init__(self):
""" Define all parameters required by this module"""
self.module_params = utils.get_powerflex_gateway_host_parameters()
self.module_params.update(get_powerflex_sdc_parameters())
mutually_exclusive = [['sdc_id', 'sdc_ip', 'sdc_name']]
required_one_of = [['sdc_id', 'sdc_ip', 'sdc_name']]
# initialize the Ansible module
self.module = AnsibleModule(
argument_spec=self.module_params,
supports_check_mode=False,
mutually_exclusive=mutually_exclusive,
required_one_of=required_one_of)
utils.ensure_required_libs(self.module)
try:
self.powerflex_conn = utils.get_powerflex_gateway_host_connection(
self.module.params)
LOG.info("Got the PowerFlex system connection object instance")
except Exception as e:
LOG.error(str(e))
self.module.fail_json(msg=str(e))
def rename_sdc(self, sdc_id, new_name):
"""Rename SDC
:param sdc_id: The ID of the SDC
:param new_name: The new name of the SDC
:return: Boolean indicating if rename operation is successful
"""
try:
self.powerflex_conn.sdc.rename(sdc_id=sdc_id, name=new_name)
return True
except Exception as e:
errormsg = "Failed to rename SDC %s with error %s" % (sdc_id,
str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def get_mapped_volumes(self, sdc_id):
"""Get volumes mapped to SDC
:param sdc_id: The ID of the SDC
:return: List containing volume details mapped to SDC
"""
try:
resp = self.powerflex_conn.sdc.get_mapped_volumes(sdc_id=sdc_id)
return resp
except Exception as e:
errormsg = "Failed to get the volumes mapped to SDC %s with " \
"error %s" % (sdc_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def get_sdc(self, sdc_name=None, sdc_ip=None, sdc_id=None):
"""Get the SDC Details
:param sdc_name: The name of the SDC
:param sdc_ip: The IP of the SDC
:param sdc_id: The ID of the SDC
:return: The dict containing SDC details
"""
if sdc_name:
id_ip_name = sdc_name
elif sdc_ip:
id_ip_name = sdc_ip
else:
id_ip_name = sdc_id
try:
if sdc_name:
sdc_details = self.powerflex_conn.sdc.get(
filter_fields={'name': sdc_name})
elif sdc_ip:
sdc_details = self.powerflex_conn.sdc.get(
filter_fields={'sdcIp': sdc_ip})
else:
sdc_details = self.powerflex_conn.sdc.get(
filter_fields={'id': sdc_id})
if len(sdc_details) == 0:
error_msg = "Unable to find SDC with identifier %s" \
% id_ip_name
LOG.error(error_msg)
return None
sdc_details[0]['mapped_volumes'] = self.get_mapped_volumes(
sdc_details[0]['id'])
return sdc_details[0]
except Exception as e:
errormsg = "Failed to get the SDC %s with error %s" % (
id_ip_name, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def validate_parameters(self, sdc_name=None, sdc_id=None, sdc_ip=None):
"""Validate the input parameters"""
if all(param is None for param in [sdc_name, sdc_id, sdc_ip]):
self.module.fail_json(msg="Please provide sdc_name/sdc_id/sdc_ip "
"with valid input.")
sdc_identifiers = ['sdc_name', 'sdc_id', 'sdc_ip']
for param in sdc_identifiers:
if self.module.params[param] is not None and \
len(self.module.params[param].strip()) == 0:
error_msg = "Please provide valid %s" % param
self.module.fail_json(msg=error_msg)
def perform_module_operation(self):
"""
Perform different actions on SDC based on parameters passed in
the playbook
"""
sdc_name = self.module.params['sdc_name']
sdc_id = self.module.params['sdc_id']
sdc_ip = self.module.params['sdc_ip']
sdc_new_name = self.module.params['sdc_new_name']
state = self.module.params['state']
# result is a dictionary to contain end state and SDC details
changed = False
result = dict(
changed=False,
sdc_details={}
)
self.validate_parameters(sdc_name, sdc_id, sdc_ip)
sdc_details = self.get_sdc(sdc_name=sdc_name, sdc_id=sdc_id,
sdc_ip=sdc_ip)
if sdc_name:
id_ip_name = sdc_name
elif sdc_ip:
id_ip_name = sdc_ip
else:
id_ip_name = sdc_id
if state == 'present' and not sdc_details:
error_msg = 'Could not find any SDC instance with ' \
'identifier %s.' % id_ip_name
LOG.error(error_msg)
self.module.fail_json(msg=error_msg)
if state == 'absent' and sdc_details:
error_msg = 'Removal of SDC is not allowed through Ansible ' \
'module.'
LOG.error(error_msg)
self.module.fail_json(msg=error_msg)
if state == 'present' and sdc_details and sdc_new_name is not None:
if len(sdc_new_name.strip()) == 0:
self.module.fail_json(msg="Please provide valid SDC name.")
changed = self.rename_sdc(sdc_details['id'], sdc_new_name)
if changed:
sdc_name = sdc_new_name
if state == 'present':
result['sdc_details'] = self.get_sdc(sdc_name=sdc_name,
sdc_id=sdc_id, sdc_ip=sdc_ip)
result['changed'] = changed
self.module.exit_json(**result)
def get_powerflex_sdc_parameters():
"""This method provide parameter required for the Ansible SDC module on
PowerFlex"""
return dict(
sdc_id=dict(),
sdc_ip=dict(),
sdc_name=dict(),
sdc_new_name=dict(),
state=dict(required=True, type='str', choices=['present', 'absent'])
)
def main():
""" Create PowerFlex SDC object and perform actions on it
based on user input from playbook"""
obj = PowerFlexSdc()
obj.perform_module_operation()
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,914 @@
#!/usr/bin/python
# Copyright: (c) 2021, Dell Technologies
# Apache License version 2.0 (see MODULE-LICENSE or http://www.apache.org/licenses/LICENSE-2.0.txt)
"""Ansible module for managing Dell Technologies (Dell) PowerFlex storage pool"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: storagepool
version_added: '1.0.0'
short_description: Managing Dell PowerFlex storage pool
description:
- Dell PowerFlex storage pool module includes getting the details of
storage pool, creating a new storage pool, and modifying the attribute of
a storage pool.
extends_documentation_fragment:
- dellemc.powerflex.powerflex
author:
- Arindam Datta (@dattaarindam) <ansible.team@dell.com>
- P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com>
options:
storage_pool_name:
description:
- The name of the storage pool.
- If more than one storage pool is found with the same name then
protection domain id/name is required to perform the task.
- Mutually exclusive with I(storage_pool_id).
type: str
storage_pool_id:
description:
- The id of the storage pool.
- It is auto generated, hence should not be provided during
creation of a storage pool.
- Mutually exclusive with I(storage_pool_name).
type: str
protection_domain_name:
description:
- The name of the protection domain.
- During creation of a pool, either protection domain name or id must be
mentioned.
- Mutually exclusive with I(protection_domain_id).
type: str
protection_domain_id:
description:
- The id of the protection domain.
- During creation of a pool, either protection domain name or id must
be mentioned.
- Mutually exclusive with I(protection_domain_name).
type: str
media_type:
description:
- Type of devices in the storage pool.
type: str
choices: ['HDD', 'SSD', 'TRANSITIONAL']
storage_pool_new_name:
description:
- New name for the storage pool can be provided.
- This parameter is used for renaming the storage pool.
type: str
use_rfcache:
description:
- Enable/Disable RFcache on a specific storage pool.
type: bool
use_rmcache:
description:
- Enable/Disable RMcache on a specific storage pool.
type: bool
state:
description:
- State of the storage pool.
type: str
choices: ["present", "absent"]
required: true
notes:
- TRANSITIONAL media type is supported only during modification.
- The I(check_mode) is not supported.
'''
EXAMPLES = r'''
- name: Get the details of storage pool by name
dellemc.powerflex.storagepool:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
storage_pool_name: "sample_pool_name"
protection_domain_name: "sample_protection_domain"
state: "present"
- name: Get the details of storage pool by id
dellemc.powerflex.storagepool:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
storage_pool_id: "abcd1234ab12r"
state: "present"
- name: Create a new storage pool by name
dellemc.powerflex.storagepool:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
storage_pool_name: "ansible_test_pool"
protection_domain_id: "1c957da800000000"
media_type: "HDD"
state: "present"
- name: Modify a storage pool by name
dellemc.powerflex.storagepool:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
storage_pool_name: "ansible_test_pool"
protection_domain_id: "1c957da800000000"
use_rmcache: True
use_rfcache: True
state: "present"
- name: Rename storage pool by id
dellemc.powerflex.storagepool:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
storage_pool_id: "abcd1234ab12r"
storage_pool_new_name: "new_ansible_pool"
state: "present"
'''
RETURN = r'''
changed:
description: Whether or not the resource has changed.
returned: always
type: bool
sample: 'false'
storage_pool_details:
description: Details of the storage pool.
returned: When storage pool exists
type: dict
contains:
mediaType:
description: Type of devices in the storage pool.
type: str
useRfcache:
description: Enable/Disable RFcache on a specific storage pool.
type: bool
useRmcache:
description: Enable/Disable RMcache on a specific storage pool.
type: bool
id:
description: ID of the storage pool under protection domain.
type: str
name:
description: Name of the storage pool under protection domain.
type: str
protectionDomainId:
description: ID of the protection domain in which pool resides.
type: str
protectionDomainName:
description: Name of the protection domain in which pool resides.
type: str
"statistics":
description: Statistics details of the storage pool.
type: dict
contains:
"capacityInUseInKb":
description: Total capacity of the storage pool.
type: str
"unusedCapacityInKb":
description: Unused capacity of the storage pool.
type: str
"deviceIds":
description: Device Ids of the storage pool.
type: list
sample: {
"addressSpaceUsage": "Normal",
"addressSpaceUsageType": "DeviceCapacityLimit",
"backgroundScannerBWLimitKBps": 3072,
"backgroundScannerMode": "DataComparison",
"bgScannerCompareErrorAction": "ReportAndFix",
"bgScannerReadErrorAction": "ReportAndFix",
"capacityAlertCriticalThreshold": 90,
"capacityAlertHighThreshold": 80,
"capacityUsageState": "Normal",
"capacityUsageType": "NetCapacity",
"checksumEnabled": false,
"compressionMethod": "Invalid",
"dataLayout": "MediumGranularity",
"externalAccelerationType": "None",
"fglAccpId": null,
"fglExtraCapacity": null,
"fglMaxCompressionRatio": null,
"fglMetadataSizeXx100": null,
"fglNvdimmMetadataAmortizationX100": null,
"fglNvdimmWriteCacheSizeInMb": null,
"fglOverProvisioningFactor": null,
"fglPerfProfile": null,
"fglWriteAtomicitySize": null,
"fragmentationEnabled": true,
"id": "e0d8f6c900000000",
"links": [
{
"href": "/api/instances/StoragePool::e0d8f6c900000000",
"rel": "self"
},
{
"href": "/api/instances/StoragePool::e0d8f6c900000000
/relationships/Statistics",
"rel": "/api/StoragePool/relationship/Statistics"
},
{
"href": "/api/instances/StoragePool::e0d8f6c900000000
/relationships/SpSds",
"rel": "/api/StoragePool/relationship/SpSds"
},
{
"href": "/api/instances/StoragePool::e0d8f6c900000000
/relationships/Volume",
"rel": "/api/StoragePool/relationship/Volume"
},
{
"href": "/api/instances/StoragePool::e0d8f6c900000000
/relationships/Device",
"rel": "/api/StoragePool/relationship/Device"
},
{
"href": "/api/instances/StoragePool::e0d8f6c900000000
/relationships/VTree",
"rel": "/api/StoragePool/relationship/VTree"
},
{
"href": "/api/instances/ProtectionDomain::9300c1f900000000",
"rel": "/api/parent/relationship/protectionDomainId"
}
],
"statistics": {
"BackgroundScannedInMB": 3466920,
"activeBckRebuildCapacityInKb": 0,
"activeEnterProtectedMaintenanceModeCapacityInKb": 0,
"aggregateCompressionLevel": "Uncompressed",
"atRestCapacityInKb": 1248256,
"backgroundScanCompareErrorCount": 0,
"backgroundScanFixedCompareErrorCount": 0,
"bckRebuildReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"bckRebuildWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"capacityAvailableForVolumeAllocationInKb": 369098752,
"capacityInUseInKb": 2496512,
"capacityInUseNoOverheadInKb": 2496512,
"capacityLimitInKb": 845783040,
"compressedDataCompressionRatio": 0.0,
"compressionRatio": 1.0,
"currentFglMigrationSizeInKb": 0,
"deviceIds": [
],
"enterProtectedMaintenanceModeCapacityInKb": 0,
"enterProtectedMaintenanceModeReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"enterProtectedMaintenanceModeWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"exitProtectedMaintenanceModeReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"exitProtectedMaintenanceModeWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"exposedCapacityInKb": 0,
"failedCapacityInKb": 0,
"fwdRebuildReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"fwdRebuildWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"inMaintenanceCapacityInKb": 0,
"inMaintenanceVacInKb": 0,
"inUseVacInKb": 184549376,
"inaccessibleCapacityInKb": 0,
"logWrittenBlocksInKb": 0,
"maxCapacityInKb": 845783040,
"migratingVolumeIds": [
],
"migratingVtreeIds": [
],
"movingCapacityInKb": 0,
"netCapacityInUseInKb": 1248256,
"normRebuildCapacityInKb": 0,
"normRebuildReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"normRebuildWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"numOfDeviceAtFaultRebuilds": 0,
"numOfDevices": 3,
"numOfIncomingVtreeMigrations": 0,
"numOfVolumes": 8,
"numOfVolumesInDeletion": 0,
"numOfVtrees": 8,
"overallUsageRatio": 73.92289,
"pendingBckRebuildCapacityInKb": 0,
"pendingEnterProtectedMaintenanceModeCapacityInKb": 0,
"pendingExitProtectedMaintenanceModeCapacityInKb": 0,
"pendingFwdRebuildCapacityInKb": 0,
"pendingMovingCapacityInKb": 0,
"pendingMovingInBckRebuildJobs": 0,
"persistentChecksumBuilderProgress": 100.0,
"persistentChecksumCapacityInKb": 414720,
"primaryReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"primaryReadFromDevBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"primaryReadFromRmcacheBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"primaryVacInKb": 92274688,
"primaryWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"protectedCapacityInKb": 2496512,
"protectedVacInKb": 184549376,
"provisionedAddressesInKb": 2496512,
"rebalanceCapacityInKb": 0,
"rebalanceReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"rebalanceWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"rfacheReadHit": 0,
"rfacheWriteHit": 0,
"rfcacheAvgReadTime": 0,
"rfcacheAvgWriteTime": 0,
"rfcacheIoErrors": 0,
"rfcacheIosOutstanding": 0,
"rfcacheIosSkipped": 0,
"rfcacheReadMiss": 0,
"rmPendingAllocatedInKb": 0,
"rmPendingThickInKb": 0,
"rplJournalCapAllowed": 0,
"rplTotalJournalCap": 0,
"rplUsedJournalCap": 0,
"secondaryReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"secondaryReadFromDevBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"secondaryReadFromRmcacheBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"secondaryVacInKb": 92274688,
"secondaryWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"semiProtectedCapacityInKb": 0,
"semiProtectedVacInKb": 0,
"snapCapacityInUseInKb": 0,
"snapCapacityInUseOccupiedInKb": 0,
"snapshotCapacityInKb": 0,
"spSdsIds": [
"abdfe71b00030001",
"abdce71d00040001",
"abdde71e00050001"
],
"spareCapacityInKb": 84578304,
"targetOtherLatency": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"targetReadLatency": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"targetWriteLatency": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"tempCapacityInKb": 0,
"tempCapacityVacInKb": 0,
"thickCapacityInUseInKb": 0,
"thinAndSnapshotRatio": 73.92289,
"thinCapacityAllocatedInKm": 184549376,
"thinCapacityInUseInKb": 0,
"thinUserDataCapacityInKb": 2496512,
"totalFglMigrationSizeInKb": 0,
"totalReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"totalWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"trimmedUserDataCapacityInKb": 0,
"unreachableUnusedCapacityInKb": 0,
"unusedCapacityInKb": 758708224,
"userDataCapacityInKb": 2496512,
"userDataCapacityNoTrimInKb": 2496512,
"userDataReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"userDataSdcReadLatency": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"userDataSdcTrimLatency": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"userDataSdcWriteLatency": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"userDataTrimBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"userDataWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"volMigrationReadBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"volMigrationWriteBwc": {
"numOccured": 0,
"numSeconds": 0,
"totalWeightInKb": 0
},
"volumeAddressSpaceInKb": 922XXXXX,
"volumeAllocationLimitInKb": 3707XXXXX,
"volumeIds": [
"456afc7900XXXXXXXX"
],
"vtreeAddresSpaceInKb": 92274688,
"vtreeIds": [
"32b1681bXXXXXXXX",
]
},
"mediaType": "HDD",
"name": "pool1",
"numOfParallelRebuildRebalanceJobsPerDevice": 2,
"persistentChecksumBuilderLimitKb": 3072,
"persistentChecksumEnabled": true,
"persistentChecksumState": "Protected",
"persistentChecksumValidateOnRead": false,
"protectedMaintenanceModeIoPriorityAppBwPerDeviceThresholdInKbps": null,
"protectedMaintenanceModeIoPriorityAppIopsPerDeviceThreshold": null,
"protectedMaintenanceModeIoPriorityBwLimitPerDeviceInKbps": 10240,
"protectedMaintenanceModeIoPriorityNumOfConcurrentIosPerDevice": 1,
"protectedMaintenanceModeIoPriorityPolicy": "limitNumOfConcurrentIos",
"protectedMaintenanceModeIoPriorityQuietPeriodInMsec": null,
"protectionDomainId": "9300c1f900000000",
"protectionDomainName": "domain1",
"rebalanceEnabled": true,
"rebalanceIoPriorityAppBwPerDeviceThresholdInKbps": null,
"rebalanceIoPriorityAppIopsPerDeviceThreshold": null,
"rebalanceIoPriorityBwLimitPerDeviceInKbps": 10240,
"rebalanceIoPriorityNumOfConcurrentIosPerDevice": 1,
"rebalanceIoPriorityPolicy": "favorAppIos",
"rebalanceIoPriorityQuietPeriodInMsec": null,
"rebuildEnabled": true,
"rebuildIoPriorityAppBwPerDeviceThresholdInKbps": null,
"rebuildIoPriorityAppIopsPerDeviceThreshold": null,
"rebuildIoPriorityBwLimitPerDeviceInKbps": 10240,
"rebuildIoPriorityNumOfConcurrentIosPerDevice": 1,
"rebuildIoPriorityPolicy": "limitNumOfConcurrentIos",
"rebuildIoPriorityQuietPeriodInMsec": null,
"replicationCapacityMaxRatio": 32,
"rmcacheWriteHandlingMode": "Cached",
"sparePercentage": 10,
"useRfcache": false,
"useRmcache": false,
"vtreeMigrationIoPriorityAppBwPerDeviceThresholdInKbps": null,
"vtreeMigrationIoPriorityAppIopsPerDeviceThreshold": null,
"vtreeMigrationIoPriorityBwLimitPerDeviceInKbps": 10240,
"vtreeMigrationIoPriorityNumOfConcurrentIosPerDevice": 1,
"vtreeMigrationIoPriorityPolicy": "favorAppIos",
"vtreeMigrationIoPriorityQuietPeriodInMsec": null,
"zeroPaddingEnabled": true
}
'''
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell\
import utils
LOG = utils.get_logger('storagepool')
class PowerFlexStoragePool(object):
"""Class with StoragePool operations"""
def __init__(self):
""" Define all parameters required by this module"""
self.module_params = utils.get_powerflex_gateway_host_parameters()
self.module_params.update(get_powerflex_storagepool_parameters())
""" initialize the ansible module """
mut_ex_args = [['storage_pool_name', 'storage_pool_id'],
['protection_domain_name', 'protection_domain_id'],
['storage_pool_id', 'protection_domain_name'],
['storage_pool_id', 'protection_domain_id']]
required_one_of_args = [['storage_pool_name', 'storage_pool_id']]
self.module = AnsibleModule(argument_spec=self.module_params,
supports_check_mode=False,
mutually_exclusive=mut_ex_args,
required_one_of=required_one_of_args)
utils.ensure_required_libs(self.module)
try:
self.powerflex_conn = utils.get_powerflex_gateway_host_connection(
self.module.params)
LOG.info('Got the PowerFlex system connection object instance')
except Exception as e:
LOG.error(str(e))
self.module.fail_json(msg=str(e))
def get_protection_domain(self, protection_domain_name=None,
protection_domain_id=None):
"""Get protection domain details
:param protection_domain_name: Name of the protection domain
:param protection_domain_id: ID of the protection domain
:return: Protection domain details
"""
name_or_id = protection_domain_id if protection_domain_id \
else protection_domain_name
try:
filter_fields = {}
if protection_domain_id:
filter_fields = {'id': protection_domain_id}
if protection_domain_name:
filter_fields = {'name': protection_domain_name}
pd_details = self.powerflex_conn.protection_domain.get(
filter_fields=filter_fields)
if pd_details:
return pd_details[0]
if not pd_details:
err_msg = "Unable to find the protection domain with {0}. " \
"Please enter a valid protection domain" \
" name/id.".format(name_or_id)
self.module.fail_json(msg=err_msg)
except Exception as e:
errormsg = "Failed to get the protection domain {0} with" \
" error {1}".format(name_or_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def get_storage_pool(self, storage_pool_id=None, storage_pool_name=None,
pd_id=None):
"""Get storage pool details
:param pd_id: ID of the protection domain
:param storage_pool_name: The name of the storage pool
:param storage_pool_id: The storage pool id
:return: Storage pool details
"""
name_or_id = storage_pool_id if storage_pool_id \
else storage_pool_name
try:
filter_fields = {}
if storage_pool_id:
filter_fields = {'id': storage_pool_id}
if storage_pool_name:
filter_fields.update({'name': storage_pool_name})
if pd_id:
filter_fields.update({'protectionDomainId': pd_id})
pool_details = self.powerflex_conn.storage_pool.get(
filter_fields=filter_fields)
if pool_details:
if len(pool_details) > 1:
err_msg = "More than one storage pool found with {0}," \
" Please provide protection domain Name/Id" \
" to fetch the unique" \
" storage pool".format(storage_pool_name)
LOG.error(err_msg)
self.module.fail_json(msg=err_msg)
elif len(pool_details) == 1:
pool_details = pool_details[0]
statistics = self.powerflex_conn.storage_pool.get_statistics(pool_details['id'])
pool_details['statistics'] = statistics if statistics else {}
pd_id = pool_details['protectionDomainId']
pd_name = self.get_protection_domain(
protection_domain_id=pd_id)['name']
# adding protection domain name in the pool details
pool_details['protectionDomainName'] = pd_name
else:
pool_details = None
return pool_details
except Exception as e:
errormsg = "Failed to get the storage pool {0} with error " \
"{1}".format(name_or_id, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def create_storage_pool(self, pool_name, pd_id, media_type,
use_rfcache=None, use_rmcache=None):
"""
Create a storage pool
:param pool_name: Name of the storage pool
:param pd_id: ID of the storage pool
:param media_type: Type of storage device in the pool
:param use_rfcache: Enable/Disable RFcache on pool
:param use_rmcache: Enable/Disable RMcache on pool
:return: True, if the operation is successful
"""
try:
if media_type == "Transitional":
self.module.fail_json(msg="TRANSITIONAL media type is not"
" supported during creation."
" Please enter a valid media type")
if pd_id is None:
self.module.fail_json(
msg="Please provide protection domain details for "
"creation of a storage pool")
self.powerflex_conn.storage_pool.create(
media_type=media_type,
protection_domain_id=pd_id, name=pool_name,
use_rfcache=use_rfcache, use_rmcache=use_rmcache)
return True
except Exception as e:
errormsg = "Failed to create the storage pool {0} with error " \
"{1}".format(pool_name, str(e))
LOG.error(errormsg)
self.module.fail_json(msg=errormsg)
def modify_storage_pool(self, pool_id, modify_dict):
"""
Modify the parameters of the storage pool.
:param modify_dict: Dict containing parameters which are to be
modified
:param pool_id: Id of the pool.
:return: True, if the operation is successful.
"""
try:
if 'new_name' in modify_dict:
self.powerflex_conn.storage_pool.rename(
pool_id, modify_dict['new_name'])
if 'use_rmcache' in modify_dict:
self.powerflex_conn.storage_pool.set_use_rmcache(
pool_id, modify_dict['use_rmcache'])
if 'use_rfcache' in modify_dict:
self.powerflex_conn.storage_pool.set_use_rfcache(
pool_id, modify_dict['use_rfcache'])
if 'media_type' in modify_dict:
self.powerflex_conn.storage_pool.set_media_type(
pool_id, modify_dict['media_type'])
return True
except Exception as e:
err_msg = "Failed to update the storage pool {0} with error " \
"{1}".format(pool_id, str(e))
LOG.error(err_msg)
self.module.fail_json(msg=err_msg)
def verify_params(self, pool_details, pd_name, pd_id):
"""
:param pool_details: Details of the storage pool
:param pd_name: Name of the protection domain
:param pd_id: Id of the protection domain
"""
if pd_id and pd_id != pool_details['protectionDomainId']:
self.module.fail_json(msg="Entered protection domain id does not"
" match with the storage pool's "
"protection domain id. Please enter "
"a correct protection domain id.")
if pd_name and pd_name != pool_details['protectionDomainName']:
self.module.fail_json(msg="Entered protection domain name does"
" not match with the storage pool's "
"protection domain name. Please enter"
" a correct protection domain name.")
def perform_module_operation(self):
""" Perform different actions on Storage Pool based on user input
in the playbook """
pool_name = self.module.params['storage_pool_name']
pool_id = self.module.params['storage_pool_id']
pool_new_name = self.module.params['storage_pool_new_name']
state = self.module.params['state']
pd_name = self.module.params['protection_domain_name']
pd_id = self.module.params['protection_domain_id']
use_rmcache = self.module.params['use_rmcache']
use_rfcache = self.module.params['use_rfcache']
media_type = self.module.params['media_type']
if media_type == "TRANSITIONAL":
media_type = 'Transitional'
result = dict(
storage_pool_details={}
)
changed = False
pd_details = None
if pd_name or pd_id:
pd_details = self.get_protection_domain(
protection_domain_id=pd_id,
protection_domain_name=pd_name)
if pd_details:
pd_id = pd_details['id']
if pool_name is not None and (len(pool_name.strip()) == 0):
self.module.fail_json(
msg="Empty or white spaced string provided in "
"storage_pool_name. Please provide valid storage"
" pool name.")
# Get the details of the storage pool.
pool_details = self.get_storage_pool(storage_pool_id=pool_id,
storage_pool_name=pool_name,
pd_id=pd_id)
if pool_name and pool_details:
pool_id = pool_details['id']
self.verify_params(pool_details, pd_name, pd_id)
# create a storage pool
if state == 'present' and not pool_details:
LOG.info("Creating new storage pool")
if pool_id:
self.module.fail_json(
msg="storage_pool_name is missing & name required to "
"create a storage pool. Please enter a valid "
"storage_pool_name.")
if pool_new_name is not None:
self.module.fail_json(
msg="storage_pool_new_name is passed during creation. "
"storage_pool_new_name is not allowed during "
"creation of a storage pool.")
changed = self.create_storage_pool(
pool_name, pd_id, media_type, use_rfcache, use_rmcache)
if changed:
pool_id = self.get_storage_pool(storage_pool_id=pool_id,
storage_pool_name=pool_name,
pd_id=pd_id)['id']
# modify the storage pool parameters
if state == 'present' and pool_details:
# check if the parameters are to be updated or not
if pool_new_name is not None and len(pool_new_name.strip()) == 0:
self.module.fail_json(
msg="Empty/White spaced name is not allowed during "
"renaming of a storage pool. Please enter a valid "
"storage pool new name.")
modify_dict = to_modify(pool_details, use_rmcache, use_rfcache,
pool_new_name, media_type)
if bool(modify_dict):
LOG.info("Modify attributes of storage pool")
changed = self.modify_storage_pool(pool_id, modify_dict)
# Delete a storage pool
if state == 'absent' and pool_details:
msg = "Deleting storage pool is not supported through" \
" ansible module."
LOG.error(msg)
self.module.fail_json(msg=msg)
# Show the updated storage pool details
if state == 'present':
pool_details = self.get_storage_pool(storage_pool_id=pool_id)
# fetching Id from pool details to address a case where
# protection domain is not passed
pd_id = pool_details['protectionDomainId']
pd_name = self.get_protection_domain(
protection_domain_id=pd_id)['name']
# adding protection domain name in the pool details
pool_details['protectionDomainName'] = pd_name
result['storage_pool_details'] = pool_details
result['changed'] = changed
self.module.exit_json(**result)
def to_modify(pool_details, use_rmcache, use_rfcache, new_name, media_type):
"""
Check whether a parameter is required to be updated.
:param media_type: Type of the media supported by the pool.
:param pool_details: Details of the storage pool
:param use_rmcache: Enable/Disable RMcache on pool
:param use_rfcache: Enable/Disable RFcache on pool
:param new_name: New name for the storage pool
:return: dict, containing parameters to be modified
"""
pool_name = pool_details['name']
pool_use_rfcache = pool_details['useRfcache']
pool_use_rmcache = pool_details['useRmcache']
pool_media_type = pool_details['mediaType']
modify_params = {}
if new_name is not None and pool_name != new_name:
modify_params['new_name'] = new_name
if use_rfcache is not None and pool_use_rfcache != use_rfcache:
modify_params['use_rfcache'] = use_rfcache
if use_rmcache is not None and pool_use_rmcache != use_rmcache:
modify_params['use_rmcache'] = use_rmcache
if media_type is not None and media_type != pool_media_type:
modify_params['media_type'] = media_type
return modify_params
def get_powerflex_storagepool_parameters():
"""This method provides parameters required for the ansible
Storage Pool module on powerflex"""
return dict(
storage_pool_name=dict(required=False, type='str'),
storage_pool_id=dict(required=False, type='str'),
protection_domain_name=dict(required=False, type='str'),
protection_domain_id=dict(required=False, type='str'),
media_type=dict(required=False, type='str',
choices=['HDD', 'SSD', 'TRANSITIONAL']),
use_rfcache=dict(required=False, type='bool'),
use_rmcache=dict(required=False, type='bool'),
storage_pool_new_name=dict(required=False, type='str'),
state=dict(required=True, type='str', choices=['present', 'absent']))
def main():
""" Create PowerFlex Storage Pool object and perform action on it
based on user input from playbook"""
obj = PowerFlexStoragePool()
obj.perform_module_operation()
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,4 @@
PyPowerFlex
requests>=2.23.0
python-dateutil>=2.8.0
setuptools

View File

@@ -0,0 +1,3 @@
---
collections:
- name: dellemc.powerflex