Class VirtualServer
java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Integer,VirtualServer>
com.aoindustries.aoserv.client.CachedObject<Integer,VirtualServer>
com.aoindustries.aoserv.client.CachedObjectIntegerKey<VirtualServer>
com.aoindustries.aoserv.client.infrastructure.VirtualServer
- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,AoservReadable
,AoservStreamable
,AoservWritable
,SingleTableObject<Integer,
VirtualServer>
A
VirtualServer
consumes physical resources within the
virtualization layer.- Author:
- AO Industries, Inc.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The possible state flags for the virtual server.static final int
The possible state flags for the virtual server.static final int
The possible state flags for the virtual server.static final int
The possible state flags for the virtual server.static final int
The possible state flags for the virtual server.static final int
The possible state flags for the virtual server.static final int
The possible state flags for the virtual server.Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
pkey
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
Fields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
Constructor Summary
ConstructorDescriptionDeprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptioncreate()
Calls "xm create" on the current primary physical server.destroy()
Calls "xm destroy" on the current primary physical server.protected Object
getColumnImpl
(int i) getHost()
Gets the minimum processor architecture.int
Gets the minimum processor speed or-1
for none.int
Gets the minimum processor speed target or-1
for none.Gets the minimum processor type ornull
if none.Gets the physical server that is currently the primary node for this virtual server.int
int
short
Gets the processor cores.short
short
Gets the processor weight.short
boolean
Gets if this virtual requires full hardware virtualization support.Gets the physical server that is currently the secondary node for this virtual server.int
Gets the secondary RAM allocation or-1
if no secondary required.int
int
Calls "xm list" to get the current state on the current primary physical server.static String
getStatusList
(int status) Gets a human readable, but constant and not translated, comma-separated list of current status flags.getVirtualDisk
(String device) Gets the virtual disk for this virtual server and the provided device name.Gets the VNC password for this virtual server ornull
if VNC is disabled.void
Initializes this object from the raw database contents.boolean
Gets if the primary server is locked (manually set).boolean
Gets if the secondary server is locked (manually set).pause()
Calls "xm pause" on the current primary physical server.void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) reboot()
Calls "xm reboot" on the current primary physical server.shutdown()
Calls "xm shutdown" on the current primary physical server.AoservObject.toString()
implementation that is allowed to throw exceptions.unpause()
Calls "xm unpause" on the current primary physical server.void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
Methods inherited from class com.aoindustries.aoserv.client.AoservObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxId, getLinuxUserName, getMacAddress, getMysqlDatabaseName, getMysqlServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
Field Details
-
RUNNING
public static final int RUNNINGThe possible state flags for the virtual server. At least one of these flags will be enable in the result. Any number of them may be present concurrently, as returned by "xm list".- See Also:
-
BLOCKED
public static final int BLOCKEDThe possible state flags for the virtual server. At least one of these flags will be enable in the result. Any number of them may be present concurrently, as returned by "xm list".- See Also:
-
PAUSED
public static final int PAUSEDThe possible state flags for the virtual server. At least one of these flags will be enable in the result. Any number of them may be present concurrently, as returned by "xm list".- See Also:
-
SHUTDOWN
public static final int SHUTDOWNThe possible state flags for the virtual server. At least one of these flags will be enable in the result. Any number of them may be present concurrently, as returned by "xm list".- See Also:
-
CRASHED
public static final int CRASHEDThe possible state flags for the virtual server. At least one of these flags will be enable in the result. Any number of them may be present concurrently, as returned by "xm list".- See Also:
-
DYING
public static final int DYINGThe possible state flags for the virtual server. At least one of these flags will be enable in the result. Any number of them may be present concurrently, as returned by "xm list".- See Also:
-
DESTROYED
public static final int DESTROYEDThe possible state flags for the virtual server. At least one of these flags will be enable in the result. Any number of them may be present concurrently, as returned by "xm list".- See Also:
-
-
Constructor Details
-
VirtualServer
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Integer,
VirtualServer>
-
getHost
- Throws:
SQLException
IOException
-
getPrimaryRam
public int getPrimaryRam() -
getPrimaryRamTarget
public int getPrimaryRamTarget() -
getSecondaryRam
public int getSecondaryRam()Gets the secondary RAM allocation or-1
if no secondary required. When RAM allocation is-1
, the VM will not be able to run on the secondary server - it only provides block device replication. Therefore, other things like processor type, speed, architecture, processor cores and processor weights will also not be allocated. -
getSecondaryRamTarget
public int getSecondaryRamTarget() -
getMinimumProcessorType
Gets the minimum processor type ornull
if none.- Throws:
IOException
SQLException
-
getMinimumProcessorArchitecture
Gets the minimum processor architecture.- Throws:
IOException
SQLException
-
getMinimumProcessorSpeed
public int getMinimumProcessorSpeed()Gets the minimum processor speed or-1
for none. -
getMinimumProcessorSpeedTarget
public int getMinimumProcessorSpeedTarget()Gets the minimum processor speed target or-1
for none. -
getProcessorCores
public short getProcessorCores()Gets the processor cores. -
getProcessorCoresTarget
public short getProcessorCoresTarget() -
getProcessorWeight
public short getProcessorWeight()Gets the processor weight. -
getProcessorWeightTarget
public short getProcessorWeightTarget() -
isPrimaryPhysicalServerLocked
public boolean isPrimaryPhysicalServerLocked()Gets if the primary server is locked (manually set). -
isSecondaryPhysicalServerLocked
public boolean isSecondaryPhysicalServerLocked()Gets if the secondary server is locked (manually set). -
getRequiresHvm
public boolean getRequiresHvm()Gets if this virtual requires full hardware virtualization support. -
getVncPassword
Gets the VNC password for this virtual server ornull
if VNC is disabled. The password must be unique between virtual servers because the password is used behind the scenes to resolve the actual IP and port for VNC proxying. -
getTableId
- Specified by:
getTableId
in classAoservObject<Integer,
VirtualServer>
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Integer,
VirtualServer> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Integer,
VirtualServer> - Throws:
IOException
-
toStringImpl
Description copied from class:AoservObject
AoservObject.toString()
implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAoservObject.toString()
on the key (fromAoservObject.getKey()
). When the key isnull
, uses the default implementation fromObject.toString()
.- Overrides:
toStringImpl
in classCachedObjectIntegerKey<VirtualServer>
- Throws:
SQLException
IOException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Integer,
VirtualServer> - Throws:
IOException
-
getVirtualDisks
- Throws:
IOException
SQLException
-
getVirtualDisk
Gets the virtual disk for this virtual server and the provided device name.- Parameters:
device
- should bexvd[a-z]
- Returns:
- the disk or
null
if not found - Throws:
IOException
SQLException
-
requestVncConsoleAccess
- Throws:
IOException
SQLException
-
create
Calls "xm create" on the current primary physical server.- Returns:
- the output of the command.
- Throws:
IOException
- any non-zero exit code will result in an exception with the standard error in the exception message.SQLException
-
reboot
Calls "xm reboot" on the current primary physical server.- Returns:
- the output of the command.
- Throws:
IOException
- any non-zero exit code will result in an exception with the standard error in the exception message.SQLException
-
shutdown
Calls "xm shutdown" on the current primary physical server.- Returns:
- the output of the command.
- Throws:
IOException
- any non-zero exit code will result in an exception with the standard error in the exception message.SQLException
-
destroy
Calls "xm destroy" on the current primary physical server.- Returns:
- the output of the command.
- Throws:
IOException
- any non-zero exit code will result in an exception with the standard error in the exception message.SQLException
-
pause
Calls "xm pause" on the current primary physical server.- Returns:
- the output of the command.
- Throws:
IOException
- any non-zero exit code will result in an exception with the standard error in the exception message.SQLException
-
unpause
Calls "xm unpause" on the current primary physical server.- Returns:
- the output of the command.
- Throws:
IOException
- any non-zero exit code will result in an exception with the standard error in the exception message.SQLException
-
getStatusList
Gets a human readable, but constant and not translated, comma-separated list of current status flags. -
getStatus
Calls "xm list" to get the current state on the current primary physical server.- Returns:
- the OR of all state bits.
- Throws:
IOException
- any non-zero exit code will result in an exception with the standard error in the exception message.SQLException
-
getPrimaryPhysicalServer
Gets the physical server that is currently the primary node for this virtual server.- Throws:
IOException
SQLException
-
getSecondaryPhysicalServer
Gets the physical server that is currently the secondary node for this virtual server.- Throws:
IOException
SQLException
-