powershellscripts.com

Tutorials  PowerShell Cmdlet Help for New-Datastore



NAME
New-Datastore

SYNOPSIS
Creates a new datastore.

SYNTAX
New-Datastore [-Server ] [-VMHost] [-Name] -Path [-Nfs] -NfsHost
[-ReadOnly] [-WhatIf] [-Confirm] []

New-Datastore [-Server ] [-VMHost] [-Name] -Path [-Vmfs] [-BlockSizeMB t32>] [-FileSystemVersion ] [-WhatIf] [-Confirm] []


DESCRIPTION
Creates a new datastore based on the provided parameters. The following characters cannot be used in a datastore na
me: slash (/), backslash (\), and percent (%).


PARAMETERS
-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-VMHost
Specify a host where you want to create the new datastore.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Name
Specify a name for the new datastore.

Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Path
If you want to create a 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 n
ew VMFS datastores.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Nfs
Indicate that you want to create a NFS datastore.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-NfsHost
Specify the NFS host where you want to create the new datastore.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

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

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
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

-Vmfs
Indicate that you want to create a VMFS datastore.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-BlockSizeMB
Specify the maximum file size of VMFS in megabytes (MB). If no value is given, the maximum file size for the cu
rrent system platform is used.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-FileSystemVersion
Specify the file system you want to use on the new datastore.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
Datastore


NOTES




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

C:\PS>New-Datastore -VMHost $host -Name Datastore -Path $scsiLun.CanonicalName -Vmfs -FileSystemVersion 3


Creates a VMFS datastore by specifying the file system type.





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

C:\PS>New-Datastore -Nfs -VMHost 10.23.112.60 -Name NFSDatastore -Path /mynfs -NfsHost 10.23.84.73


Creates a NFS datastore.





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

C:\PS>$host1, $host2 | 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: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/New-Datastore.html
Get-Datastore
Remove-Datastore
Set-Datastore