com.vmware.vcloud.sdk
Class VM

java.lang.Object
  extended by com.vmware.vcloud.sdk.VcloudResource<T>
      extended by com.vmware.vcloud.sdk.VcloudEntity<com.vmware.vcloud.api.rest.schema.AbstractVAppType>
          extended by com.vmware.vcloud.sdk.AbstractVapp<com.vmware.vcloud.api.rest.schema.VmType>
              extended by com.vmware.vcloud.sdk.VM

public class VM
extends AbstractVapp<com.vmware.vcloud.api.rest.schema.VmType>

Helper class to access the VM Resource in vCLoud API.

Since:
SDK 1.5
See Also:
VmType

Method Summary
 com.vmware.vcloud.api.rest.schema.MksTicketType acquireMksTicket()
          Retrieve a mks ticket that you can use to gain access to the console of a running VM
 com.vmware.vcloud.api.rest.schema.ScreenTicketType acquireTicket()
          Returns a ticket that client can use to open a screen connection.
 void answerVmQuestion(int choiceId, String questionId)
          Answer a Vm Pending Question
 Task attachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
          Attaching a disk to the VM.
 Task attachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef, Integer busNumber, Integer unitNumber)
          Attaching a disk to the VM.
 Task checkCompliance()
          Perform storage profile compliance check on a VM.
