Remove-EmcDatastore

Deletes the specified datastore.

 

Syntax

 

Parameters

-ESXHostSystem <IESXHostSystem>

Attributes: Required, Position: named

Specifies the ESI ESX host system object, which you can get by using the Get-EmcESXHost cmdlet.

 

-Name <String>

Attributes: Required, Position: named

Specifies the name of the new datastore.

 

-Force <SwitchParameter>

Attributes: Optional, Position: named

Allows the cmdlet to continue without asking for user confirmation.

 

-Silent <SwitchParameter>

Attributes: Optional, Position: named

Turns off all the informational and verbose messages. However, it still displays errors.

 

-WhatIf <SwitchParameter>

Attributes: Optional, Position: named

Shows what would happen if the cmdlet runs. The cmdlet is not run.

 

-Confirm <SwitchParameter>

Attributes: Optional, Position: named

Prompts you for confirmation before executing the command.

 

-Datastore <Datastore>

Attributes: Required, Position: named

Specifies the ESI VMware datastore object, which you can get by using Get-EmcDatastore cmdlet.

 

<CommonParameters>

This cmdlet supports these common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. Type get-help about_commonparameters for more details.

 

Examples

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

C:\PS>$h = Get-EmcVcenterSystem

C:\PS>$h | Update-EmcSystem -Silent

C:\PS>$l = Get-EmcLun lun2

C:\PS>$sc = Get-EmcScsiLun -Lun $l

C:\PS>$sc.hostdiskidentifier

02000600006000097000019260541253303230443353594d4d4554

C:\PS>$datastore = New-EmcDatastore -Name esi-ds-1 -ScsiLun $sc -Silent

C:\PS>$datastore

Name                 : esi-ds-1

Type                 : VMFS5

Capacity             : 1.750 GB

FreeSpace            : 1.206 GB

Url                  : ds:///vmfs/volumes/50c3a51b-45835678-9840-a4badb394393/

Uuid                 : 50c3a51b-45835678-9840-a4badb394393

VcenterUuid          : e942d303-eff4-4098-a3cf-e249894bd63b

HostLunIdentifiers   : {Wwn=60:00:09:70:00:01:92:60:54:12:53:30:32:30:44:33}

CanonicalNames       : {naa.60000970000192605412533032304433}

EsxHosts             : {x.x.x.x, y.y.y.y }

 

C:\PS>$h.SystemObjectType

vSphere/vCenter Server

C:\PS>$ex = Get-EmcESXHost -ScsiLun $sc[0]

C:\PS>Remove-EmcDatastore -Name esi-ds-1 -EsxHostSystem $ex

 

OR

 

C:\PS>Remove-EmcDatastore -Datastore $datastore -EsxHostSystem $ex -Force

This example creates a datastore and then deletes it.