Search
Plugins > vCenter Server 5.5.3 > VcFileManager > deleteDatastoreFile_Task

Method deleteDatastoreFile_Task(String name, VcDatacenter datacenter)

Deletes the specified file or folder from the datastore. If a file of a virtual machine is deleted, it may corrupt that virtual machine. Folder deletes are always recursive. The datacenter parameter may be omitted if a URL is used to name the file or folder.

If the source is an extent of a virtual disk, this operation treats the extent as a file.

It is important to note that this operation will provide transactional guarantees only for a file. No guarantees are provided when deleting folders. If the intent is to delete a virtual machine registered in the inventory, please refer to VcManagedEntity.

Requires Datastore.FileManagement privilege on the datastore.

Returns

VcTask

Arguments

Name Type Description
name String The name of the file or folder, either a URL or a datastore path referring to the file or folder to be deleted.
datacenter VcDatacenter If <code>name</code> is a datastore path, the datacenter for that datastore path. Not needed when invoked directly on ESX. If not specified on a call to VirtualCenter, <code>name</code> must be a URL.