Skip to main content

VMware Windows Disk Stress

VMware Windows Disk Stress applies stress on the disk resources on Windows OS based VMware VM.

  • It checks the performance of the application running on the VMware Windows VMs under disk stress conditions.

VMware Windows Disk Stress

Use cases

  • VMware Windows Disk Stress determines the resilience of an application when stress is applied on the disk resources of a VMware Windows virtual machine.
  • VMware Windows Disk Stress simulates the situation of high disk usage for processes running on the application, which degrades their performance.
  • It also helps verify the application's ability to handle disk failures and its failover mechanisms.

Prerequisites

  • Kubernetes > 1.16 is required to execute this fault.

  • Execution plane should be connected to vCenter and host vCenter on port 443.

  • VMware tool should be installed on the target VM with remote execution enabled.

  • Use built-in Administrator user for the experiment. Learn how to enable the built-in Administrator user in Windows.

  • The VM should be in a healthy state before and after injecting chaos.

  • Kubernetes secret has to be created that has the Vcenter credentials in the CHAOS_NAMESPACE.

  • Ensure the installation of Diskspd, a critical dependency for this experiment. Refer to the linked documentation for installation guidance.

  • VM credentials can be passed as secrets or as a chaos enginer environment variable.

apiVersion: v1
kind: Secret
metadata:
name: vcenter-secret
namespace: litmus
type: Opaque
stringData:
VCENTERSERVER: XXXXXXXXXXX
VCENTERUSER: XXXXXXXXXXXXX
VCENTERPASS: XXXXXXXXXXXXX

Mandatory tunables

Tunable Description Notes
VM_NAME Name of the target VM. For example, win-vm-1
VM_USER_NAME Username of the target VM. For example, vm-user.
VM_PASSWORD User password for the target VM. For example, 1234. Note: You can take the password from secret as well.

Optional tunables

Tunable Description Notes
MEMORY_CONSUMPTION Amount of Memory to consume in MB. Default: 1024. For more information, go to memory consumption.
BLOCK_SIZE_IN_KILOBYTES Block size for disk write in KB. Default: 128. For more information, go to block size.
WRITE_PERCENTAGE Percentage of total disk write. Default: 100. For more information, go to write percentage.
NUMBER_OF_WORKERS Number of workers involved in disk write. Default: 2. For more information, go to number of workers.
DISK_PATH Path of disk to apply stress. For example, C:\. For more information, go to disk path.
PATH_OF_DISKSPD Path of the Diskspd binary in the VM. For example, C:\Program Files\Diskspd\. For more information, go to path of Diskpd.
TOTAL_CHAOS_DURATION Duration that you specify, through which chaos is injected into the target resource (in seconds). Default: 60 s. For more information, go to duration of the chaos.
RAMP_TIME Period to wait before and after injecting chaos (in seconds). Default: 0 s. For more information, go to ramp time.
SEQUENCE Sequence of chaos execution for multiple instances. Default: parallel. Supports serial and parallel sequence. For more information, go to sequence of chaos execution.
DEFAULT_HEALTH_CHECKDetermines if you wish to run the default health check which is present inside the fault. Default: 'true'. For more information, go to default health check.

Memory consumption

The MEMORY_CONSUMPTION environment variable applies stress on the target Windows VM for a specific duration.

Use the following example to specify Memory consumption:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-disk-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Memory consumption in MB
- name: MEMORY_CONSUMPTION
value: '1024'

Block size

The BLOCK_SIZE_IN_KILOBYTES environment variable specifies the block size for disk write in KB.

Use the following example to specify block size:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-disk-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Block size for disk write in KB
- name: BLOCK_SIZE_IN_KILOBYTES
value: '128'

Write percentage

The WRITE_PERCENTAGE environment variable specifies the percentage of total disk write.

Use the following example to specify write percentage:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-disk-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Percentage of total disk write
- name: WRITE_PERCENTAGE
value: '100'

Number of workers

The NUMBER_OF_WORKERS environment variable specifies the number of workers involved in disk write.

Use the following example to specify the number of workers:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-disk-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Number of workers involved in disk write
- name: NUMBER_OF_WORKERS
value: '2'

Disk path

The DISK_PATH environment variable specifies the path of disk to apply stress.

Use the following example to specify the disk path:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-disk-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Path of disk to apply stress
- name: DISK_PATH
value: 'C:\\'

Path of Diskspd

The PATH_OF_DISKSPD environment variable specifies the path of the Diskspd tool in the VM.

Use the following example to specify the path of Diskspd:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-disk-stress
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Path of the Diskspd tool in the VM
- name: PATH_OF_DISKSPD
value: 'C:\\Program Files\\Diskspd\\'