Managed Object - VirtualDiskManager

Property of
ServiceContent
See also
Datacenter, HostDiskDimensionsChs, VirtualDiskSpec
Since
VI API 2.5


Managed Object Description

NOTE: This managed object type and all of its methods are experimental and subject to change in future releases.

This managed object type provides a way to manage and manipulate virtual disks on datastores. The source and the destination names are in the form of a URL or a datastore path.

A URL has the form

scheme://authority/folder/path?dcPath=dcPath&dsName=dsName
where
  • scheme is http or https.
  • authority specifies the hostname or IP address of the VirtualCenter or ESX server and optionally the port.
  • dcPath is the inventory path to the Datacenter containing the Datastore.
  • dsName is the name of the Datastore.
  • path is a slash-delimited path from the root of the datastore.
  • A datastore path has the form

    [datastore] path
    where
  • datastore is the datastore name.
  • path is a slash-delimited path from the root of the datastore.
  • An example datastore path is "[storage] path/to/file.extension". A listing of all the files, disks and folders on a datastore can be obtained from the datastore browser.
    See HostDatastoreBrowser

    Properties

    Name Type Description
    None

    Methods

    Methods defined in this Managed Object
    CopyVirtualDisk_Task, CreateVirtualDisk_Task, DefragmentVirtualDisk_Task, DeleteVirtualDisk_Task, ExtendVirtualDisk_Task, InflateVirtualDisk_Task, MoveVirtualDisk_Task, QueryVirtualDiskFragmentation, QueryVirtualDiskGeometry, QueryVirtualDiskUuid, SetVirtualDiskUuid, ShrinkVirtualDisk_Task, ZeroFillVirtualDisk_Task

    CopyVirtualDisk_Task

    Copy a virtual disk, performing conversions as specified in the spec.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    sourceNamexsd:string

    The name of the source, either a datastore path or a URL referring to the virtual disk to be copied.
    sourceDatacenter* PManagedObjectReference
    to a Datacenter

    If sourceName is a datastore path, the datacenter for that datastore path. If not specified, sourceName must be a URL.
    destNamexsd:string

    The name of the destination, either a datastore path or a URL referring to the virtual disk to be created.
    destDatacenter* PManagedObjectReference
    to a Datacenter

    If destName is a datastore path, the datacenter for that datastore path. If not specified, destName must be a URL.
    destSpec*VirtualDiskSpec

    The specification of the virtual disk to be created. If not specified the specification of the source disk is used.
    force*xsd:boolean

    If true, overwrite any indentically named disk at the destination. If not specified, it is assumed to be false
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs cloning the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    CreateVirtualDisk_Task

    Create a virtual disk.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk to be created.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    specVirtualDiskSpec

    The specification of the virtual disk to be created.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs creating the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    DefragmentVirtualDisk_Task

    Defragment a sparse virtual disk. This is defragmentation of the virtual disk file(s) in the host operating system, not defragmentation of the guest operating system filesystem inside the virtual disk.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk that should be defragmented.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs defragmenting the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    DeleteVirtualDisk_Task

    Delete a virtual disk. All files relating to the disk will be deleted.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk to be deleted.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs deleting the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    ExtendVirtualDisk_Task

    Expand the capacity of a virtual disk to the new capacity.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk whose capacity should be expanded.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    newCapacityKbxsd:long

    The new capacty of the virtual disk in Kb.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs extending the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    InflateVirtualDisk_Task

    Inflate a sparse virtual disk up to the full size

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk that should be inflated.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs inflating the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    MoveVirtualDisk_Task

    Move a virtual disk and all related files from the source location specified by sourceName and sourceDatacenter to the destination location specified by destName and destDatacenter.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    sourceNamexsd:string

    The name of the source, either a datastore path or a URL referring to the virtual disk to be moved.
    sourceDatacenter* PManagedObjectReference
    to a Datacenter

    If sourceName is a datastore path, the datacenter for that datastore path. If not specified, sourceName must be a URL.
    destNamexsd:string

    The name of the destination, either a datastore path or a URL referring to the destination virtual disk.
    destDatacenter* PManagedObjectReference
    to a Datacenter

    If destName is a datastore path, the datacenter for that datastore path. If not specified, destName must be a URL.
    force*xsd:boolean

    If true, overwrite any indentically named disk at the destination. If not specified, it is assumed to be false
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task

    Faults

    Type Description
    FileFaultThrown if an error occurs renaming the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    QueryVirtualDiskFragmentation

    Return the percentage of fragmentation of the sparse virtual disk. This is the fragmentation of virtual disk file(s) in the host operating system, not the fragmentation of the guest operating systemS filesystem inside the virtual disk.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk for which to return the percentage of fragmentation.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    xsd:intThe percentage of fragmentation (as an integer between 0 and 100) of the sparse virtual disk.

    Faults

    Type Description
    FileFaultThrown if an error occurs reading the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    QueryVirtualDiskGeometry

    Get the disk geometry information for the virtual disk.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk from which to get geometry information.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    HostDiskDimensionsChsThe geometry information for this virtual disk.

    Faults

    Type Description
    FileFaultThrown if an error occurs reading the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    QueryVirtualDiskUuid

    Get the virtual disk SCSI inquiry page 0x83 data.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk from which to get SCSI inquiry page 0x83 data.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    xsd:stringThe hex representation of the unique ID for this virtual disk.

    Faults

    Type Description
    FileFaultThrown if an error occurs reading the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    SetVirtualDiskUuid

    Set the virtual disk SCSI inquiry page 0x83 data.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk whose SCSI inquiry page 0x83 data should be set.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    uuidxsd:string

    The hex representation of the unique ID for this virtual disk.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    None

    Faults

    Type Description
    FileFaultThrown if an error occurs updating the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    ShrinkVirtualDisk_Task

    Shrink a sparse virtual disk.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk that should be shrink.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    copy*xsd:boolean

    Set to true to make a shrunk copy, false to shrink the original virtual disk.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs shrinking the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition



    ZeroFillVirtualDisk_Task

    Overwrite all blocks of the virtual disk with zeros. All data will be lost.

    Experimental. Subject to change

    Required Privileges
    None

    Parameters

    NameTypeDescription
    _thisManagedObjectReference A reference to the VirtualDiskManager used to make the method call.
    namexsd:string

    The name of the disk, either a datastore path or a URL referring to the virtual disk whose blocks should be overwritten with zeroes.
    datacenter* PManagedObjectReference
    to a Datacenter

    If name is a datastore path, the datacenter for that datastore path. If not specified, name must be a URL.
    *Need not be set P Required privilege: Datastore.FileManagement

    Return Value

    Type Description
    ManagedObjectReference
    to a Task
    This method returns a Task object with which to monitor the operation.

    Faults

    Type Description
    FileFaultThrown if an error occurs zero filling the virtual disk.
    RuntimeFaultThrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

    Show WSDL type definition