Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chaos-mesh/chaos-mesh/llms.txt

Use this file to discover all available pages before exploring further.

AzureChaos allows you to inject faults into Azure services, including stopping virtual machines, restarting VMs, and detaching disks.

API Version and Kind

apiVersion: chaos-mesh.org/v1alpha1
kind: AzureChaos

Metadata

Standard Kubernetes object metadata.
metadata.name
string
required
Name of the AzureChaos resource.
metadata.namespace
string
Namespace of the AzureChaos resource. Defaults to default.

Spec Fields

spec
AzureChaosSpec
required
Defines the behavior of the Azure chaos experiment.

AzureChaosSpec

action
AzureChaosAction
required
Specific Azure chaos action to perform.Enum values:
  • vm-stop - Stop a virtual machine
  • vm-restart - Restart a virtual machine (one-shot)
  • disk-detach - Detach a disk from a virtual machine
Default: vm-stop
duration
*string
Duration of the chaos action.A duration string with format like "300ms", "1.5h", or "2h45m".Valid time units: ns, us (µs), ms, s, m, h
subscriptionID
string
required
ID of the Azure subscription.Part of AzureSelector (inline).
subscriptionID: "12345678-1234-1234-1234-123456789012"
resourceGroupName
string
required
Name of the resource group.Part of AzureSelector (inline).
resourceGroupName: "my-resource-group"
vmName
string
required
Name of the virtual machine.Part of AzureSelector (inline).
vmName: "my-vm"
diskName
*string
Name of the disk. Required when action is disk-detach.Part of AzureSelector (inline).
diskName: "my-data-disk"
lun
*int
Logical Unit Number of the data disk. Required when action is disk-detach.Part of AzureSelector (inline).
lun: 0
secretName
*string
Name of Kubernetes secret containing Azure credentials.Part of AzureSelector (inline).
remoteCluster
string
Name of the remote cluster where the chaos will be deployed. If not specified, chaos is applied to the local cluster.Part of AzureSelector (inline).

Status Fields

status
AzureChaosStatus
Current status of the chaos experiment.

AzureChaosStatus

conditions
[]ChaosCondition
Current global conditions. See ChaosStatus in Common Types.
experiment
ExperimentStatus
Last known experiment state including desired phase and container records.

Examples

Stop Virtual Machine

apiVersion: chaos-mesh.org/v1alpha1
kind: AzureChaos
metadata:
  name: vm-stop
  namespace: chaos-mesh
spec:
  action: vm-stop
  secretName: azure-credentials
  subscriptionID: 12345678-1234-1234-1234-123456789012
  resourceGroupName: my-resource-group
  vmName: my-vm
  duration: 5m

Detach Disk

apiVersion: chaos-mesh.org/v1alpha1
kind: AzureChaos
metadata:
  name: disk-detach
  namespace: chaos-mesh
spec:
  action: disk-detach
  secretName: azure-credentials
  subscriptionID: 12345678-1234-1234-1234-123456789012
  resourceGroupName: prod-resources
  vmName: database-vm
  diskName: data-disk-1
  lun: 0
  duration: 3m