< Back

New-Datastore

Sun Jan 19, 2020 6:59 pm

NAME New-Datastore



SYNOPSIS

This cmdlet creates a new datastore.





SYNTAX

New-Datastore [-VMHost] <VMHost> [-Name] <String> [-BlockSizeMB <Int32>] [-FileSystemVersion <String>] -Path

<String> [-Server <VIServer[]>] [-Vmfs] [-Confirm] [-WhatIf] [<CommonParameters>]



New-Datastore [-VMHost] <VMHost> [-Name] <String> [-FileSystemVersion <String>] [-Kerberos] [-Nfs] -NfsHost

<String[]> -Path <String> [-ReadOnly] [-Server <VIServer[]>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet creates a new datastore based on the provided parameters. The following characters cannot be used in a

datastore name: slash (/), backslash (\\), and percent (%).





PARAMETERS

-BlockSizeMB <Int32>

Specifies the maximum file size of VMFS in megabytes (MB). If no value is given, the maximum file size for the

current system platform is used.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-FileSystemVersion <String>

Specifies the file system you want to use on the new datastore.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Kerberos [<SwitchParameter>]

By default, NFS datastores are created with AUTH_SYS as the authentication protocol. This parameter indicates

that the NFS datastore uses Kerberos version 5 for authentication. This parameter is available only for NFS

version 4.1 datastores.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a name for the new datastore.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Nfs [<SwitchParameter>]

Indicates that you want to create an NFS datastore.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-NfsHost <String[]>

Specifies the NFS host where you want to create the new datastore.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Path <String>

If you want to create an NFS datastore, specify the remote path of the NFS mount point. If you want to create

a VMFS datastore, specify the canonical name of the SCSI logical unit that will contain new VMFS datastores.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReadOnly [<SwitchParameter>]

Indicates that the access mode for the mount point is ReadOnly. The default access mode is ReadWrite.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Server <VIServer[]>

Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this

parameter, the command runs on the default servers. For more information about default servers, see the

description of Connect-VIServer.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Vmfs [<SwitchParameter>]

Indicates that you want to create a VMFS datastore.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-VMHost <VMHost>

Specifies a host where you want to create the new datastore. Passing multiple values to this parameter is

obsolete.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-Confirm [<SwitchParameter>]

If 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.



Required? false

Position? named

Default value $true

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

The one or more newly created Datastore objects







NOTES









-------------------------- Example 1 --------------------------



New-Datastore -VMHost $vmhost -Name Datastore -Path $scsiLun.CanonicalName -Vmfs -FileSystemVersion 3



Creates a VMFS datastore by specifying the file system type.

-------------------------- Example 2 --------------------------



New-Datastore -Nfs -VMHost 10.23.112.60 -Name NFSDatastore -Path /mynfs -NfsHost 10.23.84.73



Creates a NFS datastore.

-------------------------- Example 3 --------------------------



$vmhost1, $vmhost2 | New-Datastore -Nfs -Name NFS1 -Path "/mnt/nfs1/nfs11/test1" -NfsHost 10.23.113.55 -ReadOnly



Creates a read-only NFS datastore across multiple virtual machine hosts.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... store.html

Get-Datastore

Remove-Datastore

Set-Datastore

Move-Datastore