Before we start talking about VMware Storage Policy-Based Management (SPBM), we should explain what it is and how it can help admins manage vSphere environments more efficiently.

SPBM provides a universal framework for different types of storage, whether they be vSAN, virtual volumes, input/output (I/O) filters, or other storage methods. It provides a universal control plane across multiple data services and storage solutions.

On one side there are storage capabilities of storage arrays—VMware vSAN and others, and on the other side there is virtual machine (VM) provisioning based on VM storage policies.

In between there is bidirectional communication between ESXi and vCenter Server (on one end) and storage arrays and entities on the other.

The admin can build different storage policies, select capabilities of the underlying storage array, and then apply the policies to VMs. It is possible to create tags and tag categories and then apply these to the storage medium to define their capabilities.

SPBM looks at the storage requirements found in policies associated with individual VMs and then places the VM on the right storage tier. The available capabilities vary by storage vendor.

After creating a storage policy, an admin can assign a VM (or just the data disk where an important database is located) to a more performant datastore or a subset of datastores without thinking of hardware that runs underneath.

Here is an example below.

VMware SPBM example

VMware SPBM example

How to create a storage policy

In this post, we'll create a VM storage policy based on tags.

One of the first actions when starting with SPBM is to tag the available datastores within our environment with custom metadata we must define. We'll have to create tags and tag categories.

The entire process of creating and managing storage policies usually has a few steps.

  • Populate the VM Storage Policies interface with appropriate data.
  • Create predefined storage policy components.
  • Create VM storage policies.
  • Apply the VM storage policies to the VMs.
  • Verify the compliance for the VM storage policies.

VMFS and NFS datastores are not represented by storage provider. These datastores show their capabilities and data services in the VM Storage Policies interface.

You can use tags to encode information about these datastores. As an example, we can tag VMFS datastores as VMFS-Gold and VMFS-Silver to differentiate different levels of service they provide.

Tags and custom attributes

Tags and custom attributes

Then you enter a meaningful name for the category. As an example in our case, we can simply use TestStoragePolicy.

Add objects to tag category

Add objects to tag category

Once we have created the tag category, we'll need to create tags.

For the sake of simplicity, let's call the tag GoldStorage.

Create a new tag

Create a new tag

Tag the VMware vSphere datastores

Now that we have successfully created a tag category and tags, we can tag our datastores with these tags.

We can do this by right-clicking the datastore and then going to Tags & Custom Attributes.

Click "Assign Tag"

And then select the tag from the list. You can have many tags here, but we only have one in this example.

Select the tag to assign to the datastore

Select the tag to assign to the datastore

Create VMware VM storage policies

So finally, we've got to the point where all we have left is to create a VM storage policy. We'll use the shortcut from the main UI, or we can also do this via Menu > Policies and Profiles.

Go to "Policies and Profiles" via the menu

Then click the VM Storage Policies icon and click Create VM Storage Policy.

Create a new VM storage policy

Create a new VM storage policy

You'll get a new window where you'll have to enter some details.

VM storage policy wizard

VM storage policy wizard

Pick host-based services or datastore-specific rules or both. In our case, I've only checked the datastore-specific rules because I just want to show how to use the tag-based ones.

Datastore specific and tag based placement rules

Datastore specific and tag based placement rules

Click Next and pick the tag category we've created earlier.

Add tag rules to filter datastores to use for placing VMs

Add tag rules to filter datastores to use for placing VMs

Then on the next screen, you will see the datastore you have tagged during one of the earlier steps.

Pick the compatible storage device

Pick the compatible storage device

Create a new VM or clone an existing VM to test the storage policy

Finally, we can test our storage policy by either creating a new VM or cloning an existing VM so we can test the storage placement based on tags.

With SPBM, upon creating a VM, the storage policy automates selecting the datastores that fulfill the requirements listed within the storage policy.

As you can see, when choosing our "test policy," we can choose the compatible storage of our datastore that we tagged in our earlier step.

And it lists this datastore as "compatible," so we're sure to use the datastore with a capability we specified via a tag.

Note: As you can see on the image below, you can even provision a new VM and separate VMDKs. Examples have different performance datastores assigned to "system" and "data" disks.

You can assign two separate policies to each of the VM's disks. You can assign a mission-critical (Gold) policy to the disk that is a database. At the same time, you can apply some other storage (Silver) policy to the VM's operating system (OS).

VM operations for initial placement

VM operations for initial placement

Final words

VM storage-based policy is a very rich feature, and using just a small part of it (via tags) can ease a bit of the administration burden.

When using this with specific vendor-provided storage, the storage capabilities surface automatically. VMware vSphere uses a provider called vStorage APIs for Storage Awareness (VASA). These application program interfaces (APIs) let vSphere vCenter recognize the capabilities of storage arrays.

Today's storage arrays provide tiered storage all in a single device. However, storage policies give you a better way of defining the performance you want and allow software-driven provisioning of new VMs.

Subscribe to 4sysops newsletter!

VM storage policy is about your VMs and their performance; vSphere admins have a powerful tool to manage VMware infrastructures.

  1. Yuri 2 years ago

    Hi Vladan!
    It stays inclean if we may use many tags for storage type with the same datastore? For example, we have three tiers – bronze, gold and platinum and set different tags to three datastores. It’s ok. But then we decided to add new datastore and add tag platinum to it. Next we create tag platinum-1 and decided to mark last platinum datastore as platinum-1 in addition to plain platinum. Would it be a supported or acceptable configuration? Or there might be ambiguity for vSphere which would lead to mutual incompatibility while placement should be decided?

  2. Author
    Vladan SEGET 2 years ago

    HI Yuri,

    sorry for the delay. The idea with tags is the “performance by datastore” so you can call it platinum-1, as long as the name (label) is different to the one already assigned. A rule of thumb would be, I guess, to use another name. But it’s up to everyone’s apreciation.


Leave a reply

Your email address will not be published. Required fields are marked *


© 4sysops 2006 - 2023


Please ask IT administration questions in the forums. Any other messages are welcome.


Log in with your credentials


Forgot your details?

Create Account