Skip to content

Extension chaosazure

Version 0.8.3
Repository https://github.com/chaostoolkit-incubator/chaostoolkit-azure

Build Status Python versions

This project is a collection of actions and probes, gathered as an extension to the Chaos Toolkit. It targets the Microsoft Azure platform.

Install

This package requires Python 3.5+

To be used from your experiment, this package must be installed in the Python environment where chaostoolkit already lives.

$ pip install -U chaostoolkit-azure

Usage

To use the probes and actions from this package, add the following to your experiment file:

{
  "type": "action",
  "name": "start-service-factory-chaos",
  "provider": {
    "type": "python",
    "module": "chaosazure.vm.actions",
    "func": "stop_machines",
    "secrets": ["azure"],
    "arguments": {
      "parameters": {
        "TimeToRunInSeconds": 45
      }
    }
  }
}

That’s it!

Please explore the code to see existing probes and actions.

Configuration

This extension uses the Azure SDK libraries under the hood. The Azure SDK library expects that you have a tenant and client identifier, as well as a client secret and subscription, that allows you to authenticate with the Azure resource management API.

Configuration values for the Chaos Toolkit Extension for Azure can come from several sources:

  • Experiment file
  • Azure credential file

The extension will first try to load the configuration from the experiment file. If configuration is not provided in the experiment file, it will try to load it from the Azure credential file.

Credentials

  • Secrets in the Experiment file
{
  "secrets": {
    "azure": {
      "client_id": "your-super-secret-client-id",
      "client_secret": "your-even-more-super-secret-client-secret",
      "tenant_id": "your-tenant-id"
    }
  }
}

You can retrieve secretes as well from environment or HashiCorp vault.

If you are not working with Public Global Azure, e.g. China Cloud You can set the cloud environment.

{
  "client_id": "your-super-secret-client-id",
  "client_secret": "your-even-more-super-secret-client-secret",
  "tenant_id": "your-tenant-id",
  "azure_cloud": "AZURE_CHINA_CLOUD"
}

Available cloud names:

  • AZURE_CHINA_CLOUD
  • AZURE_GERMAN_CLOUD
  • AZURE_PUBLIC_CLOUD
  • AZURE_US_GOV_CLOUD

  • Secrets in the Azure credential file

You can retrieve a credentials file with your subscription ID already in place by signing in to Azure using the az login command followed by the az ad sp create-for-rbac command

az login
az ad sp create-for-rbac --sdk-auth > credentials.json

credentials.json:

{
  "subscriptionId": "<azure_aubscription_id>",
  "tenantId": "<tenant_id>",
  "clientId": "<application_id>",
  "clientSecret": "<application_secret>",
  "activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
  "resourceManagerEndpointUrl": "https://management.azure.com/",
  "activeDirectoryGraphResourceId": "https://graph.windows.net/",
  "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
  "galleryEndpointUrl": "https://gallery.azure.com/",
  "managementEndpointUrl": "https://management.core.windows.net/"
}

Store the path to the file in an environment variable called AZURE_AUTH_LOCATION and make sure that your experiment does NOT contain secrets section.

Subscription

Additionally you need to provide the Azure subscription id.

  • Subscription id in the experiment file
{
  "configuration": {
    "azure_subscription_id": "your-azure-subscription-id"
  }
}

Configuration may be as well retrieved from an environment.

An old, but deprecated way of doing it was as follows, this still works but should not be favoured over the previous approaches as it’s not the Chaos Toolkit way to pass structured configurations.

{
  "configuration": {
    "azure": {
      "subscription_id": "your-azure-subscription-id"
    }
  }
}
  • Subscription id in the Azure credential file

Credential file described in the previous “Credential” section contains as well subscription id. If AZURE_AUTH_LOCATION is set and subscription id is NOT set in the experiment definition, extension will try to load it from the credential file.

Putting it all together

Here is a full example for an experiment containing secrets and configuration:

