Skip to main content

VMware service stop

VMware service stop stops the target system services running on a Linux OS based VMware VM. It determines the performance and resilience of the application (or service) running on the VMware VMs.

VMware ServiceStop

Use cases

  • VMware service stop determines the resilience of an application to random halts.
  • It determines how efficiently an application recovers and restarts the services.

Prerequisites

  • Kubernetes > 1.16 is required to execute this fault.
  • Execution plane should be connected to vCenter and host vCenter on port 443.
  • The VM should be in a healthy state before and after injecting chaos.
  • VMware tool should be installed on the target VM with remote execution enabled.
  • The target processes should exist within the VM.
  • Appropriate vCenter permissions should be provided to access the hosts and the VMs.
  • Kubernetes secret has to be created that has the Vcenter credentials in the CHAOS_NAMESPACE. VM credentials can be passed as secrets or as a ChaosEngine environment variable. 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

Mandatory tunables

Tunable Description Notes
VM_NAME Name of the VM where the target processes reside. For example, ubuntu-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 Name of the target service. For example, nginx. For more information, go to service name.

Optional tunables

Tunable Description Notes
SELF_HEALING_SERVICES Set to enable if the target service is self-healing. Defaults to disable. For more information, go to self-healing services.
TOTAL_CHAOS_DURATION Duration that you specify, through which chaos is injected into the target resource (in seconds). Defaults to 30s. For more information, go to duration of the chaos.
CHAOS_INTERVAL Time interval between two successive instance terminations (in seconds). Defaults to 30s. For more information, go to chaos interval.
SEQUENCE Sequence of chaos execution for multiple instances. Defaults to parallel. Supports serial sequence as well. For more information, go to sequence of chaos execution.
RAMP_TIME Period to wait before and after injecting chaos (in seconds). For example, 30s. For more information, go to ramp time.
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.

Self-healing services

It specifies whether the target service has the ability to self-heal. It is self-healing if it is set to enable. Its default value is disable. Tune it by using the SELF_HEALING_SERVICES environment variable.

Use the following example to tune this:

# Service Stop in the VMware VM
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-service-stop
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Name of service
- name: SERVICE_NAME
value: 'nginx'
# Self-heling ability
- name: SELF_HEALING_SERVICES
value: 'enable'

Service name

It specifies the name of the target service running on a particular VM. Tune it by using the SERVICE_NAME environment variable.

Use the following example to tune this:

# Service Stop in the VMware VM
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-service-stop
spec:
components:
env:
# Name of the VM
- name: VM_NAME
value: 'test-vm-01'
# Name of service
- name: SERVICE_NAME
value: 'nginx'