static Task checkCompliance(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Perform storage profile compliance check on a VM.
 com.vmware.vcloud.api.rest.schema.ComplianceResultType complianceResult()
          Returns the storage profile compliance result on a VM.
static com.vmware.vcloud.api.rest.schema.ComplianceResultType complianceResult(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns the storage profile compliance result on a VM.
 Task consolidate()
          Consolidates a vm.
static Task consolidate(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Consolidates a vm.
 Task detachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
          Detaching disk from the VM.
 Task detachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef, Integer busNumber, Integer unitNumber)
          Detaching disk from the VM.
 Task disableNestedHypervisor()
          Disable the nested hypervisor feature on this vm.
static Task disableNestedHypervisor(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Disable the nested hypervisor feature on this vm.
 Task ejectMedia(com.vmware.vcloud.api.rest.schema.MediaInsertOrEjectParamsType mediaInsertOrEjectParamsType)
          An ejectMedia request reverses a specific insertMedia request.
 Task enableNestedHypervisor()
          Enable the nested hypervisor feature on this vm.
static Task enableNestedHypervisor(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Enable the nested hypervisor feature on this vm.
 void forceGuestCustomization()
          Force guest customization on next power on.
static void forceGuestCustomization(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Force guest customization on next power on.
 List<com.vmware.vcloud.api.rest.schema.ReferenceType> getAttachedDisks()
          Returns the list of independent disks which are attached to this VM.
 VirtualCpu getCpu()
          Returns the Virtual CPU for the VM
static VirtualCpu getCpu(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns VirtualCpu Item for the given vm Ref
 com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics()
          Gets the current usage for all available VM metrics.
 com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics(com.vmware.vcloud.api.rest.schema.CurrentUsageSpecType currentUsageSpec)
          Gets the current usage for VM metrics according to the provided spec object.
static com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Gets the current usage for all available VM metrics.
static com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef, com.vmware.vcloud.api.rest.schema.CurrentUsageSpecType currentUsageSpec)
          Gets the current usage for VM metrics according to the provided spec object.
 List<VirtualDisk> getDisks()
          Returns the Virtual Disks for the VM.
static List<VirtualDisk> getDisks(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns VirtualDisks for the given vm Ref
 com.vmware.vcloud.api.rest.schema.GuestCustomizationSectionType getGuestCustomizationSection()
          Returns the GuestCustomizationSection for the given VM
static com.vmware.vcloud.api.rest.schema.GuestCustomizationSectionType getGuestCustomizationSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns the GuestCustomizationSection
 com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics()
          Gets the past 24 hours worth of samples for all available VM metrics.
 com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics(com.vmware.vcloud.api.rest.schema.HistoricUsageSpecType historicUsageSpec)
          Gets the historic usage for VM metrics according to the provided spec object.
static com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Gets the past 24 hours worth of samples for all available VM metrics.
static com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef, com.vmware.vcloud.api.rest.schema.HistoricUsageSpecType historicUsageSpec)
          Gets the historic usage for VM metrics according to the provided spec object.
 HashMap<Integer,String> getIpAddressesById()
          Returns the IP Addresses by Id.
 List<VirtualMedia> getMedias()
          Returns the Virtual Media for the VM
static List<VirtualMedia> getMedias(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns VirtualMedia Item for the given VM Ref
 VirtualMemory getMemory()
          Returns the Virtual Memory for the VM
static VirtualMemory getMemory(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns VirtualMemory Item for the given vm Ref
 List<VirtualNetworkCard> getNetworkCards()
          Returns the Virtual NetworkCards for the VM
static List<VirtualNetworkCard> getNetworkCards(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns VirtualNetworkCards for the given vm Ref
 Collection<com.vmware.vcloud.api.rest.schema.NetworkConnectionType> getNetworkConnections()
          Returns the NetworkConnections for a VM
 com.vmware.vcloud.api.rest.schema.NetworkConnectionSectionType getNetworkConnectionSection()
          Returns the NetworkConnectionSection for the given VM
static com.vmware.vcloud.api.rest.schema.NetworkConnectionSectionType getNetworkConnectionSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns the NetworkConnectionSection
 com.vmware.vcloud.api.rest.schema.ovf.OperatingSystemSectionType getOperatingSystemSection()
          Returns the OperatingSystemSection for the given VM
static com.vmware.vcloud.api.rest.schema.ovf.OperatingSystemSectionType getOperatingSystemSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns the OperatingSystemSection
 com.vmware.vcloud.api.rest.schema.ReferenceType getParentVappReference()
          Returns the Parent Vapp ReferenceType.
 com.vmware.vcloud.api.rest.schema.ovf.environment.PlatformSectionType getPlatformSection()
          Returns the platform section type of the VM.
 com.vmware.vcloud.api.rest.schema.ovf.environment.PropertySectionType getPropertySection()
          Returns the property section type of the VM.
 com.vmware.vcloud.api.rest.schema.RuntimeInfoSectionType getRuntimeInfoSection()
          Returns the RuntimeInfoSection of the VM
static com.vmware.vcloud.api.rest.schema.RuntimeInfoSectionType getRuntimeInfoSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns the RuntimeInfoSection of the VM
 InputStream getScreen()
          Returns a screen inputstream if available.
 List<SerialPort> getSerialPorts()
          Deprecated. API 5.1, SDK 5.1, Internal API - NotSupported/UnImplemented
static List<SerialPort> getSerialPorts(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Deprecated. API 5.1, SDK 5.1, Internal API - NotSupported/UnImplemented
 com.vmware.vcloud.api.rest.schema.ovf.VirtualHardwareSectionType getVirtualHardwareSection()
          Returns the VirtualHardwareSection for the given VM
static com.vmware.vcloud.api.rest.schema.ovf.VirtualHardwareSectionType getVirtualHardwareSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns the VirtualHardwareSectionType for the VM
static VM getVMById(VcloudClient client, String vCloudId)
          Get VM helper using the vCloud ID
static VM getVMByReference(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns VM for the given reference
 com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getVMDatastoreVimRef()
          Returns the Virtual Machine Datastore VIM Object reference.
 Integer getVMDiskChainLength()
          Returns the disks of a fast provisioned VM link to parent disks in a chain, and this number is the depth of this VMs disks in that chain.
 com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getVMHostVimRef()
          Returns the Virtual Machine Host VIM Object reference.
 com.vmware.vcloud.api.rest.schema.VmPendingQuestionType getVmQuestion()
          Returns a Vm Pending Question
static com.vmware.vcloud.api.rest.schema.VmPendingQuestionType getVmQuestion(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Returns a Vm Pending Question
 BigInteger getVmSize()
          Returns the size of a vm.
 VMStatus getVMStatus()
          Returns the VM status.
 com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getVMVimRef()
          Returns the Virtual Machine VIM Object reference.
 Task insertMedia(com.vmware.vcloud.api.rest.schema.MediaInsertOrEjectParamsType mediaInsertOrEjectParamsType)
          An insertMedia request makes a virtual media entity readable by a VM
 Task installVMwareTools()
          Installs VMware tools to the virtual machine.
static Task installVMwareTools(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Installs VMware tools to the virtual machine.
 Boolean isVMwareToolsInstalled()
          Checks whether the VMware tools installed or not.
 Task reconfigureVM(com.vmware.vcloud.api.rest.schema.VmType vmType)
          Updates VM name, Description, and any or all of the following sections: VirtualHardwareSection OperatingSystemSection NetworkConnectionSection GuestCustomizationSection Sections not included in the request body will not be updated.
 Task reloadFromVC()
          Reloads VM state from VC.
static Task reloadFromVC(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Reloads VM state from VC.
 Task relocate(com.vmware.vcloud.api.rest.schema.ReferenceType datastoreReference)
          Deprecated. API 5.1, SDK 5.1, use VMupdateVM(VmType) to relocate vm to a different StorageProfle. Storage profile can be specified by using VmType
static Task relocate(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef, com.vmware.vcloud.api.rest.schema.ReferenceType datastoreReference)
          Deprecated. API 5.1, SDK 5.1, use VMupdateVM(VmType) to relocate vm to a different StorageProfle. Storage profile can be specified by using VmType
 Task updateCpu(VirtualCpu virtualCpuItem)
          Updates the VirtualCpu Item of the VM
 Task updateDisks(List<VirtualDisk> virtualDisks)
          Updates the VirtualDisks of a VM
 Task updateHotAdd(boolean memoryHotAdd, boolean cpuHotAdd)
          Enable/Disable the hot add options for this vm.
static Task updateHotAdd(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef, boolean memoryHotAdd, boolean cpuHotAdd)
          Enable/Disable the hot add options for this vm.
 Task updateMemory(VirtualMemory virtualMemoryItem)
          Updates the VirtualMemory Item of a VM
 Task updateNetworkCards(List<VirtualNetworkCard> virtualNetworkCards)
          Updates the VirtualNetworkCard of a VM
 Task updateSection(com.vmware.vcloud.api.rest.schema.ovf.SectionType sectionType)
          Updating the VM Section.
 Task updateSerialPorts(List<SerialPort> serialPorts)
          Deprecated. API 5.1, SDK 5.1, Internal API - NotSupported/UnImplemented
 Task updateVM(com.vmware.vcloud.api.rest.schema.VmType vmType)
          Updates the vm.
 Task upgradeHardware()
          Upgrade virtual hardware version of a VM to the highest supported virtual hardware version of provider vDC where the VM locates
static Task upgradeHardware(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
          Upgrade virtual hardware version of a VM to the highest supported virtual hardware version of provider vDC where the VM locates
 
Methods inherited from class com.vmware.vcloud.sdk.AbstractVapp
createSnapshot, createSnapshot, delete, delete, deploy, deploy, discardSuspend, discardSuspend, getProductSections, getProductSections, getResource, getSnapshotSection, getSnapshotSection, isDeployed, powerOff, powerOff, powerOn, powerOn, reboot, reboot, removeAllSnapshots, removeAllSnapshots, reset, reset, revertToCurrentSnapshot, revertToCurrentSnapshot, shutdown, shutdown, suspend, suspend, undeploy, undeploy, updateProductSections
 
Methods inherited from class com.vmware.vcloud.sdk.VcloudEntity
getMetadata, getReference, getTasks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getVMByReference

public static VM getVMByReference(VcloudClient client,
                                  com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                           throws VCloudException
Returns VM for the given reference

Parameters:
client - vCloud API client VcloudClient
vmRef - ReferenceType to the vm ReferenceType
Returns:
VM
Throws:
VCloudException

getVMById

public static VM getVMById(VcloudClient client,
                           String vCloudId)
                    throws VCloudException
Get VM helper using the vCloud ID

Parameters:
client - VcloudClient
vCloudId - format - The vCloud ID is of the form: "urn:vcloud:type:uuid". For example: "urn:vcloud:media:d9d976ba-e0ec-4682-a67d-380af49b54e1". String
Returns:
VM
Throws:
VCloudException
Since:
API 1.5

getVMStatus

public VMStatus getVMStatus()
Returns the VM status.

Returns:
VMStatus

updateVM

public Task updateVM(com.vmware.vcloud.api.rest.schema.VmType vmType)
              throws VCloudException
Updates the vm.

Parameters:
vmType - VmType
Returns:
Task
Throws:
VCloudException
See Also:
VmType

getGuestCustomizationSection

public com.vmware.vcloud.api.rest.schema.GuestCustomizationSectionType getGuestCustomizationSection()
                                                                                             throws VCloudException
Returns the GuestCustomizationSection for the given VM

Returns:
GuestCustomizationSectionType
Throws:
VCloudException

getGuestCustomizationSection

public static com.vmware.vcloud.api.rest.schema.GuestCustomizationSectionType getGuestCustomizationSection(VcloudClient client,
                                                                                                           com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                                                    throws VCloudException
Returns the GuestCustomizationSection

Parameters:
client -
vmRef -
Returns:
GuestCustomizationSectionType
Throws:
VCloudException

getVirtualHardwareSection

public com.vmware.vcloud.api.rest.schema.ovf.VirtualHardwareSectionType getVirtualHardwareSection()
                                                                                           throws VCloudException
Returns the VirtualHardwareSection for the given VM

Returns:
VirtualHardwareSectionType
Throws:
VCloudException

getVirtualHardwareSection

public static com.vmware.vcloud.api.rest.schema.ovf.VirtualHardwareSectionType getVirtualHardwareSection(VcloudClient client,
                                                                                                         com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                                                  throws VCloudException
Returns the VirtualHardwareSectionType for the VM

Parameters:
client -
vmRef -
Returns:
VirtualHardwareSectionType
Throws:
VCloudException

getOperatingSystemSection

public com.vmware.vcloud.api.rest.schema.ovf.OperatingSystemSectionType getOperatingSystemSection()
                                                                                           throws VCloudException
Returns the OperatingSystemSection for the given VM

Returns:
OperatingSystemSectionType
Throws:
VCloudException

getOperatingSystemSection

public static com.vmware.vcloud.api.rest.schema.ovf.OperatingSystemSectionType getOperatingSystemSection(VcloudClient client,
                                                                                                         com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                                                  throws VCloudException
Returns the OperatingSystemSection

Parameters:
client -
vmRef -
Returns:
OperatingSystemSectionType
Throws:
VCloudException

getRuntimeInfoSection

public com.vmware.vcloud.api.rest.schema.RuntimeInfoSectionType getRuntimeInfoSection()
                                                                               throws VCloudException
Returns the RuntimeInfoSection of the VM

Returns:
RuntimeInfoSectionType
Throws:
VCloudException
Since:
API 1.5

getRuntimeInfoSection

public static com.vmware.vcloud.api.rest.schema.RuntimeInfoSectionType getRuntimeInfoSection(VcloudClient client,
                                                                                             com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                                      throws VCloudException
Returns the RuntimeInfoSection of the VM

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
RuntimeInfoSectionType
Throws:
VCloudException
Since:
API 1.5

updateSection

public Task updateSection(com.vmware.vcloud.api.rest.schema.ovf.SectionType sectionType)
                   throws VCloudException
Updating the VM Section. You should be able to reconfigure sections VM level (VirtualHardwareSection (networking, disk, memory, CPU), OperatingSystemSection, NetworkConnectionSection, GuestCustomizationSection)

Parameters:
sectionType -
Returns:
Task
Throws:
VCloudException

insertMedia

public Task insertMedia(com.vmware.vcloud.api.rest.schema.MediaInsertOrEjectParamsType mediaInsertOrEjectParamsType)
                 throws VCloudException
An insertMedia request makes a virtual media entity readable by a VM

Parameters:
mediaInsertOrEjectParamsType - MediaInsertOrEjectParamsType
Returns:
Task
Throws:
VCloudException

ejectMedia

public Task ejectMedia(com.vmware.vcloud.api.rest.schema.MediaInsertOrEjectParamsType mediaInsertOrEjectParamsType)
                throws VCloudException
An ejectMedia request reverses a specific insertMedia request.

Parameters:
mediaInsertOrEjectParamsType - MediaInsertOrEjectParamsType
Returns:
Task
Throws:
VCloudException

getVmSize

public BigInteger getVmSize()
                     throws VCloudException
Returns the size of a vm.

Returns:
BigInteger
Throws:
VCloudException

getCpu

public VirtualCpu getCpu()
                  throws VCloudException
Returns the Virtual CPU for the VM

Returns:
VirtualCpu
Throws:
VCloudException

getCpu

public static VirtualCpu getCpu(VcloudClient client,
                                com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                         throws VCloudException
Returns VirtualCpu Item for the given vm Ref

Parameters:
client - vCloud API client VcloudClient
vmRef - vm Ref ReferenceType
Returns:
VirtualCpu helper VirtualCpu
Throws:
VCloudException

updateCpu

public Task updateCpu(VirtualCpu virtualCpuItem)
               throws VCloudException
Updates the VirtualCpu Item of the VM

Parameters:
virtualCpuItem -
Returns:
Task
Throws:
VCloudException

getMemory

public VirtualMemory getMemory()
                        throws VCloudException
Returns the Virtual Memory for the VM

Returns:
VirtualMemory
Throws:
VCloudException

getMemory

public static VirtualMemory getMemory(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                               throws VCloudException
Returns VirtualMemory Item for the given vm Ref

Parameters:
client - vCloud API client VcloudClient
vmRef - vm Ref ReferenceType
Returns:
VirtualMemory helper VirtualMemory
Throws:
VCloudException

updateMemory

public Task updateMemory(VirtualMemory virtualMemoryItem)
                  throws VCloudException
Updates the VirtualMemory Item of a VM

Parameters:
virtualMemoryItem -
Returns:
Task
Throws:
VCloudException

getSerialPorts

public List<SerialPort> getSerialPorts()
                                throws VCloudException
Deprecated. API 5.1, SDK 5.1, Internal API - NotSupported/UnImplemented

Returns a list of serial ports for the VM.

Returns:
List<SerialPort>
Throws:
VCloudException
Since:
API 1.5

getSerialPorts

public static List<SerialPort> getSerialPorts(VcloudClient client,
                                              com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                       throws VCloudException
Deprecated. API 5.1, SDK 5.1, Internal API - NotSupported/UnImplemented

Returns a list of serial ports for the given VM reference.

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
List<SerialPort>
Throws:
VCloudException
Since:
API 1.5

updateSerialPorts

public Task updateSerialPorts(List<SerialPort> serialPorts)
                       throws VCloudException
Deprecated. API 5.1, SDK 5.1, Internal API - NotSupported/UnImplemented

Add/Update/Delete the serial ports. 1. Add - Add a new serial port to the List and update. 2. Update - Mofidy the serial port accordingly from the list and update. 3. Delete - Remove the serial port from the list and update.

Parameters:
serialPorts -
Returns:
Task
Throws:
VCloudException
Since:
API 1.5

getDisks

public List<VirtualDisk> getDisks()
                           throws VCloudException
Returns the Virtual Disks for the VM. The returned virtual disk list items contains the virtual disk and it associated controllers.

Returns:
List
Throws:
VCloudException

getDisks

public static List<VirtualDisk> getDisks(VcloudClient client,
                                         com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                  throws VCloudException
Returns VirtualDisks for the given vm Ref

Parameters:
client - vCloud API client VcloudClient
vmRef - vm Ref ReferenceType
Returns:
List of VirtualDisk helper List
Throws:
VCloudException

updateDisks

public Task updateDisks(List<VirtualDisk> virtualDisks)
                 throws VCloudException
Updates the VirtualDisks of a VM

Parameters:
virtualDisks - List
Returns:
Task
Throws:
VCloudException

getNetworkCards

public List<VirtualNetworkCard> getNetworkCards()
                                         throws VCloudException
Returns the Virtual NetworkCards for the VM

Returns:
List of VirtualNetworkCard helper List
Throws:
VCloudException

getNetworkCards

public static List<VirtualNetworkCard> getNetworkCards(VcloudClient client,
                                                       com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                throws VCloudException
Returns VirtualNetworkCards for the given vm Ref

Parameters:
client - vCloud API client VcloudClient
vmRef - vm Ref ReferenceType
Returns:
List of VirtualNetworkCard helper List
Throws:
VCloudException

updateNetworkCards

public Task updateNetworkCards(List<VirtualNetworkCard> virtualNetworkCards)
                        throws VCloudException
Updates the VirtualNetworkCard of a VM

Parameters:
virtualNetworkCards -
Returns:
Task
Throws:
VCloudException

getMedias

public List<VirtualMedia> getMedias()
                             throws VCloudException
Returns the Virtual Media for the VM

Returns:
List of virtual media helper List
Throws:
VCloudException

getMedias

public static List<VirtualMedia> getMedias(VcloudClient client,
                                           com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                    throws VCloudException
Returns VirtualMedia Item for the given VM Ref

Parameters:
client - vCloud API client VcloudClient
vmRef - VM Ref ReferenceType
Returns:
VirtualMedia helper VirtualMedia
Throws:
VCloudException

getParentVappReference

public com.vmware.vcloud.api.rest.schema.ReferenceType getParentVappReference()
                                                                       throws VCloudException
Returns the Parent Vapp ReferenceType.

Returns:
ReferenceType
Throws:
VCloudException

getVMVimRef

public com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getVMVimRef()
                                                                         throws VCloudException
Returns the Virtual Machine VIM Object reference.

Returns:
VimObjectRefType
Throws:
VCloudException
Since:
API 1.5

getVMDatastoreVimRef

public com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getVMDatastoreVimRef()
                                                                                  throws VCloudException
Returns the Virtual Machine Datastore VIM Object reference.

Returns:
VimObjectRefType
Throws:
VCloudException
Since:
API 1.5

getVMHostVimRef

public com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getVMHostVimRef()
                                                                             throws VCloudException
Returns the Virtual Machine Host VIM Object reference.

Returns:
VimObjectRefType
Throws:
VCloudException
Since:
API 1.5

getVMDiskChainLength

public Integer getVMDiskChainLength()
                             throws VCloudException
Returns the disks of a fast provisioned VM link to parent disks in a chain, and this number is the depth of this VMs disks in that chain. A chain length of 1 indicates that all the disks are flat and don't refer to parent disks.

Returns:
Integer
Throws:
VCloudException
Since:
API 1.5

isVMwareToolsInstalled

public Boolean isVMwareToolsInstalled()
                               throws VCloudException
Checks whether the VMware tools installed or not. If installed, use getRuntimeInfoSection() to know more about the installed tools version.

Returns:
Boolean
Throws:
VCloudException
Since:
API 1.5

getPlatformSection

public com.vmware.vcloud.api.rest.schema.ovf.environment.PlatformSectionType getPlatformSection()
                                                                                         throws VCloudException
Returns the platform section type of the VM.

Returns:
PlatformSectionType
Throws:
VCloudException
Since:
API 1.5

getPropertySection

public com.vmware.vcloud.api.rest.schema.ovf.environment.PropertySectionType getPropertySection()
                                                                                         throws VCloudException
Returns the property section type of the VM.

Returns:
PropertySectionType
Throws:
VCloudException
Since:
API 1.5

getNetworkConnectionSection

public com.vmware.vcloud.api.rest.schema.NetworkConnectionSectionType getNetworkConnectionSection()
                                                                                           throws VCloudException
Returns the NetworkConnectionSection for the given VM

Returns:
NetworkConnectionSectionType
Throws:
VCloudException

getNetworkConnectionSection

public static com.vmware.vcloud.api.rest.schema.NetworkConnectionSectionType getNetworkConnectionSection(VcloudClient client,
                                                                                                         com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                                                  throws VCloudException
Returns the NetworkConnectionSection

Parameters:
client -
vmRef -
Returns:
NetworkConnectionSectionType
Throws:
VCloudException

getNetworkConnections

public Collection<com.vmware.vcloud.api.rest.schema.NetworkConnectionType> getNetworkConnections()
                                                                                          throws VCloudException
Returns the NetworkConnections for a VM

Returns:
Collection<NetworkConnectionType>
Throws:
VCloudException

getIpAddressesById

public HashMap<Integer,String> getIpAddressesById()
                                           throws VCloudException
Returns the IP Addresses by Id. The Ids are the network connection indexes.

Returns:
HashMap
Throws:
VCloudException

getVmQuestion

public com.vmware.vcloud.api.rest.schema.VmPendingQuestionType getVmQuestion()
                                                                      throws VCloudException
Returns a Vm Pending Question

Returns:
VmPendingQuestionType
Throws:
VCloudException

getVmQuestion

public static com.vmware.vcloud.api.rest.schema.VmPendingQuestionType getVmQuestion(VcloudClient client,
                                                                                    com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                             throws VCloudException
Returns a Vm Pending Question

Parameters:
client -
vmRef -
Returns:
VmPendingQuestionType
Throws:
VCloudException

answerVmQuestion

public void answerVmQuestion(int choiceId,
                             String questionId)
                      throws VCloudException
Answer a Vm Pending Question

Parameters:
choiceId -
questionId -
Throws:
VCloudException

getScreen

public InputStream getScreen()
                      throws VCloudException
Returns a screen inputstream if available. The returned inputstream content-type is image/png

Returns:
InputStream
Throws:
VCloudException

acquireTicket

public com.vmware.vcloud.api.rest.schema.ScreenTicketType acquireTicket()
                                                                 throws VCloudException
Returns a ticket that client can use to open a screen connection.

Returns:
ScreenTicketType
Throws:
VCloudException

installVMwareTools

public Task installVMwareTools()
                        throws VCloudException
Installs VMware tools to the virtual machine. VMware Tools can be installed only on a powered on VM's

Returns:
Task
Throws:
VCloudException
Since:
API 1.5

upgradeHardware

public Task upgradeHardware()
                     throws VCloudException
Upgrade virtual hardware version of a VM to the highest supported virtual hardware version of provider vDC where the VM locates

Returns:
Task
Throws:
VCloudException
Since:
API 1.5

consolidate

public Task consolidate()
                 throws VCloudException
Consolidates a vm. The operation cannot be executed on a deployed VM. The opration is supported only for Virtual Center version 5.0 and later.

Returns:
Task
Throws:
VCloudException
Since:
API 1.5

installVMwareTools

public static Task installVMwareTools(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                               throws VCloudException
Installs VMware tools to the virtual machine. VMware Tools can be installed only on a powered on VM's

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 1.5

upgradeHardware

public static Task upgradeHardware(VcloudClient client,
                                   com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                            throws VCloudException
Upgrade virtual hardware version of a VM to the highest supported virtual hardware version of provider vDC where the VM locates

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 1.5

consolidate

public static Task consolidate(VcloudClient client,
                               com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                        throws VCloudException
Consolidates a vm. The operation cannot be executed on a deployed VM. The opration is supported only for Virtual Center version 5.0 and later.

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 1.5

relocate

public static Task relocate(VcloudClient client,
                            com.vmware.vcloud.api.rest.schema.ReferenceType vmRef,
                            com.vmware.vcloud.api.rest.schema.ReferenceType datastoreReference)
                     throws VCloudException
Deprecated. API 5.1, SDK 5.1, use VMupdateVM(VmType) to relocate vm to a different StorageProfle. Storage profile can be specified by using VmType

Relocate/Migrate a vm to a different datastore. The operation can be performed on powered on and powered off VMs. The datastore should be from the same Organization vDc.

Parameters:
client - VcloudClient
vmRef - ReferenceType
datastoreReference - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

relocate

public Task relocate(com.vmware.vcloud.api.rest.schema.ReferenceType datastoreReference)
              throws VCloudException
Deprecated. API 5.1, SDK 5.1, use VMupdateVM(VmType) to relocate vm to a different StorageProfle. Storage profile can be specified by using VmType

Relocate/Migrate a vm to a different datastore. The operation can be performed on powered on and powered off VMs. The datastore should be from the same Organization vDc.

Parameters:
datastoreReference - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

attachDisk

public Task attachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
                throws VCloudException
Attaching a disk to the VM.

Parameters:
diskRef -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

attachDisk

public Task attachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef,
                       Integer busNumber,
                       Integer unitNumber)
                throws VCloudException
Attaching a disk to the VM.

Parameters:
diskRef -
busNumber -
unitNumber -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

detachDisk

public Task detachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
                throws VCloudException
Detaching disk from the VM.

Parameters:
diskRef -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

detachDisk

public Task detachDisk(com.vmware.vcloud.api.rest.schema.ReferenceType diskRef,
                       Integer busNumber,
                       Integer unitNumber)
                throws VCloudException
Detaching disk from the VM.

Parameters:
diskRef -
busNumber -
unitNumber -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

getAttachedDisks

public List<com.vmware.vcloud.api.rest.schema.ReferenceType> getAttachedDisks()
                                                                       throws VCloudException
Returns the list of independent disks which are attached to this VM.

Returns:
List
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

enableNestedHypervisor

public Task enableNestedHypervisor()
                            throws VCloudException
Enable the nested hypervisor feature on this vm. Hardware-assisted CPU virtualization to guest OS is only supported in virtual machine with virtual hardware version 9 or later

Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

enableNestedHypervisor

public static Task enableNestedHypervisor(VcloudClient client,
                                          com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                   throws VCloudException
Enable the nested hypervisor feature on this vm. Hardware-assisted CPU virtualization to guest OS is only supported in virtual machine with virtual hardware version 9 or later

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

disableNestedHypervisor

public Task disableNestedHypervisor()
                             throws VCloudException
Disable the nested hypervisor feature on this vm. Hardware-assisted CPU virtualization to guest OS is only supported in virtual machine with virtual hardware version 9 or later

Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

disableNestedHypervisor

public static Task disableNestedHypervisor(VcloudClient client,
                                           com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                    throws VCloudException
Disable the nested hypervisor feature on this vm. Hardware-assisted CPU virtualization to guest OS is only supported in virtual machine with virtual hardware version 9 or later

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

updateHotAdd

public Task updateHotAdd(boolean memoryHotAdd,
                         boolean cpuHotAdd)
                  throws VCloudException
Enable/Disable the hot add options for this vm. Editable only if the VM(hardware version >= 7) and its guest OS supports hot-add.

Parameters:
memoryHotAdd -
cpuHotAdd -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

updateHotAdd

public static Task updateHotAdd(VcloudClient client,
                                com.vmware.vcloud.api.rest.schema.ReferenceType vmRef,
                                boolean memoryHotAdd,
                                boolean cpuHotAdd)
                         throws VCloudException
Enable/Disable the hot add options for this vm. Editable only if the VM(hardware version >= 7) and its guest OS supports hot-add.

Parameters:
client - VcloudClient
vmRef - ReferenceType
memoryHotAdd -
cpuHotAdd -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

checkCompliance

public Task checkCompliance()
                     throws VCloudException
Perform storage profile compliance check on a VM.

Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

checkCompliance

public static Task checkCompliance(VcloudClient client,
                                   com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                            throws VCloudException
Perform storage profile compliance check on a VM.

Parameters:
client -
vmRef -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

complianceResult

public com.vmware.vcloud.api.rest.schema.ComplianceResultType complianceResult()
                                                                        throws VCloudException
Returns the storage profile compliance result on a VM.

Returns:
ComplianceResultType
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

complianceResult

public static com.vmware.vcloud.api.rest.schema.ComplianceResultType complianceResult(VcloudClient client,
                                                                                      com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                               throws VCloudException
Returns the storage profile compliance result on a VM.

Parameters:
client -
vmRef -
Returns:
ComplianceResultType
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

reconfigureVM

public Task reconfigureVM(com.vmware.vcloud.api.rest.schema.VmType vmType)
                   throws VCloudException
Updates VM name, Description, and any or all of the following sections: VirtualHardwareSection OperatingSystemSection NetworkConnectionSection GuestCustomizationSection Sections not included in the request body will not be updated.

Parameters:
vmType - VmType
Returns:
TaskType
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

acquireMksTicket

public com.vmware.vcloud.api.rest.schema.MksTicketType acquireMksTicket()
                                                                 throws VCloudException
Retrieve a mks ticket that you can use to gain access to the console of a running VM

Returns:
MksTicketType
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

getCurrentMetrics

public com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics(com.vmware.vcloud.api.rest.schema.CurrentUsageSpecType currentUsageSpec)
                                                                     throws VCloudException
Gets the current usage for VM metrics according to the provided spec object.

Parameters:
currentUsageSpec - CurrentUsageSpecType
Returns:
CurrentUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getCurrentMetrics

public static com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics(VcloudClient client,
                                                                                   com.vmware.vcloud.api.rest.schema.ReferenceType vmRef,
                                                                                   com.vmware.vcloud.api.rest.schema.CurrentUsageSpecType currentUsageSpec)
                                                                            throws VCloudException
Gets the current usage for VM metrics according to the provided spec object.

Parameters:
client - VcloudClient
vmRef - ReferenceType
currentUsageSpec - CurrentUsageSpecType
Returns:
CurrentUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getCurrentMetrics

public com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics()
                                                                     throws VCloudException
Gets the current usage for all available VM metrics.

Returns:
CurrentUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getCurrentMetrics

public static com.vmware.vcloud.api.rest.schema.CurrentUsageType getCurrentMetrics(VcloudClient client,
                                                                                   com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                            throws VCloudException
Gets the current usage for all available VM metrics.

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
CurrentUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getHistoricMetrics

public com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics(com.vmware.vcloud.api.rest.schema.HistoricUsageSpecType historicUsageSpec)
                                                                       throws VCloudException
Gets the historic usage for VM metrics according to the provided spec object.

Parameters:
historicUsageSpec - HistoricUsageSpecType
Returns:
HistoricUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getHistoricMetrics

public static com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics(VcloudClient client,
                                                                                     com.vmware.vcloud.api.rest.schema.ReferenceType vmRef,
                                                                                     com.vmware.vcloud.api.rest.schema.HistoricUsageSpecType historicUsageSpec)
                                                                              throws VCloudException
Gets the historic usage for VM metrics according to the provided spec object.

Parameters:
client - VcloudClient
vmRef - ReferenceType
historicUsageSpec - HistoricUsageSpecType
Returns:
HistoricUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getHistoricMetrics

public com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics()
                                                                       throws VCloudException
Gets the past 24 hours worth of samples for all available VM metrics.

Returns:
HistoricUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

getHistoricMetrics

public static com.vmware.vcloud.api.rest.schema.HistoricUsageType getHistoricMetrics(VcloudClient client,
                                                                                     com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                                                              throws VCloudException
Gets the past 24 hours worth of samples for all available VM metrics.

Parameters:
client - VcloudClient
vmRef - ReferenceType
Returns:
HistoricUsageType instance of metrics for the specified VM
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

forceGuestCustomization

public void forceGuestCustomization()
                             throws VCloudException
Force guest customization on next power on. By default, guest customization is applied only once when VM is deployed for the first time. Subsequent deployments assume that VM has already been customized and skip customization.

Throws:
VCloudException
Since:
API 5.6, SDK 5.6

forceGuestCustomization

public static void forceGuestCustomization(VcloudClient client,
                                           com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                                    throws VCloudException
Force guest customization on next power on. By default, guest customization is applied only once when VM is deployed for the first time. Subsequent deployments assume that VM has already been customized and skip customization.

Parameters:
client -
vmRef -
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

reloadFromVC

public Task reloadFromVC()
                  throws VCloudException
Reloads VM state from VC. Checks VM's extra configuration properties to ensure that they include all the default properties required for cloud-managed VMs and do not include any blacklisted properties or values. Reconfigures VM to add default properties and remove blacklisted properties and values if needed.

Returns:
Task
Throws:
VCloudException
Since:
API 5.6, SDK 5.6

reloadFromVC

public static Task reloadFromVC(VcloudClient client,
                                com.vmware.vcloud.api.rest.schema.ReferenceType vmRef)
                         throws VCloudException
Reloads VM state from VC. Checks VM's extra configuration properties to ensure that they include all the default properties required for cloud-managed VMs and do not include any blacklisted properties or values. Reconfigures VM to add default properties and remove blacklisted properties and values if needed.

Parameters:
client -
vmRef -
Returns:
Task
Throws:
VCloudException
Since:
API 5.6, SDK 5.6


Copyright © 2016. All Rights Reserved.