NetHavoc Overview

NetHavoc is a powerful feature added to NetStorm, which allows users to test the resilience of the applications. NetHavoc can be used to inject various faults into the application infrastructure during a load test. The after effects of the fault injection can be monitored through NetStorm’s powerful monitoring capabilities.

Introduction

Before going through the list of NetHavoc APIs, the user must understand the various fields and variables which are discussed in the following sections.

Category

The available havocs are categorized in the following three categories:

  • Resource
  • State
  • Network

The fault types of each category are mentioned below.

Resource

The fault types of havocs available in Resource category are:

  1. NH_LINUX_BURN_CPU (CPU Consumption Havoc)
  2. NH_LINUX_FILL_DISK (Fill up Disk Havoc)

Network

The fault types of havocs available in Network category are:

  1. NH_LINUX_NW_CORRUPT (Network Packets Corruption)
  2. NH_LINUX_NW_LOSS (Network Packets Loss)
  3. NH_LINUX_NW_LATENCY (Network Latency)

State

The fault types of havocs available in State category are:

  1. NH_LINUX_APP_TERM (Application Termination Havoc)
  2. NH_AZ_TERM (Server Termination Havoc – Azure)

Test Run

This field is optional as it is used for showing the graphs in ND/NS mode for Running and Historical havocs.

Tier

This is a mandatory field. The host is also referred to as tier.

Server

This is a mandatory field. Server is where the user wants to configure / activate / schedule the havoc.

connectionType

This is a mandatory field and is used to make the connection to the target server. The available modes are:

  • connectionType=0 means SSH Mode
  • connectionType=1 means Cavisson Agent Mode

dateTime

This is a mandatory field and is used when the user wants to trigger or schedule the havoc. The format to write this field is HH:MM MM/DD/YYYY.

rampUp

This field is optional and is a part of the total duration for a havoc to be triggered. Need to pass the Duration for Ramp Up for triggered havoc. The format to write this field is HH:MM:SS.

rampDown

This field is optional and is a part of the total duration for havoc to be triggered. Need to pass the Duration for Ramp Down for triggered havoc. The format to write this field is HH:MM:SS.

stability

This is a mandatory field and is a part of the total duration for havoc to be triggered. Need to pass the Duration for Stability for triggered havoc. The format to write this field is HH:MM:SS.

Note: The total duration is summation of the above three fields, that is,
Total Duration = Ramp Up + Stability + Ramp Down

interfaceName

This field is required for the below mentioned havocs under the Network category only, the user needs to provide the interface for all the below havocs:

  • NH_LINUX_NW_CORRUPT (Network Packets Corruption)
  • NH_LINUX_NW_LOSS (Network Packets Loss)
  • NH_LINUX_NW_LATENCY (Network Latency)

timeMode

The time mode is categorized into the below three modes:

  • Specific
  • Current
  • Random

networkCorruptionValue

This field is to specify the percentage for Packet Loss and millisecond for Network Latency.

cpuLoadType

This field is used for NH_LINUX_BURN_CPU (CPU Consumption Havoc) under the Resource category.

  • 0 means CPU Filled by %
  • 1 means CPU Filled by Core

memoryPartition

This field is used for NH_LINUX_FILL_DISK (Fill up Disk Havoc) under the Resource Category.

faultId

This is an optional field. It is alphanumeric and is a unique ID generated when Havoc is configured in the system. It is used for other operations, such as Stopping, Deleting, Activating, and so on.

processType

This field is used for NH_LINUX_APP_TERM (Application Termination Havoc) under the State Category.

  • 1 means Application termination through Process ID
  • 0 means Application termination through Process Name

Security

Note: For every NetHavoc API, need to pass the token as in Queryparam.

preset

This field is used for fetching the havocs available in the system. The available options are Last 10 Minutes, Last 30 Minutes, Last 1 Hours, Last 2 Hours, Last 4 Hours, Last 6 Hours, Last 8 Hours, Last 12 Hours, Last 24 Hours.

startDate

This field is used for fetching the havocs available in the system by providing the start date when the ‘preset’ field is not used by the user. The format to write this field is HH:MM MM/DD/YYYY.

endDate

This field is used for fetching the havocs available in the system by providing the end date when the ‘preset’ field is not used by the user. The format to write this field is HH:MM MM/DD/YYYY.

List of APIs

Following is the list of NetHavoc APIs and their details:

Configure Havoc CPU %

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenValue
This request is for configuring the CPU % Consumption Havoc in the system. The minimum limit of CPU % Consumption is 10%. The maximum limit of CPU % Consumption is 80%.
Headers: Content-Type: application/json
Params: Token: tokenValue
Body: {“category”:”RESOURCE”,”faultType”:”NH_LINUX_BURN_CPU”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”14:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:05″,”cpuLoadValue”:”8″,”timeMode”:”Specific”,”cpuLoadType”:”0″}

