com.xensource.xenapi
Class VDI

java.lang.Object
  extended by com.xensource.xenapi.XenAPIObject
      extended by com.xensource.xenapi.VDI

public class VDI
extends XenAPIObject

A virtual disk image


Nested Class Summary
static class VDI.Record
          Represents all the fields in a VDI
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
 void addTags(Connection c, String value)
          Add the given value to the tags field of the given VDI.
 void addToOtherConfig(Connection c, String key, String value)
          Add the given key-value pair to the other_config field of the given VDI.
 void addToSmConfig(Connection c, String key, String value)
          Add the given key-value pair to the sm_config field of the given VDI.
 void addToXenstoreData(Connection c, String key, String value)
          Add the given key-value pair to the xenstore_data field of the given VDI.
 VDI copy(Connection c, SR sr)
          Make a fresh VDI in the specified SR and copy the supplied VDI's data to the new disk
 Task copyAsync(Connection c, SR sr)
          Make a fresh VDI in the specified SR and copy the supplied VDI's data to the new disk
static VDI create(Connection c, VDI.Record record)
          Create a new VDI instance, and return its handle.
static Task createAsync(Connection c, VDI.Record record)
          Create a new VDI instance, and return its handle.
 VDI createClone(Connection c, Map<String,String> driverParams)
          Take an exact copy of the VDI and return a reference to the new disk.
 Task createCloneAsync(Connection c, Map<String,String> driverParams)
          Take an exact copy of the VDI and return a reference to the new disk.
 void dbForget(Connection c)
          Removes a VDI record from the database
 Task dbForgetAsync(Connection c)
          Removes a VDI record from the database
static VDI dbIntroduce(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String,String> otherConfig, String location, Map<String,String> xenstoreData, Map<String,String> smConfig)
          Create a new VDI record in the database only
static Task dbIntroduceAsync(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String,String> otherConfig, String location, Map<String,String> xenstoreData, Map<String,String> smConfig)
          Create a new VDI record in the database only
 void destroy(Connection c)
          Destroy the specified VDI instance.
 Task destroyAsync(Connection c)
          Destroy the specified VDI instance.
 boolean equals(Object obj)
          If obj is a VDI, compares XenAPI references for equality.
 void forget(Connection c)
          Removes a VDI record from the database
 Task forgetAsync(Connection c)
          Removes a VDI record from the database
static Set<VDI> getAll(Connection c)
          Return a list of all the VDIs known to the system.
 Boolean getAllowCaching(Connection c)
          Get the allow_caching field of the given VDI.
 Set<Types.VdiOperations> getAllowedOperations(Connection c)
          Get the allowed_operations field of the given VDI.
static Map<VDI,VDI.Record> getAllRecords(Connection c)
          Return a map of VDI references to VDI records for all VDIs known to the system.
static Set<VDI> getByNameLabel(Connection c, String label)
          Get all the VDI instances with the given label.
static VDI getByUuid(Connection c, String uuid)
          Get a reference to the VDI instance with the specified UUID.
 Set<Crashdump> getCrashDumps(Connection c)
          Get the crash_dumps field of the given VDI.
 Map<String,Types.VdiOperations> getCurrentOperations(Connection c)
          Get the current_operations field of the given VDI.
 Boolean getIsASnapshot(Connection c)
          Get the is_a_snapshot field of the given VDI.
 String getLocation(Connection c)
          Get the location field of the given VDI.
 Boolean getManaged(Connection c)
          Get the managed field of the given VDI.
 Boolean getMissing(Connection c)
          Get the missing field of the given VDI.
 String getNameDescription(Connection c)
          Get the name/description field of the given VDI.
 String getNameLabel(Connection c)
          Get the name/label field of the given VDI.
 Types.OnBoot getOnBoot(Connection c)
          Get the on_boot field of the given VDI.
 Map<String,String> getOtherConfig(Connection c)
          Get the other_config field of the given VDI.
 VDI getParent(Connection c)
          Get the parent field of the given VDI.
 Long getPhysicalUtilisation(Connection c)
          Get the physical_utilisation field of the given VDI.
 Boolean getReadOnly(Connection c)
          Get the read_only field of the given VDI.
 VDI.Record getRecord(Connection c)
          Get a record containing the current state of the given VDI.
 Boolean getSharable(Connection c)
          Get the sharable field of the given VDI.
 Map<String,String> getSmConfig(Connection c)
          Get the sm_config field of the given VDI.
 VDI getSnapshotOf(Connection c)
          Get the snapshot_of field of the given VDI.
 Set<VDI> getSnapshots(Connection c)
          Get the snapshots field of the given VDI.
 Date getSnapshotTime(Connection c)
          Get the snapshot_time field of the given VDI.
 SR getSR(Connection c)
          Get the SR field of the given VDI.
 Boolean getStorageLock(Connection c)
          Get the storage_lock field of the given VDI.
 Set<String> getTags(Connection c)
          Get the tags field of the given VDI.
 Types.VdiType getType(Connection c)
          Get the type field of the given VDI.
 String getUuid(Connection c)
          Get the uuid field of the given VDI.
 Set<VBD> getVBDs(Connection c)
          Get the VBDs field of the given VDI.
 Long getVirtualSize(Connection c)
          Get the virtual_size field of the given VDI.
 Map<String,String> getXenstoreData(Connection c)
          Get the xenstore_data field of the given VDI.
 int hashCode()
           
