Managing datastores
Before we go ahead and start a discussion on how we can add different types of storage to an ESXi host, we will discuss a few basic tasks, such as copy and move operations on datastores. In the following example, we have the cmdlets that we can use to generally achieve the tasks:
Copy-DatastoreItem
Get-Datastore
Move-Datastore
New-Datastore
Remove-Datastore
Set-Datastore
The first cmdlet Copy-DatastoreItem
lets you copy data from a local machine disk to a remote datastore:
PS C:\> Copy-DatastoreItem vmstore:\Datacenter\vsanDatastore\Test-VM\* C:\VMFolder\Test-VM\ -Force
This will copy the files related to Test-VM
to a local folder in the local system.
As the name suggests, the Get-Datastore
cmdlet provides a list of datastores in the systems:
PS C:\> Get-Datastore Name FreeSpaceGB CapacityGB ---- ----------- ---------- datastore1 11.628 12.500 datastore1...