{
  "version": "1.0.0",
  "title": "...",
  "description": "...",
  "tags": ["azure", "kubernetes", "aks", "node"],
  "configuration": {
    "azure_subscription_id": "xxx"
  },
  "secrets": {
    "azure": {
      "client_id": "xxx",
      "client_secret": "xxx",
      "tenant_id": "xxx"
    }
  },
  "steady-state-hypothesis": {
    "title": "Services are all available and healthy",
    "probes": [
      {
        "type": "probe",
        "name": "consumer-service-must-still-respond",
        "tolerance": 200,
        "provider": {
          "type": "http",
          "url": "https://some-url/"
        }
      }
    ]
  },
  "method": [
    {
      "type": "action",
      "name": "restart-node-at-random",
      "provider": {
        "type": "python",
        "module": "chaosazure.machine.actions",
        "func": "restart_machines",
        "secrets": ["azure"],
        "config": ["azure_subscription_id"]
      }
    }
  ],
  "rollbacks": []
}

Contribute

If you wish to contribute more functions to this package, you are more than welcome to do so. Please, fork this project, make your changes following the usual PEP 8 code style, sprinkling with tests and submit a PR for review.

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

Exported Activities

machine


burn_io

Type action
Module chaosazure.machine.actions
Name burn_io
Return None

Increases the Disk I/O operations per second of the virtual machine.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates. duration : int, optional How long the burn lasts. Defaults to 60 seconds. timeout : int Additional wait time (in seconds) for filling operation to be completed Getting and sending data from/to Azure may take some time so it’s not recommended to set this value to less than 30s. Defaults to 60 seconds.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

burn_io(“where resourceGroup==’rg’“, configuration=c, secrets=s) Increase the I/O operations per second of all machines from the group ‘rg’

burn_io(“where resourceGroup==’rg’ and name=’name’“, configuration=c, secrets=s) Increase the I/O operations per second of the machine from the group ‘rg’ having the name ‘name’

burn_io(“where resourceGroup==’rg’ | sample 2”, configuration=c, secrets=s) Increase the I/O operations per second of two machines at random from the group ‘rg’

Signature:

