Xen hypervisors
Class |
|
Xen HVM hypervisor interface |
Class |
|
Xen generic hypervisor interface |
Class |
|
Xen PVM hypervisor interface |
Function |
|
Undocumented |
Constant | VIF |
Undocumented |
Constant | XEN |
Undocumented |
Constant | XL |
Undocumented |
Exception | _ |
Instance has reached a violent ending. |
Function | _ |
Run the network configuration script for a specified NIC |
Function | _ |
Create a CPU config string for Xen's config file. |
Function | _ |
Return the list of instances including running and shutdown. |
Function | _ |
Get disk directives for Xen config file. |
Function | _ |
Combines _MergeInstanceInfo and _ParseNodeInfo . |
Function | _ |
Return the list of running instances. |
Function | _ |
Return the list of shutdown instances. |
Function | _ |
Removes information about whether a Xen state is paused from the state. |
Function | _ |
Get instance domain ID from instance info tuple. |
Function | _ |
Get instance runtime from instance info tuple. |
Function | _ |
Get instance runtime from instance info tuple. |
Function | _ |
Returns whether an instance is in the crashed Xen state. |
Function | _ |
Determine whether an instance is running. |
Function | _ |
Determine whether the instance is shutdown. |
Function | _ |
Updates node information from _ParseNodeInfo with instance info. |
Function | _ |
Parses the output of listing instances by xen. |
Function | _ |
Return information about the node. |
Function | _ |
Add quotes around the CPUID field only if necessary. |
Function | _ |
Helper function for _GetAllInstanceList to retrieve the list of instances from xen. |
Function | _ |
Maps Xen states to hypervisor states. |
Constant | _DOM0 |
Undocumented |
Constant | _FILE |
Undocumented |
Undocumented
Value |
|
Run the network configuration script for a specified NIC
See hv_base.ConfigureNIC
.
Parameters | |
instance:instance object | instance we're acting on |
seq:int | nic sequence number |
nic:nic object | nic we're acting on |
tap:str | the host's tap interface this NIC corresponds to |
Return the list of instances including running and shutdown.
See _RunInstanceList
and _ParseInstanceList
for parameter details.
Get disk directives for Xen config file.
This method builds the xen config disk directive according to the given disk_template and block_devices.
Parameters | |
block | list of tuples (cfdev, rldev):
|
blockdev | a string containing blockdevice prefix, e.g. "sd" for /dev/sda |
_letters | Undocumented |
Returns | |
string containing disk directive for xen instance config file |
Combines _MergeInstanceInfo
and _ParseNodeInfo
.
Parameters | |
info | Undocumented |
instance | list of instance information; one tuple per instance |
Removes information about whether a Xen state is paused from the state.
As it turns out, an instance can be reported as paused in almost any condition. Paused instances can be paused, running instances can be paused for scheduling, and any other condition can appear to be paused as a result of races or improbable conditions in Xen's status reporting. As we do not use Xen's pause commands in any way at the time, we can simply ignore the paused field and save ourselves a lot of trouble.
Should we ever use the pause commands, several samples would be needed before we could confirm the domain as paused.
Get instance domain ID from instance info tuple.
Parameters | |
info:tuple | instance info as parsed by _ParseInstanceList() |
Returns | |
int, instance domain ID |
Get instance runtime from instance info tuple.
Parameters | |
info:tuple | instance info as parsed by _ParseInstanceList() |
Returns | |
bool |
Get instance runtime from instance info tuple.
Parameters | |
info:tuple | instance info as parsed by _ParseInstanceList() |
Returns | |
float value of instance runtime |
Returns whether an instance is in the crashed Xen state.
When a horrible misconfiguration happens to a Xen domain, it can crash, meaning that it encounters a violent ending. While this state usually flashes only temporarily before the domain is restarted, being able to check for it allows Ganeti not to act confused and do something about it.
Determine whether an instance is running.
An instance is running if it is in the following Xen states: running, blocked, paused, or dying (about to be destroyed / shutdown).
For some strange reason, Xen once printed 'rb----' which does not make any sense because an instance cannot be both running and blocked. Fortunately, for Ganeti 'running' or 'blocked' is the same as 'running'.
A state of nothing '------' means that the domain is runnable but it is not currently running. That means it is in the queue behind other domains waiting to be scheduled to run. http://old-list-archives.xenproject.org/xen-users/2007-06/msg00849.html
A dying instance is about to be removed, but it is still consuming resources, and counts as running.
Parameters | |
instance | Information about instance, as supplied by Xen. |
Returns | |
bool | Whether an instance is running. |
Determine whether the instance is shutdown.
An instance is shutdown when a user shuts it down from within, and we do not remove domains to be able to detect that.
The dying state has been added as a precaution, as Xen's status reporting is weird.
Updates node information from _ParseNodeInfo
with instance info.
Parameters | |
info:dict | Result from _ParseNodeInfo |
instance | list of instance information; one tuple per instance |
Returns | |
dict | Undocumented |
Parses the output of listing instances by xen.
Parameters | |
lines:list | Result of retrieving the instance list from xen |
include | If True, return information for Dom0 |
Returns | |
list of tuple containing (name, id, memory, vcpus, state, time spent) |
Return information about the node.
Returns | |
a dict with the following keys (memory values in MiB):
|
Add quotes around the CPUID field only if necessary.
Xen CPUID fields come in two shapes: LIBXL strings, which need quotes around them, and lists of XEND strings, which don't.
Parameters | |
data | Either type of parameter. |
Returns | |
The quoted version thereof. |
Helper function for _GetAllInstanceList
to retrieve the list of instances from xen.
Parameters | |
fn:callable | Function to query xen for the list of instances |
instance | Error list |
Returns | |
list | Undocumented |
Maps Xen states to hypervisor states.
Parameters | |
instance | Information about instance, as supplied by Xen. |
Returns | |
hv_base.HvInstanceState | Undocumented |
Undocumented
Value |
|