Skip to main content

VMware Windows Memory hog

VMware Windows Memory hog applies stress on the Memory resources on Windows OS based VMware VM.

  • It checks the performance of the application running on the VMware Windows VMs.

VMware Windows Memory Hog

Use cases

  • VMware Windows Memory hog determines the resilience of an application when stress is applied on the Memory resources of a VMware Windows virtual machine.
  • VMware Windows Memory hog simulates the situation of lack of Memory for processes running on the application, which degrades their performance.
  • It verifies the autopilot functionality of services or application on the VM.
note
  • 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.

  • Adequate vCenter permissions should be provided to access the hosts and the VMs.

  • 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 installation of Testlimit on the target VM, a prerequisite for this experiment. Execute the fault using the built-in Administrator user to ensure permissions for memory stress testing. Instructions to enable the built-in Administrator in Windows.

  • 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

Fault tunables

Mandatory fields

Variables 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 fields

Variables Description Notes
MEMORY_CONSUMPTION Amount of Memory to consume in MB. Default: 0.
MEMORY_PERCENTAGE Percentage of total Memory to consume. Default: 50.
TOTAL_CHAOS_DURATION Duration that you specify, through which chaos is injected into the target resource (in seconds). Default: 60s.
RAMP_TIME Period to wait before and after injecting chaos (in seconds). For example, 30s.
SEQUENCE Sequence of chaos execution for multiple instances. Default: parallel. Supports serial sequence as well.

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-memory-hog
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Memory consumption in MB
- name: MEMORY_CONSUMPTION
value: '1024'

Memory Percentage

The MEMORY_PERCENTAGE environment variable applies stress on the target Windows VM for a specific duration. It consumes the specified percentage of the total Memory resources.

Use the following example to specify Memory percentage:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-memory-hog
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Memory percentage to consume
- name: MEMORY_PERCENTAGE
value: '50'