VMware IO stress
VMware IO stress causes disk stress on the target VMware VMs. It aims to verify the resilience of applications that share this disk resource with the VM.
Usage
View the uses of the fault
Prerequisites
- Kubernetes > 1.16
- Execution plane is connected to vCenter and the hosts on port 443.
- VMware tool is installed on the target VM with remote execution enabled.
- Adequate vCenter permissions to access the hosts and the VMs.
- Create a Kubernetes secret that has the Vcenter credentials in the
CHAOS_NAMESPACE
. Below is a sample secret file:
apiVersion: v1
kind: Secret
metadata:
name: vcenter-secret
namespace: litmus
type: Opaque
stringData:
VCENTERSERVER: XXXXXXXXXXX
VCENTERUSER: XXXXXXXXXXXXX
VCENTERPASS: XXXXXXXXXXXXX
Note
You can pass the VM credentials as secrets or as a ChaosEngine
environment variable.
Default validations
The VM should be in a healthy state.
Fault tunables
Fault tunables
Mandatory fields
Variables | Description | Notes |
---|---|---|
VM_NAME | Name of the target VM. | For example, ubuntu-vm-1 . |
Optional fields
Variables | Description | Notes |
---|---|---|
FILESYSTEM_UTILIZATION_PERCENTAGE | Specify the size as a percentage of free space on the file system. | For example, 40 . |
FILESYSTEM_UTILIZATION_BYTES | Specify the size in gigabytes(GB). FILESYSTEM_UTILIZATION_PERCENTAGE and FILESYSTEM_UTILIZATION_BYTES environment variables are mutually exclusive. If both are provided, FILESYSTEM_UTILIZATION_PERCENTAGE takes precedence. | For example, 100 |
NUMBER_OF_WORKERS | Number of I/O workers involved in I/O disk stress. | Defaults to 4 |
VOLUME_MOUNT_PATH | Location that points to the volume mount path used in I/O stress. | For example, /Users/admin/disk-02 . |
CPU_CORES | Number of CPU cores that are subject to CPU stress. | Defaults to 1. |
TOTAL_CHAOS_DURATION | Duration that you specify, through which chaos is injected into the target resource (in seconds). | Defaults to 30s. |
CHAOS_INTERVAL | Time interval between two successive instance terminations (in seconds). | Defaults to 30s. |
SEQUENCE | Sequence of chaos execution for multiple instances. | Defaults to parallel. Supports serial sequence as well. |
RAMP_TIME | Period to wait before and after injecting chaos (in seconds). | For example, 30s. |
Fault examples
Common fault tunables
Refer to the common attributes to tune the common tunables for all the faults.
Filesystem utilization percentage
It specifes the size as a percentage of free space on the file system. You can tune it using the FILESYSTEM_UTILIZATION_PERCENTAGE
environment variable.
Use the following example to tune it:
# io-stress in the VMware VM
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-io-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# percentage of free space of file system, need to be stressed
- name: FILESYSTEM_UTILIZATION_PERCENTAGE
value: '10'
Filesystem utilization bytes
It specifies the amount of free space on the file system in gigabytes(GB). You can tune it using the FILESYSTEM_UTILIZATION_BYTES
environment variable. FILESYSTEM_UTILIZATION_BYTES
is mutually exclusive with the FILESYSTEM_UTILIZATION_PERCENTAGE
environment variable. If both FILESYSTEM_UTILIZATION_PERCENTAGE
and FILESYSTEM_UTILIZATION_BYTES
environment variables are set, FILESYSTEM_UTILIZATION_PERCENTAGE
takes precendence.
Use the following example to tune it:
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-io-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# size of io to be stressed
- name: FILESYSTEM_UTILIZATION_BYTES
value: '1' #in GB
Mount path
It specifies the location that points to the volume mount path used in I/O stress. You can tune it using the VOLUME_MOUNT_PATH
environment variable.
Use the following example to tune it:
# io-stress in the VMware VM
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-io-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# path need to be stressed/filled
- name: VOLUME_MOUNT_PATH
value: '/some-dir-in-container'
# size of io to be stressed
- name: FILESYSTEM_UTILIZATION_BYTES
value: '1' #in GB
Workers for stress
It specifies the worker's count for stress. You can tune it using the NUMBER_OF_WORKERS
environment variable.
Use the following example to tune it:
# io-stress in the VMware VM
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-io-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# number of io workers
- name: NUMBER_OF_WORKERS
value: '4'
# size of io to be stressed
- name: FILESYSTEM_UTILIZATION_BYTES
value: '1' #in GB