New-WMNamespaceStoragePolicy Command | Vmware PowerCLI Reference

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

New-WMNamespaceStoragePolicy
-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:\&#62 $ns = Get-WMNamespace "MyNamespace"
PS C:\&#62 $sp = Get-SpbmStoragePolicy "MyStoragePolicy"
PS C:\&#62 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:\&#62 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

WMNamespace

This cmdlet retrieves the workload namespaces in the vCenter Server system.

This cmdlet creates a new workload namespace on the specified cluster.

This cmdlet deletes a workload namespace from the vCenter Server system.

This cmdlet modifies the configuration of a workload namespace.

WMNamespaceLimits

Retrieves information about the Kubernetes resource limits of a namespace.

Changes the Kubernetes resource limits of a namespace.

WMNamespaceNetworkSpec

Creates a specification for a namespace network. The specification is later used to create the actual namespace network.

WMNamespacePermission

Retrieves information about workload namespace access permissions.

Grants an access permission to a workload namespace.

Removes an access permission to a workload namespace.

Modifies an access permission to a workload namespace.

WMNamespaceStoragePolicy

This cmdlet retrieves the configuration of the storage claimed by a workload namespace.

This cmdlet creates a storage claim for a workload namespace using the specified configuration.

This cmdlet deletes the storage claim for a workload namespace associated with a specified storage policy.

This cmdlet modifies the configuration of a storage claim used by a workload namespace.