Creating datastores

You can use the New-Datastore cmdlet to create a new datastore. The syntax of the New-Datastore cmdlet is as follows. The first parameter set is to create NFS datastores:

New-Datastore [-Server <VIServer[]>] [-VMHost] <VMHost[]> [-Name]
    <String> -Path <String> [-Nfs] -NfsHost <String[]> [-ReadOnly]
    [-Kerberos] [-FileSystemVersion <String>] [-WhatIf] [-Confirm]
    [<CommonParameters>]

The second parameter set is to create VMFS datastores:

New-Datastore [-Server <VIServer[]>] [-VMHost] <VMHost[]> [-Name]
    <String> -Path <String> [-Vmfs] [-BlockSizeMB <Int32>]
    [- FileSystemVersion <String>] [-WhatIf] [-Confirm]
    [<CommonParameters>]

The -VMHost, -Name, -Path, and -NfsHost parameters are required.

Creating NFS datastores

In the first ...

Get Learning PowerCLI - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.