New-WMNamespaceStoragePolicy

This cmdlet creates a storage claim for a workload namespace using the specified configuration. The storage claim is expressed as a storage policy and parameters of the claim. The cmdlet requires a connection to vCenter Server using the Connect-VIServer cmdlet.

Syntax

-Namespace  <WMNamespace>
-StoragePolicy  <SpbmStoragePolicy>
[-LimitMiB  <Int64>]
[-Server  <VIServer[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Namespace
WMNamespace named
  • pipeline
  • Specifies the workload namespace that you want to use the storage.
    required
    StoragePolicy
    SpbmStoragePolicy named Specifies the storage policy that you want to apply to the storage used by the specified workload namespace.
    optional
    LimitMiB
    Int64 named Specifies the limit on the storage used by workloads running in the specified workload namespace.
    optional
    Server
    VIServer[] named Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.

    Output

    VMware.VimAutomation.WorkloadManagement.Types.V1.WMNamespaceStoragePolicy

    Examples


    Example 1

    PS C:\> $ns = Get-WMNamespace "MyNamespace"
    PS C:\> $sp = Get-SpbmStoragePolicy "MyStoragePolicy"
    PS C:\> New-WMNamespaceStoragePolicy -Namespace $ns -StoragePolicy $sp

    Creates a storage claim for the workload namespace "MyNamespace". The storage policy "MyStoragePolicy" would be applied to the storage used by workloads running in this workload namespace. There would be no limit on the storage used by those workloads.

    Example 2

    PS C:\> New-WMNamespaceStoragePolicy -Namespace "MyNamespace" -StoragePolicy "MyStoragePolicy" -LimitMiB 2048

    Creates a storage claim for the workload namespace "MyNamespace". The storage policy "MyStoragePolicy" would be applied to the storage used by workloads running in this workload namespace. There would a limit of 2048 MiB on the storage used by those workloads.

    Related Commands

    Feedback

    Was this page helpful?