Book Image

Learning PowerCLI for VMware VSphere

By : Robert van den Nieuwendijk
Book Image

Learning PowerCLI for VMware VSphere

By: Robert van den Nieuwendijk

Overview of this book

Table of Contents (17 chapters)
Learning PowerCLI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating datastores


You can use the New-Datastore cmdlet to create a new datastore. The New-Datastore cmdlet has two parameter sets, one for creating VMFS datastores and one for creating NFS datastores. The syntax of the New-Datastore cmdlet is as follows:

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

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

Creating NFS datastores

In the first example, we will create an NFS datastore. To indicate that we want to create an NFS datastore, we have to use the -Nfs parameter. The datastore will be created on the host 192.168.0.133 with the name Cluster01_Nfs01...