Configure and Apply Havoc CPU %

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenValue
This request is for configuring and activating the CPU % Consumption Havoc in the system. The minimum limit of CPU % Consumption is 10%. The maximum limit of CPU % Consumption is 80%.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”RESOURCE”,”faultType”:”NH_LINUX_BURN_CPU”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”14:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:05″,”cpuLoadValue”:”8″,”timeMode”:”Specific”,”cpuLoadType”:”0″}

Configure Havoc CPU Core

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenValue
This request is for configuring the CPU Consumption Havoc on cores in the system. The user needs to provide the core to be filled up. The maximum limit for CPU core to be filled is one less than the number of cores available in the system. The minimum limit for CPU core to be filled is 1.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”RESOURCE”,”faultType”:”NH_LINUX_BURN_CPU”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.x”,”connectionType”:”0″,”dateTime”:”14:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:05″,”cpuLoadValue”:”8″,”timeMode”:”Specific”,”cpuLoadType”:”1″}

Configure and Apply Havoc CPU Core

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenValue
This request is for configuring and activating the CPU Consumption havoc on cores in the system. The user needs to provide the core to be filled up. The maximum limit for CPU core to be filled is one less than the number of cores available in the system. The minimum limit for CPU core to be filled is 1.
Headers: Content-Type: application/json
Params: Token: tokenValue
(Token to validate the request)
Body: {“category”:”RESOURCE”,”faultType”:”NH_LINUX_BURN_CPU”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”1″,”dateTime”:”14:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:05″,”cpuLoadValue”:”10000″,”timeMode”:”Current”,”cpuLoadType”:”0″}

Configure Havoc FillUpDisk

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenValue
This request is for configuring the Disk Fill Up Havoc in the system. The maximum limit of fill up disk is 80%.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”RESOURCE”,”faultType”:”NH_LINUX_FILL_DISK”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 07/02/2019″,”memoryPartition”:”xyz”,”fillUpDiskValue”:”10″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:01:00″,”timeMode”:”Current”}

Configure and Apply Havoc FillUpDisk

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenValue
This request is for configuring and activating the Disk Fill Up Havoc in the system. The maximum limit of fill up disk is 80%.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”RESOURCE”,”faultType”:”NH_LINUX_FILL_DISK”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 07/02/2019″,”memoryPartition”:”xyz”,”fillUpDiskValue”:”10″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:01:00″,”timeMode”:”Current”}

Configure Havoc Server Termination

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenValue
This request is for configuring the Server termination havoc in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”STATE”,”faultType”:”NH_AZ_TERM”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 07/02/2019″,”computerName”:”c”,”sTResourceGrpName”:”xx”,”sTUserName”:”viccc”,”sTPass”:”p”,”timeMode”:”Current”,”stability”:”00:01:00″}

Configure and Apply Havoc Server Termination

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenValue
This request is for configuring and activating the Server termination havoc in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”STATE”,”faultType”:”NH_AZ_TERM”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 07/02/2019″,”computerName”:”c”,”sTResourceGrpName”:”xx”,”sTUserName”:”viccc”,”sTPass”:”p”,”timeMode”:”Current”,”stability”:”00:01:00″}

Configure Havoc Application Termination ID

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenvalue
This request is for configuring the Application Termination havoc in the system.
Application termination can be done with two types:

  • Through Process ID
  • Through Process Name

processType:

  • 1 means Application termination through Process ID
  • 0 means Application termination through Process Name

Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”STATE”,”faultType”:”NH_LINUX_APP_TERM”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 15/06/2019″,”processValue”:”1″,”processType”:”1″,”timeMode”:”Current”}

Configure and Apply Havoc Application Termination ID

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenValue
This request is for configuring and activating the Application Termination havoc in the system.
Application termination can be done with two types:

  • Through Process ID
  • Through Process Name

processType:

  • 1 means Application termination through Process ID
  • 0 means Application termination through Process Name

Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”STATE”,”faultType”:”NH_LINUX_APP_TERM”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 15/06/2019″,”processValue”:”1″,”processType”:”1″,”timeMode”:”Current”}

Configure Havoc Application Termination Name

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenvalue
This request is used for configuring the Application Termination havoc in the system.
Application termination can be done with two types:

  • Through Process ID
  • Through Process Name

processType:

  • 1 means Application termination through Process ID
  • 0 means Application termination through Process Name

Headers: Content-Type: application/json
Params: Token: tokenValue
Body: {“category”:”STATE”,”faultType”:”NH_LINUX_APP_TERM”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 15/06/2019″,”processValue”:”1″,”processType”:”0″,”timeMode”:”Current”}

Configure and Apply Havoc Application Termination Name

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenvalue
This request used is for configuring and activating the Application Termination havoc in the system.
Application termination can be done with two types:

  • Through Process ID
  • Through Process Name

processType:

  • 1 means Application termination through Process ID
  • 0 means Application termination through Process Name

