Class VMAppliance

java.lang.Object
com.xensource.xenapi.XenAPIObject
com.xensource.xenapi.VMAppliance

public class VMAppliance extends XenAPIObject
VM appliance First published in XenServer 6.0.
Author:
Cloud Software Group, Inc.
  • Field Details

    • ref

      protected final String ref
      The XenAPI reference (OpaqueRef) to this object.
  • Method Details

    • toWireString

      public String toWireString()
      Specified by:
      toWireString in class XenAPIObject
      Returns:
      The XenAPI reference (OpaqueRef) to this object.
    • equals

      public boolean equals(Object obj)
      If obj is a VMAppliance, compares XenAPI references for equality.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getRecord

      public VMAppliance.Record getRecord(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get a record containing the current state of the given VM_appliance. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      all fields from the object
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getByUuid

      public static VMAppliance getByUuid(Connection c, String uuid) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get a reference to the VM_appliance instance with the specified UUID. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      uuid - UUID of object to return
      Returns:
      reference to the object
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • createAsync

      public static Task createAsync(Connection c, VMAppliance.Record record) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Create a new VM_appliance instance, and return its handle. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      record - All constructor arguments
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • create

      public static VMAppliance create(Connection c, VMAppliance.Record record) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Create a new VM_appliance instance, and return its handle. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      record - All constructor arguments
      Returns:
      reference to the newly created object
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • destroyAsync

      public Task destroyAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Destroy the specified VM_appliance instance. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • destroy

      public void destroy(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Destroy the specified VM_appliance instance. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getByNameLabel

      public static Set<VMAppliance> getByNameLabel(Connection c, String label) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get all the VM_appliance instances with the given label. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      label - label of object to return
      Returns:
      references to objects with matching names
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getUuid

      public String getUuid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the uuid field of the given VM_appliance. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      value of the field
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getNameLabel

      public String getNameLabel(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the name/label field of the given VM_appliance. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      value of the field
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getNameDescription

      public String getNameDescription(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the name/description field of the given VM_appliance. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      value of the field
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getAllowedOperations

      public Set<Types.VmApplianceOperation> getAllowedOperations(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the allowed_operations field of the given VM_appliance. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      value of the field
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getCurrentOperations

      public Map<String,Types.VmApplianceOperation> getCurrentOperations(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the current_operations field of the given VM_appliance. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      value of the field
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getVMs

      public Set<VM> getVMs(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the VMs field of the given VM_appliance. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      value of the field
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • setNameLabel

      public void setNameLabel(Connection c, String label) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Set the name/label field of the given VM_appliance. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      label - New value to set
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • setNameDescription

      public void setNameDescription(Connection c, String description) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Set the name/description field of the given VM_appliance. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      description - New value to set
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • startAsync

      public Task startAsync(Connection c, Boolean paused) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      Start all VMs in the appliance Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      paused - Instantiate all VMs belonging to this appliance in paused state if set to true.
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • start

      public void start(Connection c, Boolean paused) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      Start all VMs in the appliance Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      paused - Instantiate all VMs belonging to this appliance in paused state if set to true.
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • cleanShutdownAsync

      public Task cleanShutdownAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      Perform a clean shutdown of all the VMs in the appliance Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • cleanShutdown

      public void cleanShutdown(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      Perform a clean shutdown of all the VMs in the appliance Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • hardShutdownAsync

      public Task hardShutdownAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      Perform a hard shutdown of all the VMs in the appliance Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • hardShutdown

      public void hardShutdown(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      Perform a hard shutdown of all the VMs in the appliance Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • shutdownAsync

      public Task shutdownAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      For each VM in the appliance, try to shut it down cleanly. If this fails, perform a hard shutdown of the VM. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • shutdown

      public void shutdown(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.OperationPartiallyFailed
      For each VM in the appliance, try to shut it down cleanly. If this fails, perform a hard shutdown of the VM. Minimum allowed role: pool-operator First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.OperationPartiallyFailed - Some VMs belonging to the appliance threw an exception while carrying out the specified operation
    • assertCanBeRecoveredAsync

      public Task assertCanBeRecoveredAsync(Connection c, Session sessionTo) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.VmRequiresSr
      Assert whether all SRs required to recover this VM appliance are available. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      sessionTo - The session to which the VM appliance is to be recovered.
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.VmRequiresSr - You attempted to run a VM on a host which doesn't have access to an SR needed by the VM. The VM has at least one VBD attached to a VDI in the SR.
    • assertCanBeRecovered

      public void assertCanBeRecovered(Connection c, Session sessionTo) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.VmRequiresSr
      Assert whether all SRs required to recover this VM appliance are available. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      sessionTo - The session to which the VM appliance is to be recovered.
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.VmRequiresSr - You attempted to run a VM on a host which doesn't have access to an SR needed by the VM. The VM has at least one VBD attached to a VDI in the SR.
    • getSRsRequiredForRecoveryAsync

      public Task getSRsRequiredForRecoveryAsync(Connection c, Session sessionTo) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the list of SRs required by the VM appliance to recover. Minimum allowed role: read-only First published in XenServer 6.5.
      Parameters:
      c - The connection the call is made on
      sessionTo - The session to which the list of SRs have to be recovered .
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getSRsRequiredForRecovery

      public Set<SR> getSRsRequiredForRecovery(Connection c, Session sessionTo) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Get the list of SRs required by the VM appliance to recover. Minimum allowed role: read-only First published in XenServer 6.5.
      Parameters:
      c - The connection the call is made on
      sessionTo - The session to which the list of SRs have to be recovered .
      Returns:
      refs for SRs required to recover the VM
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • recoverAsync

      public Task recoverAsync(Connection c, Session sessionTo, Boolean force) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.VmRequiresSr
      Recover the VM appliance Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      sessionTo - The session to which the VM appliance is to be recovered.
      force - Whether the VMs should replace newer versions of themselves.
      Returns:
      Task
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.VmRequiresSr - You attempted to run a VM on a host which doesn't have access to an SR needed by the VM. The VM has at least one VBD attached to a VDI in the SR.
    • recover

      public void recover(Connection c, Session sessionTo, Boolean force) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException, Types.VmRequiresSr
      Recover the VM appliance Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      sessionTo - The session to which the VM appliance is to be recovered.
      force - Whether the VMs should replace newer versions of themselves.
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
      Types.VmRequiresSr - You attempted to run a VM on a host which doesn't have access to an SR needed by the VM. The VM has at least one VBD attached to a VDI in the SR.
    • getAll

      public static Set<VMAppliance> getAll(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Return a list of all the VM_appliances known to the system. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      references to all objects
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.
    • getAllRecords

      public static Map<VMAppliance,VMAppliance.Record> getAllRecords(Connection c) throws Types.BadServerResponse, Types.XenAPIException, org.apache.xmlrpc.XmlRpcException
      Return a map of VM_appliance references to VM_appliance records for all VM_appliances known to the system. Minimum allowed role: read-only First published in XenServer 6.0.
      Parameters:
      c - The connection the call is made on
      Returns:
      records of all objects
      Throws:
      Types.BadServerResponse - Thrown if the response from the server contains an invalid status.
      Types.XenAPIException - Thrown if the call failed.
      org.apache.xmlrpc.XmlRpcException - Thrown if the result of an asynchronous call could not be parsed.