VMware disk loss
VMware disk loss detaches the disks that are attached to a Linux OS based VMware VM.
Usage
View the uses of the fault
This fault helps determine how resilient an application is to the unplanned scaling of K8s pods.
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
Default validations
- The VM should be in a healthy state.
- The target disks should be attached to the VM.
Fault tunables
Fault tunables
Mandatory fields
Variables | Description | Notes |
---|---|---|
APP_VM_MOIDS | MOIDs of the VMware instance. After you open the VM in VCenter WebClient, you can find the MOID in the address field (VirtualMachine:vm-5365). Alternatively you can use the CLI to fetch the MOID. | For example, vm-5365 . |
VIRTUAL_DISK_NAMES | Name of the target disks provided as comma-separated values. | For example, disk-1.vmdk,disk-2.vmdk . |
Optional fields
Variables | Description | Notes |
---|---|---|
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.
Virtual disk names
It contains the name of the target disks attached to a particular VM. You can tune it using the VIRTUAL_DISK_NAMES
environment variable.
Use the following example to tune it:
# Disk loss in the VMware VM
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: VMware-disk-loss
spec:
components:
env:
# Name of the VM
- name: APP_VM_MOIDS
value: 'vm-2055'
# Name of target disk
- name: VIRTUAL_DISK_NAMES
value: 'disk-1.vmdk'