def burn_io(filter: str = None,
            duration: int = 60,
            timeout: int = 60,
            configuration: Dict[str, Dict[str, str]] = None,
            secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No
duration integer 60 No
timeout integer 60 No

Usage:

{
  "type": "action",
  "name": "burn-io",
  "provider": {
    "func": "burn_io",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: burn-io
provider:
  func: burn_io
  module: chaosazure.machine.actions
  type: python
type: action

count_machines

Type probe
Module chaosazure.machine.probes
Name count_machines
Return integer

Return count of Azure virtual machines.

– filter : str Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected for the probe. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def count_machines(filter: str = None,
                   configuration: Dict[str, Dict[str, str]] = None,
                   secrets: Dict[str, Dict[str, str]] = None) -> int:
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "probe",
  "name": "count-machines",
  "provider": {
    "func": "count_machines",
    "type": "python",
    "module": "chaosazure.machine.probes"
  }
}
name: count-machines
provider:
  func: count_machines
  module: chaosazure.machine.probes
  type: python
type: probe

delete_machines

Type action
Module chaosazure.machine.actions
Name delete_machines
Return None

Delete virtual machines at random.

Be aware: Deleting a machine is an invasive action. You will not be able to recover the machine once you deleted it.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

delete_machines(“where resourceGroup==’rg’“, c, s) Delete all machines from the group ‘rg’

delete_machines(“where resourceGroup==’rg’ and name=’name’“, c, s) Delete the machine from the group ‘rg’ having the name ‘name’

delete_machines(“where resourceGroup==’rg’ | sample 2”, c, s) Delete two machines at random from the group ‘rg’

Signature:

def delete_machines(filter: str = None,
                    configuration: Dict[str, Dict[str, str]] = None,
                    secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "delete-machines",
  "provider": {
    "func": "delete_machines",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: delete-machines
provider:
  func: delete_machines
  module: chaosazure.machine.actions
  type: python
type: action

describe_machines

Type probe
Module chaosazure.machine.probes
Name describe_machines
Return None

Describe Azure virtual machines.

– filter : str Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected for the probe. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def describe_machines(filter: str = None,
                      configuration: Dict[str, Dict[str, str]] = None,
                      secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "probe",
  "name": "describe-machines",
  "provider": {
    "func": "describe_machines",
    "type": "python",
    "module": "chaosazure.machine.probes"
  }
}
name: describe-machines
provider:
  func: describe_machines
  module: chaosazure.machine.probes
  type: python
type: probe

fill_disk

Type action
Module chaosazure.machine.actions
Name fill_disk
Return None

Fill the disk with random data.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates. duration : int, optional Lifetime of the file created. Defaults to 120 seconds. timeout : int Additional wait time (in seconds) for filling operation to be completed. Getting and sending data from/to Azure may take some time so it’s not recommended to set this value to less than 30s. Defaults to 60 seconds. size : int Size of the file created on the disk. Defaults to 1GB. path : str, optional The absolute path to write the fill file into. Defaults: C:/burn for Windows clients, /root/burn for Linux clients.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

fill_disk(“where resourceGroup==’rg’“, configuration=c, secrets=s) Fill all machines from the group ‘rg’

fill_disk(“where resourceGroup==’rg’ and name=’name’“, configuration=c, secrets=s) Fill the machine from the group ‘rg’ having the name ‘name’

fill_disk(“where resourceGroup==’rg’ | sample 2”, configuration=c, secrets=s) Fill two machines at random from the group ‘rg’

Signature:

def fill_disk(filter: str = None,
              duration: int = 120,
              timeout: int = 60,
              size: int = 1000,
              path: str = None,
              configuration: Dict[str, Dict[str, str]] = None,
              secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No
duration integer 120 No
timeout integer 60 No
size integer 1000 No
path string null No

Usage:

{
  "type": "action",
  "name": "fill-disk",
  "provider": {
    "func": "fill_disk",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: fill-disk
provider:
  func: fill_disk
  module: chaosazure.machine.actions
  type: python
type: action

network_latency

Type action
Module chaosazure.machine.actions
Name network_latency
Return None

Increases the response time of the virtual machine.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates. duration : int, optional How long the latency lasts. Defaults to 60 seconds. timeout : int Additional wait time (in seconds) for filling operation to be completed Getting and sending data from/to Azure may take some time so it’s not recommended to set this value to less than 30s. Defaults to 60 seconds. delay : int Added delay in ms. Defaults to 200. jitter : int Variance of the delay in ms. Defaults to 50.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

network_latency(“where resourceGroup==’rg’“, configuration=c, secrets=s) Increase the latency of all machines from the group ‘rg’

network_latency(“where resourceGroup==’rg’ and name=’name’“, configuration=c, secrets=s) Increase the latecy of the machine from the group ‘rg’ having the name ‘name’

network_latency(“where resourceGroup==’rg’ | sample 2”, configuration=c, secrets=s) Increase the latency of two machines at random from the group ‘rg’

Signature:

def network_latency(filter: str = None,
                    duration: int = 60,
                    delay: int = 200,
                    jitter: int = 50,
                    timeout: int = 60,
                    configuration: Dict[str, Dict[str, str]] = None,
                    secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No
duration integer 60 No
delay integer 200 No
jitter integer 50 No
timeout integer 60 No

Usage:

{
  "type": "action",
  "name": "network-latency",
  "provider": {
    "func": "network_latency",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: network-latency
provider:
  func: network_latency
  module: chaosazure.machine.actions
  type: python
type: action

restart_machines

Type action
Module chaosazure.machine.actions
Name restart_machines
Return None

Restart virtual machines at random.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

restart_machines(“where resourceGroup==’rg’“, c, s) Restart all machines from the group ‘rg’

restart_machines(“where resourceGroup==’rg’ and name=’name’“, c, s) Restart the machine from the group ‘rg’ having the name ‘name’

restart_machines(“where resourceGroup==’rg’ | sample 2”, c, s) Restart two machines at random from the group ‘rg’

Signature:

def restart_machines(filter: str = None,
                     configuration: Dict[str, Dict[str, str]] = None,
                     secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "restart-machines",
  "provider": {
    "func": "restart_machines",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: restart-machines
provider:
  func: restart_machines
  module: chaosazure.machine.actions
  type: python
type: action

start_machines

Type action
Module chaosazure.machine.actions
Name start_machines
Return None

Start virtual machines at random. Thought as a rollback action.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

start_machines(“where resourceGroup==’rg’“, c, s) Start all stopped machines from the group ‘rg’

start_machines(“where resourceGroup==’rg’ and name=’name’“, c, s) Start the stopped machine from the group ‘rg’ having the name ‘name’

start_machines(“where resourceGroup==’rg’ | sample 2”, c, s) Start two stopped machines at random from the group ‘rg’

Signature:

def start_machines(filter: str = None,
                   configuration: Dict[str, Dict[str, str]] = None,
                   secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "start-machines",
  "provider": {
    "func": "start_machines",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: start-machines
provider:
  func: start_machines
  module: chaosazure.machine.actions
  type: python
type: action

stop_machines

Type action
Module chaosazure.machine.actions
Name stop_machines
Return None

Stop virtual machines at random.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

stop_machines(“where resourceGroup==’rg’“, c, s) Stop all machines from the group ‘rg’

stop_machines(“where resourceGroup==’mygroup’ and name=’myname’“, c, s) Stop the machine from the group ‘mygroup’ having the name ‘myname’

stop_machines(“where resourceGroup==’mygroup’ | sample 2”, c, s) Stop two machines at random from the group ‘mygroup’

Signature:

def stop_machines(filter: str = None,
                  configuration: Dict[str, Dict[str, str]] = None,
                  secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "stop-machines",
  "provider": {
    "func": "stop_machines",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: stop-machines
provider:
  func: stop_machines
  module: chaosazure.machine.actions
  type: python
type: action

stress_cpu

Type action
Module chaosazure.machine.actions
Name stress_cpu
Return None

Stress CPU up to 100% at virtual machines.

– filter : str, optional Filter the virtual machines. If the filter is omitted all machines in the subscription will be selected as potential chaos candidates. duration : int, optional Duration of the stress test (in seconds) that generates high CPU usage. Defaults to 120 seconds. timeout : int Additional wait time (in seconds) for stress operation to be completed. Getting and sending data from/to Azure may take some time so it’s not recommended to set this value to less than 30s. Defaults to 60 seconds.

Some calling examples. Deep dive into the filter syntax: https://docs.microsoft.com/en-us/azure/kusto/query/

stress_cpu(“where resourceGroup==’rg’“, configuration=c, secrets=s) Stress all machines from the group ‘rg’

stress_cpu(“where resourceGroup==’rg’ and name=’name’“, configuration=c, secrets=s) Stress the machine from the group ‘rg’ having the name ‘name’

stress_cpu(“where resourceGroup==’rg’ | sample 2”, configuration=c, secrets=s) Stress two machines at random from the group ‘rg’

Signature:

def stress_cpu(filter: str = None,
               duration: int = 120,
               timeout: int = 60,
               configuration: Dict[str, Dict[str, str]] = None,
               secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No
duration integer 120 No
timeout integer 60 No

Usage:

{
  "type": "action",
  "name": "stress-cpu",
  "provider": {
    "func": "stress_cpu",
    "type": "python",
    "module": "chaosazure.machine.actions"
  }
}
name: stress-cpu
provider:
  func: stress_cpu
  module: chaosazure.machine.actions
  type: python
type: action

aks


delete_node

Type action
Module chaosazure.aks.actions
Name delete_node
Return None

Delete a node at random from a managed Azure Kubernetes Service.

Be aware: Deleting a node is an invasive action. You will not be able to recover the node once you deleted it.

– filter : str Filter the managed AKS. If the filter is omitted all AKS in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def delete_node(filter: str = None,
                configuration: Dict[str, Dict[str, str]] = None,
                secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "delete-node",
  "provider": {
    "func": "delete_node",
    "type": "python",
    "module": "chaosazure.aks.actions"
  }
}
name: delete-node
provider:
  func: delete_node
  module: chaosazure.aks.actions
  type: python
type: action

restart_node

Type action
Module chaosazure.aks.actions
Name restart_node
Return None

Restart a node at random from a managed Azure Kubernetes Service.

– filter : str Filter the managed AKS. If the filter is omitted all AKS in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def restart_node(filter: str = None,
                 configuration: Dict[str, Dict[str, str]] = None,
                 secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "restart-node",
  "provider": {
    "func": "restart_node",
    "type": "python",
    "module": "chaosazure.aks.actions"
  }
}
name: restart-node
provider:
  func: restart_node
  module: chaosazure.aks.actions
  type: python
type: action

stop_node

Type action
Module chaosazure.aks.actions
Name stop_node
Return None

Stop a node at random from a managed Azure Kubernetes Service.

– filter : str Filter the managed AKS. If the filter is omitted all AKS in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def stop_node(filter: str = None,
              configuration: Dict[str, Dict[str, str]] = None,
              secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "stop-node",
  "provider": {
    "func": "stop_node",
    "type": "python",
    "module": "chaosazure.aks.actions"
  }
}
name: stop-node
provider:
  func: stop_node
  module: chaosazure.aks.actions
  type: python
type: action

vmss


burn_io

Type action
Module chaosazure.vmss.actions
Name burn_io
Return None

Increases the Disk I/O operations per second of the VMSS machine. Similar to the burn_io action of the machine.actions module.

Signature:


Arguments:

Name Type Default Required
filter string null No
duration integer 60 No
timeout integer 60 No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "burn-io",
  "provider": {
    "func": "burn_io",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: burn-io
provider:
  func: burn_io
  module: chaosazure.vmss.actions
  type: python
type: action

count_instances

Type probe
Module chaosazure.vmss.probes
Name count_instances
Return integer

Return count of VMSS instances.

– filter : str Filter the VMSS instance. If the filter is omitted all machines in the subscription will be selected for the probe. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def count_instances(filter: str = None,
                    configuration: Dict[str, Dict[str, str]] = None,
                    secrets: Dict[str, Dict[str, str]] = None) -> int:
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "probe",
  "name": "count-instances",
  "provider": {
    "func": "count_instances",
    "type": "python",
    "module": "chaosazure.vmss.probes"
  }
}
name: count-instances
provider:
  func: count_instances
  module: chaosazure.vmss.probes
  type: python
type: probe

deallocate_vmss

Type action
Module chaosazure.vmss.actions
Name deallocate_vmss
Return None

Deallocate a virtual machine scale set instance at random.

– filter : str Filter the virtual machine scale set. If the filter is omitted all virtual machine scale sets in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:


Arguments:

Name Type Default Required
filter string null No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "deallocate-vmss",
  "provider": {
    "func": "deallocate_vmss",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: deallocate-vmss
provider:
  func: deallocate_vmss
  module: chaosazure.vmss.actions
  type: python
type: action

delete_vmss

Type action
Module chaosazure.vmss.actions
Name delete_vmss
Return None

Delete a virtual machine scale set instance at random.

Be aware: Deleting a VMSS instance is an invasive action. You will not be able to recover the VMSS instance once you deleted it.

– filter : str Filter the virtual machine scale set. If the filter is omitted all virtual machine scale sets in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:


Arguments:

Name Type Default Required
filter string null No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "delete-vmss",
  "provider": {
    "func": "delete_vmss",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: delete-vmss
provider:
  func: delete_vmss
  module: chaosazure.vmss.actions
  type: python
type: action

fill_disk

Type action
Module chaosazure.vmss.actions
Name fill_disk
Return None

Fill the VMSS machine disk with random data. Similar to the fill_disk action of the machine.actions module.

Signature:


Arguments:

Name Type Default Required
filter string null No
duration integer 120 No
timeout integer 60 No
size integer 1000 No
path string null No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "fill-disk",
  "provider": {
    "func": "fill_disk",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: fill-disk
provider:
  func: fill_disk
  module: chaosazure.vmss.actions
  type: python
type: action

network_latency

Type action
Module chaosazure.vmss.actions
Name network_latency
Return None

Increases the response time of the virtual machine. Similar to the network_latency action of the machine.actions module.

Signature:


Arguments:

Name Type Default Required
filter string null No
duration integer 60 No
delay integer 200 No
jitter integer 50 No
timeout integer 60 No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "network-latency",
  "provider": {
    "func": "network_latency",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: network-latency
provider:
  func: network_latency
  module: chaosazure.vmss.actions
  type: python
type: action

restart_vmss

Type action
Module chaosazure.vmss.actions
Name restart_vmss
Return None

Restart a virtual machine scale set instance at random.

– filter : str Filter the virtual machine scale set. If the filter is omitted all virtual machine scale sets in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:


Arguments:

Name Type Default Required
filter string null No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "restart-vmss",
  "provider": {
    "func": "restart_vmss",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: restart-vmss
provider:
  func: restart_vmss
  module: chaosazure.vmss.actions
  type: python
type: action

stop_vmss

Type action
Module chaosazure.vmss.actions
Name stop_vmss
Return None

Stops instances from the filtered scale set either at random or by a defined instance criteria.

– filter : str Filter the virtual machine scale set. If the filter is omitted all virtual machine scale sets in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’ instance_criteria : Iterable[Mapping[str, any]] Allows specification of criteria for selection of a given virtual machine scale set instance. If the instance_criteria is omitted, an instance will be chosen at random. All of the criteria within each item of the Iterable must match, i.e. AND logic is applied. The first item with all matching criterion will be used to select the instance. Criteria example: [ {“name”: “myVMSSInstance1”}, { “name”: “myVMSSInstance2”, “instanceId”: “2” } {“instanceId”: “3”}, ] If the instances include two items. One with name = myVMSSInstance4 and instanceId = 2. The other with name = myVMSSInstance2 and instanceId = 3. The criteria {“instanceId”: “3”} will be the first match since both the name and the instanceId did not match on the first criteria.

Signature:


Arguments:

Name Type Default Required
filter string null No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "stop-vmss",
  "provider": {
    "func": "stop_vmss",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: stop-vmss
provider:
  func: stop_vmss
  module: chaosazure.vmss.actions
  type: python
type: action

stress_vmss_instance_cpu

Type action
Module chaosazure.vmss.actions
Name stress_vmss_instance_cpu
Return None

Signature:


Arguments:

Name Type Default Required
filter string null No
duration integer 120 No
timeout integer 60 No
instance_criteria object null No

Usage:

{
  "type": "action",
  "name": "stress-vmss-instance-cpu",
  "provider": {
    "func": "stress_vmss_instance_cpu",
    "type": "python",
    "module": "chaosazure.vmss.actions"
  }
}
name: stress-vmss-instance-cpu
provider:
  func: stress_vmss_instance_cpu
  module: chaosazure.vmss.actions
  type: python
type: action

webapp


delete_webapp

Type action
Module chaosazure.webapp.actions
Name delete_webapp
Return None

Delete a web app at random.

***Be aware**: Deleting a web app is an invasive action. You will not be able to recover the web app once you deleted it.

– filter : str Filter the web apps. If the filter is omitted all web apps in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def delete_webapp(filter: str = None,
                  configuration: Dict[str, Dict[str, str]] = None,
                  secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "delete-webapp",
  "provider": {
    "func": "delete_webapp",
    "type": "python",
    "module": "chaosazure.webapp.actions"
  }
}
name: delete-webapp
provider:
  func: delete_webapp
  module: chaosazure.webapp.actions
  type: python
type: action

restart_webapp

Type action
Module chaosazure.webapp.actions
Name restart_webapp
Return None

Restart a web app at random.

– filter : str Filter the web apps. If the filter is omitted all web apps in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def restart_webapp(filter: str = None,
                   configuration: Dict[str, Dict[str, str]] = None,
                   secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "restart-webapp",
  "provider": {
    "func": "restart_webapp",
    "type": "python",
    "module": "chaosazure.webapp.actions"
  }
}
name: restart-webapp
provider:
  func: restart_webapp
  module: chaosazure.webapp.actions
  type: python
type: action

start_webapp

Type action
Module chaosazure.webapp.actions
Name start_webapp
Return None

Start a web app at random.

– filter : str Filter the web apps. If the filter is omitted all web apps in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def start_webapp(filter: str = None,
                 configuration: Dict[str, Dict[str, str]] = None,
                 secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "start-webapp",
  "provider": {
    "func": "start_webapp",
    "type": "python",
    "module": "chaosazure.webapp.actions"
  }
}
name: start-webapp
provider:
  func: start_webapp
  module: chaosazure.webapp.actions
  type: python
type: action

stop_webapp

Type action
Module chaosazure.webapp.actions
Name stop_webapp
Return None

Stop a web app at random.

– filter : str Filter the web apps. If the filter is omitted all web apps in the subscription will be selected as potential chaos candidates. Filtering example: ‘where resourceGroup==”myresourcegroup” and name=”myresourcename”’

Signature:

def stop_webapp(filter: str = None,
                configuration: Dict[str, Dict[str, str]] = None,
                secrets: Dict[str, Dict[str, str]] = None):
    pass

Arguments:

Name Type Default Required
filter string null No

Usage:

{
  "type": "action",
  "name": "stop-webapp",
  "provider": {
    "func": "stop_webapp",
    "type": "python",
    "module": "chaosazure.webapp.actions"
  }
}
name: stop-webapp
provider:
  func: stop_webapp
  module: chaosazure.webapp.actions
  type: python
type: action