Skip to main content

Chaos Toolkit Extension for z/OS

Project description

Chaos Toolkit Extension for z/OS

Build Status Python versions

This project is a collection of actions and probes to allow the Chaos Toolkit to interact with [z/OS]. This is a very early release, put out for people to experiment with and critique. It is usable, but very limited in scope. I eventually plan to incorporate tests for program products (db2, CICS, IMS, etc), but need feedback to understand what to prioritize.

I will also be adding some overview videos to my youtube channel.

Install

This package requires Python 3.7+

This package needs to be installed in a Python environment where the chaostoolkit is already installed.

pip install -U chaostoolkit-zos

Usage

To use the actions in the package, add the following to your experiment file:

{
    "type": "action",
    "name": "configure_all_ziips_offline",
    "provider": {
        "type": "python",
        "module": "chaoszos.zos.actions",
        "func": "configure_processors",
        "secrets": [
            "zos_console"
        ],
        "arguments": {
            "location": "S5C",
            "processor_type_to_change": "ziip",
            "status_to_change_to": "offline"
        }
    }
}

Configuration

Access Methods

There are a number of different ways to interact with z/OS, and a number of interfaces for each method of interaction. For example, to issue a z/OS console command, you can connect to an HMC/SE, use the ZOAU interfaces, Ansible, the z/OSMF REST APIs, or Zowe. Similarly, for submitting jobs, you can use FTP, or zoau, or Zowe, or z/OSMF. And different installations have different legal and security requirements that will dictate which methods could be used. As such, the toolkit plans to allow multiple ways of doing any of these activities, without needing to change your high level experiment. The contents of your secrets will dictate which access method is used for a given experiment.

Right now, two methods are supported for issuing commands: using an HMC connection, or zoau after connecting via ssh.

Credentials

In order to issue commands, you need to give the extension a couple of pieces of information: how to connect to z/OS or the subsystem, and credentials to connect. In order to make this as transparent as possible, you can specify this information in your secrets section, and not have to change the experiment itself at all. For example, to use the z/OS hmc to issue commands in the above sample, you could specify

{
    "secrets": {
        "zos_console": {
            "S5C": {
                "method": "hmc",
                "hostname": "ioshmc3.pok.stglabs.ibm.com",
                "userid": {
                    "type": "env",
                    "key": "IOSHMC3_USERID"
                },
                "password": {
                    "type": "env",
                    "key": "IOSHMC3_PASSWORD"
                }
            }
        }
    }
}

Or, to use the ssh interface, provided by ZOAU, you could specify

{
    "secrets": {
        "zos_console": {
            "S5C": {
                "method": "ssh",
                "hostname": "pksts5c.pok.stglabs.ibm.com",
                "userid": {
                    "type": "env",
                    "key": "S5C_USERID"
                },
                "password": {
                    "type": "env",
                    "key": "S5C_PASSWORD"
                }
            }
        }
    }
}

In both cases, instead of hard-coding the userid and password, you can specify them via environmental variables. This is all handled by the Chaos Toolkit, so any supported method for passing in secrets will work.

If you are using certificates signed by an internal/private certificate authority, you may have problems connecting to your HMC. If this is the case, you can work around the problem by setting environmental variable REQUESTS_CA_BUNDLE to the location of the signing certificate. Note that this will then cause problems in contacting pypi.

Contribute

If you wish to contribute more functions to this package, you are welcome to do so. First, fork this project, make your changes following the usual PEP 8 code style, add tests and submit a PR for review. Or, if you'd like to be able to do something with the Chaos Toolkit, but don't know how to do it via code, feel free to submit a problem report, and I'll see what I can figure out. I'm hoping to add support for z/OS subsystems (CICS, Db2, IMS, etc), but my exptertise is in z/OS, so I need to understand what sorts of things you'd like to be able to do.

The Chaos Toolkit projects require all contributors must sign a Developer Certificate of Origin on each commit they would like to merge into the master branch of the repository. Please, make sure you can abide by the rules of the DCO before submitting a PR.

Develop

If you wish to develop on this project, make sure to install the development dependencies. But first, create a virtual environment and then install those dependencies.

$ pip install -r requirements-dev.txt -r requirements.txt

Then, point your environment to this directory:

$ python setup.py develop

Now, you can edit the files and they will be automatically be seen by your environment, even when running from the chaos command locally.

Test

To run the tests for the project execute the following:

$ pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chaostoolkit-zos-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

chaostoolkit_zos-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file chaostoolkit-zos-0.1.0.tar.gz.

File metadata

  • Download URL: chaostoolkit-zos-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for chaostoolkit-zos-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60da50d112234131e9840c95ac44839a23823920f5f197e519de905a3701087a
MD5 dc32431596cfbfad153dc947894ef9ec
BLAKE2b-256 6f694c41629f08f8b17b6f801d66271cccc7862e9ce08e566e4adf1cf947a04c

See more details on using hashes here.

File details

Details for the file chaostoolkit_zos-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chaostoolkit_zos-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0008e446f08b01993748951f9379d5064fe651ada05c01bcae5a13e02cf8a528
MD5 e8aa061eda93f752c8c9f5f2fe2a452e
BLAKE2b-256 1430a105b3d5a520603fa8d42c8792583f97e0ccc8eb9a9f9724489a686776fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page