---
description: How to experiment with your datacenter designs.
---

# Create an Experiment

After designing a datacenter in OpenDC, the next step is to experiment with the design using OpenDC's built-in
simulator, in order to analyze its performance and compare it against other designs.

In OpenDC, we use the concept of portfolios of scenarios to experiment with datacenter designs. In the next sections, we
will explain how you can use these powerful concepts for the experimental analysis of your designs.

## Create a Portfolio
OpenDC organizes multiple scenarios (experiments) into a **portfolio**. Each portfolio is composed of a base scenario,
a set of candidate scenarios given by the user and a set of targets (e.g., metrics) used to compare scenarios.

To create a new portfolio, open a project in the OpenDC web interface and click on ‘+ New Portfolio’ in the top right
corner of the portfolio table. This opens a modal with the following options:

1. **Name**: the name of your portfolio.
2. **Metrics**: the metrics that you want to use to compare the scenarios in the portfolio.
3. **Repeats per Scenario**: the number of times each scenario should be simulated (to account for variance).

## Create Scenarios

A **scenario** represents a point in the datacenter design space that should be explored. It consists of a combination
of workload, topology, and a set of operational phenomena. Phenomena can include correlated failures, performance
variability, security breaches, etc., allowing the scenarios to more accurately capture the real-world operations.

The baseline for comparison in a portfolio is the **base scenario**. It represents the status quo of the infrastructure
or, when planning infrastructure from scratch, it consists of very simple base workloads and topologies.
The other scenarios in a portfolio, called the **candidate scenarios**, represent changes to the configuration
that might be of interest to the datacenter designer. Dividing scenarios into these two categories ensures that any
comparative insights provided by OpenDC are meaningful within the context of the current architecture.

To create a new scenario, open a portfolio in the OpenDC web interface and click on ‘+ New Scenario’ in the top right
corner of the scenario table. This opens a modal with the following options (as shown in [Figure 1](#explore)):

1. **Name**: the name of your scenario. The first scenario of a portfolio is always called the _Base scenario_.
2. **Workload**: the applications (e.g., virtual machines, workflows, functions) that consume resources in your
                 datacenter.
    1. **Workload Trace**: A dataset that characterizes the historical runtime behavior of virtual machines in the
   workload over time.
    2. **Load Sampling Fraction**: The percentage of the workload that should be simulated (e.g., 10% of virtual
                                   machines in the workload trace).
3. **Environment**:
    1. **Topology**: one of the topologies of the project to use for the scenario.
    2. **Scheduler**: the algorithm that decides on which hosts the virtual machines should be placed.
4. **Operational Phenomena**:
    1. **Failures**: a flag to enable stochastic host failures during simulation.
    2. **Performance interference**: a flag to enable performance interference between virtual machines (only available
                                     for a subset of traces).

Once you have created the scenario, it will be enqueued for simulation. Usually the results of the simulation should be
available within one minute after creation. However, if there are lots of queued simulation jobs, it might take a bit
longer.

<figure className="figure" id="explore">
    <img src={require("@site/src/components/HomepageFeatures/screenshot-explore.png").default} alt="Creating a new scenario in OpenDC" />
    <figcaption>Creating a new scenario in OpenDC. The user can select the topology, workload, and operational phenomena.</figcaption>
</figure>

## Analyze Results

After creating scenarios, the scenario table will show whether the simulation is still pending, completed successfully,
or failed for some reason. If the scenario was simulated successfully, its results will become visible on the ‘Results’
tab as shown in [Figure 2](#analysis).

<figure className="figure" id="analysis">
    <img src={require("@site/src/components/HomepageFeatures/screenshot-results.png").default} alt="Analysis of results reported by OpenDC" />
    <figcaption>Plots and visual summaries generated by OpenDC comparing different scenarios.</figcaption>
</figure>

This tab will show the selected metrics for the portfolio and allow you to compare their values for different scenarios.
