com.vmware.vcloud.sdk
Class VirtualDisk

java.lang.Object
  extended by com.vmware.vcloud.sdk.HardwareItem
      extended by com.vmware.vcloud.sdk.VirtualDisk

public class VirtualDisk
extends HardwareItem

Helper class to access the Virtual Disk Resource in vCloud API. The VirtualDisk can be a disk or its controller.

See Also:
RASDType

Constructor Summary
VirtualDisk(BigInteger diskSize, BusType busType, BusSubType busSubType)
          Creating a Virtual Disk.
VirtualDisk(BigInteger diskSize, BusType busType, BusSubType busSubType, Integer busNumber, Integer unitNumber)
          Creates a disk of the specified type and attaches to the specified the bus and unit number.
VirtualDisk(BigInteger diskSize, BusType busType, BusSubType busSubType, Integer busNumber, Integer unitNumber, com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
          Creates a disk of the specified type and attaches to the specified the bus and unit number.
VirtualDisk(BigInteger diskSize, BusType busType, BusSubType busSubType, com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
          Creates a disk of the specified type and attaches to the specified the bus and unit number.
VirtualDisk(com.vmware.vcloud.api.rest.schema.ovf.RASDType virtualDiskItem)
          Constructor to create a virtualDisk and set Storage Profile
 
Method Summary
 String getHardDiskBusType()
          Get the Bus Type of the HardDisk
 BigInteger getHardDiskSize()
          Get the size of the HardDisk
 Boolean isHardDisk()
          The VirualDisk can contain a HardDisk/HardDiskController.
 void overrideVmStorageProfile(boolean value)
          Override the Default Vm Storage Profile with the specified Storage Profile
 void updateHardDiskSize(BigInteger hardDiskSize)
          Update the size of the HardDisk.
 void updateStorageProfile(com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
          Update the storage Profile of the Disk.
 
Methods inherited from class com.vmware.vcloud.sdk.HardwareItem
getItemResource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualDisk

public VirtualDisk(BigInteger diskSize,
                   BusType busType,
                   BusSubType busSubType)
Creating a Virtual Disk. The vCloud server attaches this new disk to the next available bus and unit number.

Parameters:
diskSize - - disk size in mb.
busType - - ide or scsi bus type.
busSubType - - for ide bus type the bussubtype is ignored.
Since:
API 1.5, SDK 5.1
See Also:
VM.updateDisks(List)

VirtualDisk

public VirtualDisk(BigInteger diskSize,
                   BusType busType,
                   BusSubType busSubType,
                   Integer busNumber,
                   Integer unitNumber)
Creates a disk of the specified type and attaches to the specified the bus and unit number.

Parameters:
diskSize - - disk size in mb.
busType - - ide/scsi bus type.
busSubType - - for ide bus type the bussubtype is ignored.
busNumber - - for ide controller it can be 0 or 1. for scsi controller it can be 0 - 3.
unitNumber - - for ide it can be 0 - 3. for scsi it can be 0-6,8-15.
Since:
API 1.5, SDK 5.1
See Also:
VM.updateDisks(List)

VirtualDisk

public VirtualDisk(BigInteger diskSize,
                   BusType busType,
                   BusSubType busSubType,
                   com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
Creates a disk of the specified type and attaches to the specified the bus and unit number. The disk gets placed on the specified storage profile.

Parameters:
diskSize - - disk size in mb.
busType - - ide/scsi bus type.
busSubType - - for ide bus type the bussubtype is ignored.
storageProfileRef - - reference for the storage profile
Since:
API 5.6, SDK 5.6
See Also:
VM.updateDisks(List)

VirtualDisk

public VirtualDisk(BigInteger diskSize,
                   BusType busType,
                   BusSubType busSubType,
                   Integer busNumber,
                   Integer unitNumber,
                   com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
Creates a disk of the specified type and attaches to the specified the bus and unit number. The disk gets placed on the specified storage profile.

Parameters:
diskSize - - disk size in mb.
busType - - ide/scsi bus type.
busSubType - - for ide bus type the bussubtype is ignored.
storageProfileRef - - reference for the storage profile
busNumber - - for ide controller it can be 0 or 1. for scsi controller it can be 0 - 3.
unitNumber - - for ide it can be 0 - 3. for scsi it can be 0-6,8-15.
Since:
API 5.6, SDK 5.6
See Also:
VM.updateDisks(List)

VirtualDisk

public VirtualDisk(com.vmware.vcloud.api.rest.schema.ovf.RASDType virtualDiskItem)
Constructor to create a virtualDisk and set Storage Profile

Parameters:
virtualDiskItem -
See Also:
VirtualDisk(BigInteger, BusType, BusSubType), VirtualDisk(BigInteger, BusType, BusSubType, Integer, Integer)
Method Detail

getHardDiskSize

public BigInteger getHardDiskSize()
                           throws VCloudException
Get the size of the HardDisk

Throws:
VCloudException

updateHardDiskSize

public void updateHardDiskSize(BigInteger hardDiskSize)
                        throws VCloudException
Update the size of the HardDisk. Then perform the VM.updateDisks(List)

Parameters:
hardDiskSize -
Throws:
VCloudException
Since:
API 1.5, SDK 5.1

overrideVmStorageProfile

public void overrideVmStorageProfile(boolean value)
                              throws VCloudException
Override the Default Vm Storage Profile with the specified Storage Profile

Parameters:
value -
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

updateStorageProfile

public void updateStorageProfile(com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
                          throws VCloudException
Update the storage Profile of the Disk.

Parameters:
storageProfileRef -
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getHardDiskBusType

public String getHardDiskBusType()
                          throws VCloudException
Get the Bus Type of the HardDisk

Throws:
VCloudException

isHardDisk

public Boolean isHardDisk()
The VirualDisk can contain a HardDisk/HardDiskController. Returns true if the VirtualDisk is a HardDisk.

Returns:
Boolean
Since:
API 1.5, SDK 1.5


Copyright © 2016. All Rights Reserved.