## Create a provisioning rule for VMware

# Create a provisioning rule for VMware

Provisioning rules enable an administrator to select which vCenter resources (datacenter, network, and folder) are used to provision virtual machines for a specific virtual machine category (such as Dev, QA, or Prod) or for any category if the Category field in the rule is left empty.

Before you begin

About this task

**Rule Order**

Each rule has an **Order** field that defines the sequence for evaluating the
rules. The rules are evaluated by the Select Datacenter,
Network, and Folder activity.

When that activity runs, it finds all the provisioning rules that apply to a
particular vCenter instance and category (rules with a blank category match
*any* category), and then uses the provisioning rule with the lowest order
value. By carefully choosing order values for provisioning rules, you can ensure
that rules for specific categories are evaluated *before* (low order values)
provisioning rules for *any* category (high order values).

**Weight**

You may want more than one datacenter, network, or folder to be used for virtual machines on a particular vCenter instance and category. For example, you have a vCenter containing two datacenters, and you'd like to provision 75% of the virtual machines to one datacenter, and 25% to the other.

You can do this by creating two provisioning rules for the particular vCenter and
category with the same order value for each. Multiple rules with the same
**vCenter**, **Category**, and **Order** values trigger this special
behavior. Give each provisioning rule a **Weight** value proportional to the
percentage of the time you want the rule to be used. For this example, you might
choose **Weight** values of 300 and 100. Any other numbers in the same proportion
would also work, like 3 and 1. To check the percentage for any given rule, calculate
the **Weight** value of that rule divided by the sum of the **Weight** values
for all the rules with the same vCenter, category, and order value. In the example,
the calculations would be 300 / (300 + 100) = 75%, and 100 / (300 + 100) = 25%,
which meets the goal.

**Creating a Provisioning Rule**

Procedure

- Examples of provisioning rule assignments
The VMware base system includes several example assignments. For example, one example assignment filters networks for a cluster and assigns the network sys_ids to a variable named networkIds for use by any subsequent rule (as described in the instructions for the Set by filter assignment type).