Headers: Content-Type: application/json
Params: Token: tokenValue
Body: {“category”:”STATE”,”faultType”:”NH_LINUX_APP_TERM”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”16:00 15/06/2019″,”processValue”:”1″,”processType”:”0″,”timeMode”:”Current”}

Configure Havoc Network Corruption

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenvalue
This request is for configuring the Network Packets Corruption havoc in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”STATE”,”faultType”:”NH_LINUX_NW_CORRUPT”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”networkCorruptionValue”:”0″}

Configure and Apply Havoc Network Corruption

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenvalue
This request is for configuring and activating the Network Packets Corruption havoc in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”STATE”,”faultType”:”NH_LINUX_NW_CORRUPT”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”networkCorruptionValue”:”0″}

Configure Havoc Network Loss

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenvalue
This request is for configuring the Network Packets Loss havoc in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”NETWORK”,”faultType”:”NH_LINUX_NW_LOSS”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”networkLossValue”:”1″}

Configure and Apply Havoc Network Loss

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenvalue
This request is for configuring and activating the Network Packets Loss havoc in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”NETWORK”,”faultType”:”NH_LINUX_NW_LOSS”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”networkLossValue”:”1″}

Configure Havoc Network Latency Specific

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenvalue
This request is used for configuring the Network Latency havoc in the system.
There are two modes to apply this fault:

  • Network Latency for Specific Time
  • Network Latency for Time Range

latencyType:

  • 0 Means on Specified time
  • 1 Means on Time Range

Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”NETWORK”,”faultType”:”NH_LINUX_NW_LATENCY”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”latencyStartRange”:”1″,”latencyType”:”0″}

Configure and Apply Havoc Network Latency Specific

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenvalue
This request is used for configuring and activating the Network Latency havoc in the system.
There are two modes to apply this fault:

  • Network Latency for Specific Time
  • Network Latency for Time Range

latencyType:

  • 0 Means on Specified time
  • 1 Means on Time Range

Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”NETWORK”,”faultType”:”NH_LINUX_NW_LATENCY”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”latencyStartRange”:”1″,”latencyType”:”0″}

Configure Havoc Network Latency Random

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/createHavoc?token=tokenvalue
This request is for configuring the Havoc in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”NETWORK”,”faultType”:”NH_LINUX_NW_LATENCY”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”latencyStartRange”:”1″,”latencyType”:”1″,”latencyEndRange”:”3″}

Configure and Apply Havoc Network Latency Random

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/addApplyHavoc?token=tokenvalue
This request is for configuring and activating the Network Latency havoc in the system.
There are two modes to apply this fault:

  • Network Latency for Specific Time
  • Network Latency for Time Range

latencyType:

  • 0 Means on Specified time
  • 1 Means on Time Range

Headers: Content-Type: application/json
Params: Token: tokenValue (Token to validate the request)
Body: {“category”:”NETWORK”,”faultType”:”NH_LINUX_NW_LATENCY”,”testRun”:”1027″,”tier”:”ABC”,”server”:”xx.xx.xx.xx”,”connectionType”:”0″,”dateTime”:”15:00 07/02/2019″,”rampUp”:”00:00:00″,”rampDown”:”00:00:00″,”stability”:”00:00:01″,”interfaceName”:”name”,”timeMode”:”Specific”,”latencyStartRange”:”1″,”latencyType”:”1″,”latencyEndRange”:”3″}

Activate Havoc

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/activateHavoc?token=tokenvalue
This request is for Activating the havoc which are already configured in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue
Body: {“faultId”:”NHM156207044301672414″,”server”:”xx.xx.xx.xx”}

Stop Havoc

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/stopHavoc?token=tokenvalue
This request is for Stopping the havoc which are already running in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue
Body: {“faultId”:”NHM156207044301672414″,”server”:”xx.xx.xx.xx”}

Delete Havoc

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/deleteHavoc?token=tokenvalue
This request is for Deleting the havoc which are already configured/Completed/Failed in the system.
Headers: Content-Type: application/json
Params: Token: tokenValue
Body: {“faultId”:”NHM156207044301672414″,”server”:”xx.xx.xx.xx”}

Read Havoc

URL: https://IP:Port/DashboardServer/netHavoc/NethavocDataService/readHavoc?token=tokenvalue
This request is used for fetching the havocs which are available in the system. A user can either provide the preset or the startDate & endDate. If both are provided, preset is chosen over startDate & endDate. The available presets are:

  • Last 10 Minutes
  • Last 30 Minutes
  • Last 1 Hour
  • Last 2 Hours
  • Last 4 Hours
  • Last 6 Hours
  • Last 8 Hours
  • Last 12 Hours
  • Last 24 Hours

startDate & endDate example: 16:00 06/15/2019 format – HH:MM MM/DD/YYYY
Filter is not applied on havocs which are in Running or Scheduled State.
Headers: Content-Type: application/json
Params: Token: tokenValue
Body: {“startDate”:”16:00 06/15/2019″,”endDate”:”16:00 06/15/2019″,”preset”:”Last 1 hour”}