static VDI introduce(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String,String> otherConfig, String location, Map<String,String> xenstoreData, Map<String,String> smConfig)
          Create a new VDI record in the database only
static Task introduceAsync(Connection c, String uuid, String nameLabel, String nameDescription, SR SR, Types.VdiType type, Boolean sharable, Boolean readOnly, Map<String,String> otherConfig, String location, Map<String,String> xenstoreData, Map<String,String> smConfig)
          Create a new VDI record in the database only
 void removeFromOtherConfig(Connection c, String key)
          Remove the given key and its corresponding value from the other_config field of the given VDI.
 void removeFromSmConfig(Connection c, String key)
          Remove the given key and its corresponding value from the sm_config field of the given VDI.
 void removeFromXenstoreData(Connection c, String key)
          Remove the given key and its corresponding value from the xenstore_data field of the given VDI.
 void removeTags(Connection c, String value)
          Remove the given value from the tags field of the given VDI.
 void resize(Connection c, Long size)
          Resize the VDI.
 Task resizeAsync(Connection c, Long size)
          Resize the VDI.
 void resizeOnline(Connection c, Long size)
          Resize the VDI which may or may not be attached to running guests.
 Task resizeOnlineAsync(Connection c, Long size)
          Resize the VDI which may or may not be attached to running guests.
 void setManaged(Connection c, Boolean value)
          Sets the VDI's managed field
 void setMissing(Connection c, Boolean value)
          Sets the VDI's missing field
 void setNameDescription(Connection c, String description)
          Set the name/description field of the given VDI.
 void setNameLabel(Connection c, String label)
          Set the name/label field of the given VDI.
 void setOtherConfig(Connection c, Map<String,String> otherConfig)
          Set the other_config field of the given VDI.
 void setPhysicalUtilisation(Connection c, Long value)
          Sets the VDI's physical_utilisation field
 void setReadOnly(Connection c, Boolean value)
          Sets the VDI's read_only field
 void setSharable(Connection c, Boolean value)
          Sets the VDI's sharable field
 void setSmConfig(Connection c, Map<String,String> smConfig)
          Set the sm_config field of the given VDI.
 void setTags(Connection c, Set<String> tags)
          Set the tags field of the given VDI.
 void setVirtualSize(Connection c, Long value)
          Sets the VDI's virtual_size field
 void setXenstoreData(Connection c, Map<String,String> xenstoreData)
          Set the xenstore_data field of the given VDI.
 VDI snapshot(Connection c, Map<String,String> driverParams)
          Take a read-only snapshot of the VDI, returning a reference to the snapshot.
 Task snapshotAsync(Connection c, Map<String,String> driverParams)
          Take a read-only snapshot of the VDI, returning a reference to the snapshot.
 String toWireString()
           
 void update(Connection c)
          Ask the storage backend to refresh the fields in the VDI object
 Task updateAsync(Connection c)
          Ask the storage backend to refresh the fields in the VDI object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final String ref
The XenAPI reference to this object.

Method Detail

toWireString

public String toWireString()
Specified by:
toWireString in class XenAPIObject

equals

public boolean equals(Object obj)
If obj is a VDI, compares XenAPI references for equality.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getRecord

