Skip to main content

VMware Windows Service Stop

VMware Windows Service Stop simulates a service stop scenario on Windows OS based VMware VM.

  • It checks the performance of the application running on the VMware Windows VMs under service stop conditions.

VMware Windows Service Stop

Use cases

  • VMware Windows Service Stop determines the resilience of an application when a service stop scenario is simulated on a VMware Windows virtual machine.
  • VMware Windows Service Stop simulates the situation of service stop for services running on the application, which degrades their performance.
  • It also helps verify the application's ability to handle service failures and its failover mechanisms.
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.

  • Run the fault with a user possessing admin rights, preferably the built-in Administrator, to guarantee permissions for memory stress testing. See how 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.
SERVICE_NAMES Comma separated list of service names to stop. For example, service1,service2

Optional fields

Variables Description Notes
FORCE If set to "enable", the service will be forcefully stopped. Default: enable.
SELF_HEALING_SERVICE If set to "enable", the service will be restarted after chaos injection. Default: disable.
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). Default: 0s.
SEQUENCE Sequence of chaos execution for multiple instances. Default: parallel. Supports serial sequence as well.

Service Names

The SERVICE_NAMES environment variable specifies the service names to stop on the target Windows VM.

Use the following example to specify service names:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-service-stop
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Service names to stop
- name: SERVICE_NAMES
value: 'service1,service2'

Force

The FORCE environment variable specifies whether the service should be forcefully stopped.

Use the following example to enable forceful stopping:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-service-stop
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Enable forceful stopping
- name: FORCE
value: 'enable'

Self Healing Service

The SELF_HEALING_SERVICE environment variable specifies whether the service should be restarted after chaos injection.

Use the following example to enable self healing service:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: vmware-windows-service-stop
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Enable self healing service
- name: SELF_HEALING_SERVICE
value: 'enable'