Note that storage policies, unlike tags, are created per-vCenter, so storage policies must be created on both the source and target vCenters. Repeat this process below for both the source and target vCenters.
To ensure a VM stays on the correct datastore (or sets of datastores), a storage policy can be assigned to the VM. The policy says that only the storage that satisfies the following requirements can be valid as acceptable storage for this VM (or a set of VMs). This allows automated (or manual) migration procedures to be able to make moves, but only to compatible storage. Migration to non-compliant storage is allowed for manual migrations, but warnings are thrown during and after the migration. VM storage policies also make sure that new virtual disks are provisioned on compliant datastores.
Storage policies can be created to look for specific tags on datastores to make sure that VMs are only on datastores that comply.
To create a tag-based policy, click on the top menu and then Policies and Profiles:
From there, click on VM Storage Policies, then Create VM Storage Policy:
Give the policy a unique name as well as a detailed description. Ensure that the correct vCenter server is chosen in the drop down. Click Next.
Select the option called Enable tag based placement rules. Click Next.
Choose the desired tag category. Then click the Browse Tags button.
Select the tag(s) that need to be include in the policy. Click OK.
Add any other rules desired in the policy and click Next.
Confirm that the datastores that were tagged appear in the list. If they do not, confirm afterwards that the tags are correctly applied. It is okay if they are not listed right now- this compliance list is generated on demand as the datastores are tagged and un-tagged and/or VMs are provisioned.
Click Next.
Click Finish to create the policy.
Lastly, repeat this process to create a corresponding policy on the respective vCenter server as well. When datastores are failed over they will be tagged according to the policy and the VMs will reconfigured with the target policy.