public VDI.Record getRecord(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException
Get a record containing the current state of the given VDI.

Returns:
all fields from the object
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getByUuid

public static VDI getByUuid(Connection c,
                            String uuid)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException
Get a reference to the VDI instance with the specified UUID.

Parameters:
uuid - UUID of object to return
Returns:
reference to the object
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createAsync

public static Task createAsync(Connection c,
                               VDI.Record record)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Create a new VDI instance, and return its handle.

Parameters:
record - All constructor arguments
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

create

public static VDI create(Connection c,
                         VDI.Record record)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Create a new VDI instance, and return its handle.

Parameters:
record - All constructor arguments
Returns:
reference to the newly created object
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroyAsync

public Task destroyAsync(Connection c)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Destroy the specified VDI instance.

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroy

public void destroy(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Destroy the specified VDI instance.

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getByNameLabel

public static Set<VDI> getByNameLabel(Connection c,
                                      String label)
                               throws Types.BadServerResponse,
                                      Types.XenAPIException,
                                      org.apache.xmlrpc.XmlRpcException
Get all the VDI instances with the given label.

Parameters:
label - label of object to return
Returns:
references to objects with matching names
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getUuid

public String getUuid(Connection c)
               throws Types.BadServerResponse,
                      Types.XenAPIException,
                      org.apache.xmlrpc.XmlRpcException
Get the uuid field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getNameLabel

public String getNameLabel(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Get the name/label field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getNameDescription

public String getNameDescription(Connection c)
                          throws Types.BadServerResponse,
                                 Types.XenAPIException,
                                 org.apache.xmlrpc.XmlRpcException
Get the name/description field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllowedOperations

public Set<Types.VdiOperations> getAllowedOperations(Connection c)
                                              throws Types.BadServerResponse,
                                                     Types.XenAPIException,
                                                     org.apache.xmlrpc.XmlRpcException
Get the allowed_operations field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getCurrentOperations

public Map<String,Types.VdiOperations> getCurrentOperations(Connection c)
                                                     throws Types.BadServerResponse,
                                                            Types.XenAPIException,
                                                            org.apache.xmlrpc.XmlRpcException
Get the current_operations field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getSR

public SR getSR(Connection c)
         throws Types.BadServerResponse,
                Types.XenAPIException,
                org.apache.xmlrpc.XmlRpcException
Get the SR field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getVBDs

public Set<VBD> getVBDs(Connection c)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Get the VBDs field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getCrashDumps

public Set<Crashdump> getCrashDumps(Connection c)
                             throws Types.BadServerResponse,
                                    Types.XenAPIException,
                                    org.apache.xmlrpc.XmlRpcException
Get the crash_dumps field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getVirtualSize

public Long getVirtualSize(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Get the virtual_size field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getPhysicalUtilisation

public Long getPhysicalUtilisation(Connection c)
                            throws Types.BadServerResponse,
                                   Types.XenAPIException,
                                   org.apache.xmlrpc.XmlRpcException
Get the physical_utilisation field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getType

public Types.VdiType getType(Connection c)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Get the type field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getSharable

public Boolean getSharable(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Get the sharable field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getReadOnly

public Boolean getReadOnly(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Get the read_only field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getOtherConfig

public Map<String,String> getOtherConfig(Connection c)
                                  throws Types.BadServerResponse,
                                         Types.XenAPIException,
                                         org.apache.xmlrpc.XmlRpcException
Get the other_config field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getStorageLock

public Boolean getStorageLock(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Get the storage_lock field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getLocation

public String getLocation(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Get the location field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getManaged

public Boolean getManaged(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Get the managed field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getMissing

public Boolean getMissing(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Get the missing field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getParent

public VDI getParent(Connection c)
              throws Types.BadServerResponse,
                     Types.XenAPIException,
                     org.apache.xmlrpc.XmlRpcException
Get the parent field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getXenstoreData

public Map<String,String> getXenstoreData(Connection c)
                                   throws Types.BadServerResponse,
                                          Types.XenAPIException,
                                          org.apache.xmlrpc.XmlRpcException
Get the xenstore_data field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getSmConfig

public Map<String,String> getSmConfig(Connection c)
                               throws Types.BadServerResponse,
                                      Types.XenAPIException,
                                      org.apache.xmlrpc.XmlRpcException
Get the sm_config field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getIsASnapshot

public Boolean getIsASnapshot(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Get the is_a_snapshot field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getSnapshotOf

public VDI getSnapshotOf(Connection c)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Get the snapshot_of field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getSnapshots

public Set<VDI> getSnapshots(Connection c)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Get the snapshots field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getSnapshotTime

public Date getSnapshotTime(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException
Get the snapshot_time field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getTags

public Set<String> getTags(Connection c)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Get the tags field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllowCaching

public Boolean getAllowCaching(Connection c)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Get the allow_caching field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getOnBoot

public Types.OnBoot getOnBoot(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Get the on_boot field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

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 VDI.

Parameters:
label - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

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 VDI.

Parameters:
description - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setOtherConfig

public void setOtherConfig(Connection c,
                           Map<String,String> otherConfig)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Set the other_config field of the given VDI.

Parameters:
otherConfig - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToOtherConfig

public void addToOtherConfig(Connection c,
                             String key,
                             String value)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Add the given key-value pair to the other_config field of the given VDI.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromOtherConfig

public void removeFromOtherConfig(Connection c,
                                  String key)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Remove the given key and its corresponding value from the other_config field of the given VDI. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setXenstoreData

public void setXenstoreData(Connection c,
                            Map<String,String> xenstoreData)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException
Set the xenstore_data field of the given VDI.

Parameters:
xenstoreData - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToXenstoreData

public void addToXenstoreData(Connection c,
                              String key,
                              String value)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Add the given key-value pair to the xenstore_data field of the given VDI.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromXenstoreData

public void removeFromXenstoreData(Connection c,
                                   String key)
                            throws Types.BadServerResponse,
                                   Types.XenAPIException,
                                   org.apache.xmlrpc.XmlRpcException
Remove the given key and its corresponding value from the xenstore_data field of the given VDI. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setSmConfig

public void setSmConfig(Connection c,
                        Map<String,String> smConfig)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Set the sm_config field of the given VDI.

Parameters:
smConfig - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToSmConfig

public void addToSmConfig(Connection c,
                          String key,
                          String value)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Add the given key-value pair to the sm_config field of the given VDI.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromSmConfig

public void removeFromSmConfig(Connection c,
                               String key)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Remove the given key and its corresponding value from the sm_config field of the given VDI. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setTags

public void setTags(Connection c,
                    Set<String> tags)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Set the tags field of the given VDI.

Parameters:
tags - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addTags

public void addTags(Connection c,
                    String value)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Add the given value to the tags field of the given VDI. If the value is already in that Set, then do nothing.

Parameters:
value - New value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeTags

public void removeTags(Connection c,
                       String value)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Remove the given value from the tags field of the given VDI. If the value is not in that Set, then do nothing.

Parameters:
value - Value to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

snapshotAsync

public Task snapshotAsync(Connection c,
                          Map<String,String> driverParams)
                   throws Types.BadServerResponse,
                          Types.VersionException,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Take a read-only snapshot of the VDI, returning a reference to the snapshot. If any driver_params are specified then these are passed through to the storage-specific substrate driver that takes the snapshot. NB the snapshot lives in the same Storage Repository as its parent.

Parameters:
driverParams - Optional parameters that can be passed through to backend driver in order to specify storage-type-specific snapshot options
Returns:
Task
Throws:
Types.BadServerResponse
Types.VersionException
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

snapshot

public VDI snapshot(Connection c,
                    Map<String,String> driverParams)
             throws Types.BadServerResponse,
                    Types.VersionException,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Take a read-only snapshot of the VDI, returning a reference to the snapshot. If any driver_params are specified then these are passed through to the storage-specific substrate driver that takes the snapshot. NB the snapshot lives in the same Storage Repository as its parent.

Parameters:
driverParams - Optional parameters that can be passed through to backend driver in order to specify storage-type-specific snapshot options
Returns:
The ID of the newly created VDI.
Throws:
Types.BadServerResponse
Types.VersionException
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createCloneAsync

public Task createCloneAsync(Connection c,
                             Map<String,String> driverParams)
                      throws Types.BadServerResponse,
                             Types.VersionException,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Take an exact copy of the VDI and return a reference to the new disk. If any driver_params are specified then these are passed through to the storage-specific substrate driver that implements the clone operation. NB the clone lives in the same Storage Repository as its parent.

Parameters:
driverParams - Optional parameters that are passed through to the backend driver in order to specify storage-type-specific clone options
Returns:
Task
Throws:
Types.BadServerResponse
Types.VersionException
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createClone

public VDI createClone(Connection c,
                       Map<String,String> driverParams)
                throws Types.BadServerResponse,
                       Types.VersionException,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Take an exact copy of the VDI and return a reference to the new disk. If any driver_params are specified then these are passed through to the storage-specific substrate driver that implements the clone operation. NB the clone lives in the same Storage Repository as its parent.

Parameters:
driverParams - Optional parameters that are passed through to the backend driver in order to specify storage-type-specific clone options
Returns:
The ID of the newly created VDI.
Throws:
Types.BadServerResponse
Types.VersionException
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

resizeAsync

public Task resizeAsync(Connection c,
                        Long size)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Resize the VDI.

Parameters:
size - The new size of the VDI
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

resize

public void resize(Connection c,
                   Long size)
            throws Types.BadServerResponse,
                   Types.XenAPIException,
                   org.apache.xmlrpc.XmlRpcException
Resize the VDI.

Parameters:
size - The new size of the VDI
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

resizeOnlineAsync

public Task resizeOnlineAsync(Connection c,
                              Long size)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Resize the VDI which may or may not be attached to running guests.

Parameters:
size - The new size of the VDI
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

resizeOnline

public void resizeOnline(Connection c,
                         Long size)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Resize the VDI which may or may not be attached to running guests.

Parameters:
size - The new size of the VDI
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

introduceAsync

public static Task introduceAsync(Connection c,
                                  String uuid,
                                  String nameLabel,
                                  String nameDescription,
                                  SR SR,
                                  Types.VdiType type,
                                  Boolean sharable,
                                  Boolean readOnly,
                                  Map<String,String> otherConfig,
                                  String location,
                                  Map<String,String> xenstoreData,
                                  Map<String,String> smConfig)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException,
                                  Types.SrOperationNotSupported
Create a new VDI record in the database only

Parameters:
uuid - The uuid of the disk to introduce
nameLabel - The name of the disk record
nameDescription - The description of the disk record
SR - The SR that the VDI is in
type - The type of the VDI
sharable - true if this disk may be shared
readOnly - true if this disk may ONLY be mounted read-only
otherConfig - additional configuration
location - location information
xenstoreData - Data to insert into xenstore
smConfig - Storage-specific config
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
Types.SrOperationNotSupported

introduce

public static VDI introduce(Connection c,
                            String uuid,
                            String nameLabel,
                            String nameDescription,
                            SR SR,
                            Types.VdiType type,
                            Boolean sharable,
                            Boolean readOnly,
                            Map<String,String> otherConfig,
                            String location,
                            Map<String,String> xenstoreData,
                            Map<String,String> smConfig)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException,
                            Types.SrOperationNotSupported
Create a new VDI record in the database only

Parameters:
uuid - The uuid of the disk to introduce
nameLabel - The name of the disk record
nameDescription - The description of the disk record
SR - The SR that the VDI is in
type - The type of the VDI
sharable - true if this disk may be shared
readOnly - true if this disk may ONLY be mounted read-only
otherConfig - additional configuration
location - location information
xenstoreData - Data to insert into xenstore
smConfig - Storage-specific config
Returns:
The ref of the newly created VDI record.
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
Types.SrOperationNotSupported

dbIntroduceAsync

public static Task dbIntroduceAsync(Connection c,
                                    String uuid,
                                    String nameLabel,
                                    String nameDescription,
                                    SR SR,
                                    Types.VdiType type,
                                    Boolean sharable,
                                    Boolean readOnly,
                                    Map<String,String> otherConfig,
                                    String location,
                                    Map<String,String> xenstoreData,
                                    Map<String,String> smConfig)
                             throws Types.BadServerResponse,
                                    Types.XenAPIException,
                                    org.apache.xmlrpc.XmlRpcException
Create a new VDI record in the database only

Parameters:
uuid - The uuid of the disk to introduce
nameLabel - The name of the disk record
nameDescription - The description of the disk record
SR - The SR that the VDI is in
type - The type of the VDI
sharable - true if this disk may be shared
readOnly - true if this disk may ONLY be mounted read-only
otherConfig - additional configuration
location - location information
xenstoreData - Data to insert into xenstore
smConfig - Storage-specific config
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

dbIntroduce

public static VDI dbIntroduce(Connection c,
                              String uuid,
                              String nameLabel,
                              String nameDescription,
                              SR SR,
                              Types.VdiType type,
                              Boolean sharable,
                              Boolean readOnly,
                              Map<String,String> otherConfig,
                              String location,
                              Map<String,String> xenstoreData,
                              Map<String,String> smConfig)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Create a new VDI record in the database only

Parameters:
uuid - The uuid of the disk to introduce
nameLabel - The name of the disk record
nameDescription - The description of the disk record
SR - The SR that the VDI is in
type - The type of the VDI
sharable - true if this disk may be shared
readOnly - true if this disk may ONLY be mounted read-only
otherConfig - additional configuration
location - location information
xenstoreData - Data to insert into xenstore
smConfig - Storage-specific config
Returns:
The ref of the newly created VDI record.
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

dbForgetAsync

public Task dbForgetAsync(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Removes a VDI record from the database

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

dbForget

public void dbForget(Connection c)
              throws Types.BadServerResponse,
                     Types.XenAPIException,
                     org.apache.xmlrpc.XmlRpcException
Removes a VDI record from the database

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

updateAsync

public Task updateAsync(Connection c)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException,
                        Types.SrOperationNotSupported
Ask the storage backend to refresh the fields in the VDI object

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
Types.SrOperationNotSupported

update

public void update(Connection c)
            throws Types.BadServerResponse,
                   Types.XenAPIException,
                   org.apache.xmlrpc.XmlRpcException,
                   Types.SrOperationNotSupported
Ask the storage backend to refresh the fields in the VDI object

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException
Types.SrOperationNotSupported

copyAsync

public Task copyAsync(Connection c,
                      SR sr)
               throws Types.BadServerResponse,
                      Types.XenAPIException,
                      org.apache.xmlrpc.XmlRpcException
Make a fresh VDI in the specified SR and copy the supplied VDI's data to the new disk

Parameters:
sr - The destination SR
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

copy

public VDI copy(Connection c,
                SR sr)
         throws Types.BadServerResponse,
                Types.XenAPIException,
                org.apache.xmlrpc.XmlRpcException
Make a fresh VDI in the specified SR and copy the supplied VDI's data to the new disk

Parameters:
sr - The destination SR
Returns:
The reference of the newly created VDI.
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setManaged

public void setManaged(Connection c,
                       Boolean value)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Sets the VDI's managed field

Parameters:
value - The new value of the VDI's managed field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

forgetAsync

public Task forgetAsync(Connection c)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Removes a VDI record from the database

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

forget

public void forget(Connection c)
            throws Types.BadServerResponse,
                   Types.XenAPIException,
                   org.apache.xmlrpc.XmlRpcException
Removes a VDI record from the database

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setSharable

public void setSharable(Connection c,
                        Boolean value)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Sets the VDI's sharable field

Parameters:
value - The new value of the VDI's sharable field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setReadOnly

public void setReadOnly(Connection c,
                        Boolean value)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Sets the VDI's read_only field

Parameters:
value - The new value of the VDI's read_only field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setMissing

public void setMissing(Connection c,
                       Boolean value)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Sets the VDI's missing field

Parameters:
value - The new value of the VDI's missing field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setVirtualSize

public void setVirtualSize(Connection c,
                           Long value)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Sets the VDI's virtual_size field

Parameters:
value - The new value of the VDI's virtual size
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setPhysicalUtilisation

public void setPhysicalUtilisation(Connection c,
                                   Long value)
                            throws Types.BadServerResponse,
                                   Types.XenAPIException,
                                   org.apache.xmlrpc.XmlRpcException
Sets the VDI's physical_utilisation field

Parameters:
value - The new value of the VDI's physical utilisation
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAll

public static Set<VDI> getAll(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Return a list of all the VDIs known to the system.

Returns:
references to all objects
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllRecords

public static Map<VDI,VDI.Record> getAllRecords(Connection c)
                                         throws Types.BadServerResponse,
                                                Types.XenAPIException,
                                                org.apache.xmlrpc.XmlRpcException
Return a map of VDI references to VDI records for all VDIs known to the system.

Returns:
records of all objects
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException