PowerCLI Reference

New-WMNamespaceStoragePolicy

Synopsis

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

Syntax

New-WMNamespaceStoragePolicy [-LimitMiB <Int64>] -Namespace <WMNamespace> [-Server <VIServer[]>] -StoragePolicy <SpbmStoragePolicy> [-Confirm] [-WhatIf] [<CommonParameters>]

Related Commands

Detailed Description

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.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falseFalse
LimitMiBInt64Specifies the limit on the storage used by workloads running in the specified workload namespace.falseFalse
NamespaceWMNamespaceSpecifies the workload namespace that you want to use the storage.trueTrue (ByValue)
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.falseFalse
StoragePolicySpbmStoragePolicySpecifies the storage policy that you want to apply to the storage used by the specified workload namespace.trueFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

VMware.VimAutomation.WorkloadManagement.Types.V1.WMNamespaceStoragePolicy

Notes

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.


Copyright © VMware, Inc. All rights reserved.