org.libvirt
public class Domain extends Object
Field Summary | |
---|---|
protected Libvirt | libvirt
The libvirt connection from the hypervisor |
Method Summary | |
---|---|
int | abortJob()
Requests that the current background job be aborted at the soonest
opportunity. |
void | attachDevice(String xmlDesc)
Creates a virtual device attachment to backend.
|
void | attachDeviceFlags(String xmlDesc, int flags)
Creates a virtual device attachment to backend.
|
DomainBlockInfo | blockInfo(String path)
This function returns block device (disk) stats for block devices
attached to the domain.
|
DomainBlockStats | blockStats(String path)
Returns block device (disk) stats for block devices attached to this
domain. |
void | coreDump(String to, int flags)
Dumps the core of this domain on a given file for analysis. |
int | cpuMapLength(int maxCpus)
It returns the length (in bytes) required to store the complete CPU map
between a single virtual & all physical CPUs of a domain. |
int | create()
Launches this defined domain. |
int | create(int flags)
Launches this defined domain with the provide flags.
|
void | destroy()
Destroys this domain object. |
void | detachDevice(String xmlDesc)
Destroys a virtual device attachment to backend.
|
void | detachDeviceFlags(String xmlDesc, int flags)
Destroys a virtual device attachment to backend.
|
int | free()
Frees this domain object. |
boolean | getAutostart()
Provides a boolean value indicating whether the network is configured to
be automatically started when the host machine boots.
|
Connect | getConnect()
Provides the connection object associated with a domain.
|
int | getID()
Gets the hypervisor ID number for the domain
|
DomainInfo | getInfo()
Extract information about a domain. |
DomainJobInfo | getJobInfo()
Extract information about progress of a background job on a domain. |
long | getMaxMemory()
Retrieve the maximum amount of physical memory allocated to a domain.
|
int | getMaxVcpus()
Provides the maximum number of virtual CPUs supported for the guest VM.
|
String | getName()
Gets the public name for this domain
|
String | getOSType()
Gets the type of domain operation system.
|
SchedParameter[] | getSchedulerParameters()
Gets the scheduler parameters.
|
String[] | getSchedulerType()
Gets the scheduler type.
|
int[] | getUUID()
Get the UUID for this domain.
|
String | getUUIDString()
Gets the UUID for this domain as string.
|
int[] | getVcpusCpuMaps()
Returns the cpumaps for this domain Only the lower 8 bits of each int in
the array contain information.
|
VcpuInfo[] | getVcpusInfo()
Extracts information about virtual CPUs of this domain
|
String | getXMLDesc(int flags)
Provides an XML description of the domain. |
int | hasCurrentSnapshot()
Determine if the domain has a snapshot
|
int | hasManagedSaveImage()
Determine if the domain has a managed save image
|
DomainInterfaceStats | interfaceStats(String path)
Returns network interface stats for interfaces attached to this domain.
|
int | isActive()
Determine if the domain is currently running
|
int | isPersistent()
Determine if the domain has a persistent configuration which means it
will still exist after shutting down
|
int | managedSave()
suspend a domain and save its memory contents to a file on disk.
|
int | managedSaveRemote()
Remove any managed save images from the domain
|
MemoryStatistic[] | memoryStats(int number)
This function provides memory statistics for the domain.
|
Domain | migrate(Connect dconn, long flags, String dname, String uri, long bandwidth)
Migrate this domain object from its current host to the destination host
given by dconn (a connection to the destination host). |
int | migrateSetMaxDowntime(long downtime)
Sets maximum tolerable time for which the domain is allowed to be paused
at the end of live migration.
|
int | migrateToURI(String uri, long flags, String dname, long bandwidth)
Migrate the domain object from its current host to the destination host
given by duri.
|
void | pinVcpu(int vcpu, int[] cpumap)
Dynamically changes the real CPUs which can be allocated to a virtual
CPU. |
protected void | processError()
Error handling logic to throw errors. |
void | reboot(int flags)
Reboot this domain, the domain object is still usable there after but the
domain OS is being stopped for a restart. |
void | resume()
Resume this suspended domain, the process is restarted from the state
where it was frozen by calling virSuspendDomain(). |
int | revertToSnapshot(DomainSnapshot snapshot)
Revert the domain to a given snapshot.
|
void | save(String to)
Suspends this domain and saves its memory contents to a file on disk.
|
void | setAutostart(boolean autostart)
Configures the network to be automatically started when the host machine
boots.
|
void | setMaxMemory(long memory)
* Dynamically change the maximum amount of physical memory allocated to a
domain. |
void | setMemory(long memory)
Dynamically changes the target amount of physical memory allocated to
this domain. |
void | setSchedulerParameters(SchedParameter[] params)
Changes the scheduler parameters
|
void | setVcpus(int nvcpus)
Dynamically changes the number of virtual CPUs used by this domain. |
void | shutdown()
Shuts down this domain, the domain object is still usable there after but
the domain OS is being stopped. |
DomainSnapshot | snapshotCreateXML(String xmlDesc)
Creates a new snapshot of a domain based on the snapshot xml contained in
xmlDesc.
|
DomainSnapshot | snapshotCurrent()
Get the current snapshot for a domain, if any.
|
String[] | snapshotListNames()
Collect the list of domain snapshots for the given domain.
|
DomainSnapshot | snapshotLookupByName(String name)
Retrieve a snapshot by name
|
int | snapshotNum()
Provides the number of domain snapshots for this domain..
|
void | suspend()
Suspends this active domain, the process is frozen without further access
to CPU resources and I/O but the memory used by the domain at the
hypervisor level will stay allocated. |
void | undefine()
undefines this domain but does not stop it if it is running
|
int | updateDeviceFlags(String xml, int flags)
Change a virtual device on a domain
|
Returns: 0 in case of success and -1 in case of failure.
Throws: LibvirtException
See Also: Libvirt
Documentation
Parameters: xmlDesc XML description of one device
Throws: LibvirtException
See Also: Libvirt
Documentation
Parameters: xmlDesc XML description of one device flags the an OR'ed set of virDomainDeviceModifyFlags
Throws: LibvirtException
See Also: Libvirt
Documentation
Parameters: path the path to the block device
Returns: the info, or null if an error
Throws: LibvirtException
Parameters: path path to the block device
Returns: the statistics in a DomainBlockStats object
Throws: LibvirtException
Parameters: to path for the core file flags extra flags, currently unused
Throws: LibvirtException
Throws: LibvirtException
Throws: LibvirtException
Throws: LibvirtException
Parameters: xmlDesc XML description of one device
Throws: LibvirtException
See Also: Libvirt
Documentation
Parameters: xmlDesc XML description of one device
Throws: LibvirtException
See Also: Libvirt
Documentation
Returns: number of references left (>= 0) for success, -1 for failure.
Throws: LibvirtException
Returns: the result
Throws: LibvirtException
Returns: the Connect object
Returns: the hypervisor ID
Throws: LibvirtException
Returns: a DomainInfo object describing this domain
Throws: LibvirtException
See Also: Libvirt
Documentation
Returns: a DomainJobInfo object describing this domain
Throws: LibvirtException
See Also: Libvirt
Documentation
Returns: the memory in kilobytes
Throws: LibvirtException
Returns: the number of VCPUs
Throws: LibvirtException
Returns: the name
Throws: LibvirtException
Returns: the type
Throws: LibvirtException
Returns: an array of SchedParameter objects
Throws: LibvirtException
Returns: the type of the scheduler
Throws: LibvirtException
Returns: the UUID as an unpacked int array
Throws: LibvirtException
See Also: rfc4122
Returns: the UUID in canonical String format
Throws: LibvirtException
See Also: rfc4122
Returns: a bitmap of real CPUs for all vcpus of this domain
Throws: LibvirtException
Returns: an array of VcpuInfo object describing the VCPUs
Throws: LibvirtException
Parameters: flags not used
Returns: the XML description String
Throws: LibvirtException
See Also: The XML
Description format
Returns: 1 if running, 0 if inactive, -1 on error
Throws: LibvirtException
See Also: Returns: 0 if no image is present, 1 if an image is present, and -1 in
case of error Throws: LibvirtException See Also: Parameters: path
path to the interface Returns: the statistics in a DomainInterfaceStats object Throws: LibvirtException Returns: 1 if running, 0 if inactive, -1 on error Throws: LibvirtException See Also: Returns: 1 if persistent, 0 if transient, -1 on error Throws: LibvirtException See Also: Returns: 0 in case of success or -1 in case of failure Throws: LibvirtException See Also: Returns: Throws: LibvirtException See Also: Parameters: number
the number of stats to retrieve Returns: the collection of stats, or null if an error occurs. Throws: LibvirtException Parameters: dconn
destination host (a Connect object) flags
flags dname
(optional) rename domain to this at destination uri
(optional) dest hostname/URI as seen from the source host bandwidth
optional) specify migration bandwidth limit in Mbps Returns: the new domain object if the migration was successful, or NULL in
case of error. Note that the new domain object exists in the
scope of the destination connection (dconn). Throws: LibvirtException Parameters: downtime
the time to be down Returns: 0 in case of success, -1 otherwise. Throws: LibvirtException See Also: Parameters: uri
The destination URI flags
Controls the migrate dname
The name at the destnation bandwidth
Specify the migration bandwidth Returns: 0 if successful, -1 if not Throws: LibvirtException See Also: Parameters: vcpu
virtual cpu number cpumap
bit map of real CPUs represented by the the lower 8 bits of
each int in the array. Each bit set to 1 means that
corresponding CPU is usable. Bytes are stored in little-endian
order: CPU0-7, 8-15... In each byte, lowest CPU number is
least significant bit. Throws: LibvirtException Parameters: flags
extra flags for the reboot operation, not used yet Throws: LibvirtException Throws: LibvirtException Parameters: snapshot
the snapshot to revert to Returns: 0 if the creation is successful, -1 on error. Throws: LibvirtException See Also: Parameters: to
path for the output file Throws: LibvirtException Parameters: autostart Throws: LibvirtException Parameters: memory
the amount memory in kilobytes Throws: LibvirtException Parameters: memory
in kilobytes Throws: LibvirtException Parameters: params
an array of SchedParameter objects to be changed Throws: LibvirtException Parameters: nvcpus
the new number of virtual CPUs for this domain Throws: LibvirtException Throws: LibvirtException Parameters: xmlDesc
string containing an XML description of the domain Returns: the snapshot, or null on Error Throws: LibvirtException See Also: Returns: the snapshot, or null on Error Throws: LibvirtException See Also: Returns: The list of names, or null if an error Throws: LibvirtException See Also: Parameters: name
the name Returns: The located snapshot, or null if an error Throws: LibvirtException See Also: See Also: Throws: LibvirtException Throws: LibvirtException Parameters: xml
the xml to update with flags
controls the update Returns: 0 in case of success, -1 in case of failure. Throws: LibvirtException See Also: hasManagedSaveImage
.String)" id="interfaceStats(
isActive
Libvirt
Documentation
isPersistent
Libvirt
Documentation
managedSave
Libvirt
Documentation
managedSaveRemote
Libvirt
Documentation
memoryStats
migrate
migrateSetMaxDowntime
LIbvirt
Documentation
migrateToURI
http
://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI
pinVcpu
processError
reboot
resume
revertToSnapshot
Libvirt Documentation>
save
setAutostart
setMaxMemory
setMemory
setSchedulerParameters
setVcpus
shutdown
snapshotCreateXML
Libvirt
Documentation
snapshotCurrent
Libvirt
Documentation
snapshotListNames
Libvirt
Documentation
snapshotLookupByName
Libvirt
Documentation
snapshotNum
Libvirt
Documentation
suspend
undefine
updateDeviceFlags
Libvirt
Documentation