Edit a Storage Policy

You can modify a storage policy to replace an existing rule set with a new rule set.

Prerequisites

  • Verify that you are connected to a vCenter Server system.
  • Verify that you have Profile-driven storage update privileges.
  • Verify that a storage provider is registered with the vCenter Server system.
  • Verify that a storage policy named pol-tag exists in the vCenter Server environment.

Procedure

  1. Get the pol-tag storage policy and store it in the $policy variable.
    $policy = Get-SpbmStoragePolicy -Name 'pol-tag'
  2. Create a new rule and store it in the $newRule variable.
    $newRule = New-SpbmRule -Capability (Get-SpbmCapability -Name 'VSAN.hostFailuresToTolerate') -Value 1
  3. Create a new rule set by using the $newRule rule and store it in the $newRuleset variable.
    $newRuleset = New-SpbmRuleSet -AllOfRules $newRule
  4. Modify the $policy storage policy by replacing the existing rule set with the newly created $newRuleset rule set.
    $modPolicy = Set-SpbmStoragePolicy -StoragePolicy $policy -AnyOfRuleSets $newRuleset