Quickstart: Create and run a chaos experiment using Azure Chaos Studio
Get started with Chaos Studio by using VM shutdown service-direct experiment to make your service more resilient to that failure in real-world.
Prerequisites
- An Azure subscription. If you don't have an Azure subscription, create an Azure free account before you begin.
- A Linux virtual machine. If you do not have a virtual machine, you can follow these steps to create one.
Register the Chaos Studio resource provider
If this is your first time using Chaos Studio, you must first register the Chaos Studio resource provider before onboarding resources and creating an experiment. This must be done for each subscription where you will be using Chaos Studio.
- Open the Azure portal.
- Search for Subscriptions and open the subscription management page.
- Click on the subscription where you will be using Chaos Studio.
- In the left-hand navigation, click on Resource providers.
- In the list of resource providers that appears, search for Microsoft.Chaos.
- Click on the Microsoft.Chaos provider, and click the Register button.
Create an Azure resource supported by Chaos Studio
Create an azure resource and ensure this is one of the supported fault providers. Also validate if this resource is being created in the region where Chaos Studio is available. In this experiment we choose an Azure Virtual Machine which is one of the supported fault providers for Chaos Studio.
Enable Chaos Studio on the Virtual Machine you created
Open the Azure portal.
Search for Chaos Studio (preview) in the search bar.
Click on Targets and navigate to your VM created.
Check the box next to your VM created and click Enable targets then Enable service-direct targets from the dropdown menu.
A notification will appear indicating that the resource(s) selected were successfully enabled.
Create an experiment
Click on Experiments.
Click Add an experiment.
Fill in the Subscription, Resource Group, and Location where you want to deploy the chaos experiment. Give your experiment a Name. Click Next : Experiment designer >
You are now in the Chaos Studio experiment designer. Give a friendly name to your Step and Branch, then click Add fault.
Select VM Shutdown from the dropdown, then fill in the Duration with the number of minutes you want the failure to last.
Click Next: Target resources >.
Click Add.
Verify that your experiment looks correct, then click Review + create, then Create.
Give experiment permission to your Virtual Machine
Navigate to your Virtual Machine and click on Access control (IAM).
Click Add
Click Add role assignment
Search for Virtual Machine Contributor and select the role. Click Next.
Click Select members and search for your experiment name. Select your experiment and click Select.
Click Review + assign then Review + assign.
Run the chaos experiment
Open the Azure portal:
- If using an @microsoft.com account, click this link.
- If using an external account, click this link.
Check the box next to the experiments name and click Start Experiment.
Click Yes to confirm you want to start the chaos experiment.
(Optional) Click on the experiment name to see a detailed view of the execution status of the experiment.
Clean up resources
Check the box next to the experiment name and click Delete.
Click Yes to confirm you want to delete the experiment.
Search the VM that you created on the Azure portal search bar.
Click on Delete to avoid being charged for the resource.
Next steps
Now that you have run a VM shutdown service-direct experiment, you are ready to:
Feedback
Submit and view feedback for