Trees | Indices | Help |
|
---|
|
Functions used by the node daemon
|
|||
RPCFail Class denoting RPC failure. |
|||
HooksRunner Hook runner. |
|||
IAllocatorRunner IAllocator runner. |
|||
DevCacheManager Simple class for managing a cache of block device information. |
|
|||
|
|||
ssconf.SimpleStore |
|
||
ssh.SshRunner |
|
||
str |
|
||
|
|||
|
|||
tuple |
|
||
tuple |
|
||
None |
|
||
None |
|
||
|
|||
|
|||
dict
|
|
||
dict |
|
||
dict |
|
||
dict |
|
||
list |
|
||
boolean |
|
||
list |
|
||
dict |
|
||
tuple |
|
||
dict |
|
||
|
|||
None |
|
||
boolean |
|
||
|
|||
|
|||
|
|||
list |
|
||
None |
|
||
None |
|
||
None |
|
||
|
|||
|
|||
|
|||
tuple |
|
||
|
|||
|
|||
|
|||
boolean |
|
||
|
|||
str or boolean |
|
||
None |
|
||
None |
|
||
None |
|
||
disk |
|
||
disk |
|
||
|
|||
|
|||
None or objects.BlockDevStatus |
|
||
list |
|
||
None |
|
||
None |
|
||
|
|||
|
|||
tuple |
|
||
list of objects.OS |
|
||
tuple |
|
||
objects.OS |
|
||
dict |
|
||
dict |
|
||
(status, result) |
|
||
string |
|
||
None |
|
||
objects.SerializableConfigParser |
|
||
list |
|
||
None |
|
||
boolean |
|
||
|
|||
tuple |
|
||
tuple (success,) |
|
||
tuple (success,) |
|
||
None |
|
||
boolean |
|
||
tuple |
|
||
tuple (success, message) |
|
||
None |
|
||
|
|||
boolean |
|
||
|
|||
|
|||
tuple; (string, string) |
|
||
|
|||
|
|||
|
|||
|
|||
List of dicts |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
_BOOT_ID_PATH = "/proc/sys/kernel/random/boot_id"
|
|||
_ALLOWED_CLEAN_DIRS = frozenset([constants.DATA_DIR, constants denotes which directories are accepted in the _CleanDirectory function |
|||
_MAX_SSL_CERT_VALIDITY = 7* 24* 60* 60
|
|||
_X509_KEY_FILE = "key"
|
|||
_X509_CERT_FILE = "cert"
|
|||
_IES_STATUS_FILE = "status"
|
|||
_IES_PID_FILE = "pid"
|
|||
_IES_CA_FILE = "ca"
|
|||
_ALLOWED_UPLOAD_FILES = _BuildUploadFileList() denotes which files are accepted in the UploadFile function |
Imports: os, shutil, time, stat, errno, re, random, logging, tempfile, zlib, base64, signal, errors, utils, ssh, hypervisor, constants, bdev, objects, ssconf, serializer, netutils, runtime
|
Log an error and the raise an RPCFail exception. This exception is then handled specially in the ganeti daemon and turned into a 'failed' return type. As such, this function is a useful shortcut for logging the error and returning it to the master daemon.
|
Simple wrapper to return a SimpleStore.
|
Simple wrapper to return an SshRunner.
|
Unpacks data compressed by the RPC client.
|
Removes all regular files in a directory.
|
Build the list of allowed upload files. This is abstracted so that it's built only once at module import time. |
Removes job queue files and archived jobs.
|
Returns master information. This is an utility function to compute master information, either for consumption here or from the node daemon.
|
Activate local node as master node. The function will either try activate the IP address of the master (unless someone else has it) or also start the master daemons, based on the start_daemons parameter.
|
Deactivate this node as master. The function will always try to deactivate the IP address of the master. It will also stop the master daemons depending on the stop_daemons parameter.
|
Modify a host entry in /etc/hosts.
|
Cleans up and remove the current node. This function cleans up and prepares the current node to be removed from the cluster. If processing is successful, then it raises an errors.QuitGanetiException which is used as a special case to shutdown the node daemon.
|
Gives back a hash with different information about the node.
|
Verify the status of the local node. Based on the input If the filelist key is present, this list of files is checksummed and the file/checksum pairs are returned. If the nodelist key is present, we check that we have connectivity via ssh with the target nodes (and check the hostname report). If the node-net-test key is present, we check that we have connectivity to the given nodes via both primary IP and, if applicable, secondary IPs.
|
Compute list of logical volumes and their size.
|
List the volume groups and their size.
|
List all volumes on this node.
|
Check if a list of bridges exist on the current node.
|
Provides a list of instances.
|
Gives back the information about an instance as a dictionary.
|
Gives whether an instance can be migrated.
|
Gather data about all instances. This is the equivalent of GetInstanceInfo, except that it computes data for all instances at once, thus being faster if one needs data about more than one instance.
|
Compute the OS log filename for a given instance and operation. The instance name and os name are passed in as strings since not all operations have these as part of an instance object.
|
Add an OS to an instance.
|
Run the OS rename script for an instance.
|
Set up symlinks to a instance's block device. This is an auxiliary function run when an instance is start (on the primary node) or when an instance is migrated (on the target node).
|
Set up an instance's block device(s). This is run on the primary node at instance startup. The block devices must be already assembled.
|
Start an instance.
|
Shut an instance down.
Note: this functions uses polling with a hardcoded timeout. |
Reboot an instance.
|
Gather information about an instance to be migrated.
|
Prepare the node to accept an instance.
|
Finalize any preparation to accept an instance.
|
Migrates an instance to another node.
|
Creates a block device for an instance.
|
This function actually wipes the device.
|
Wipes a block device.
|
Remove a block device.
Note: This is intended to be called recursively. |
Activate a block device for an instance. This is run on the primary and secondary nodes for an instance.
Note: this function is called recursively. |
Activate a block device for an instance. This is a wrapper over _RecursiveAssembleBD.
|
Shut down a block device. First, if the device is assembled (Attach() is successful), then the device is shutdown. Then the children of the device are shutdown. This function is called recursively. Note that we don't cache the children or such, as oppossed to assemble, shutdown of different devices doesn't require that the upper device was active.
|
Extend a mirrored block device.
|
Shrink a mirrored block device.
|
Get the mirroring status of a list of devices.
|
Get the mirroring status of a list of devices.
|
Check if a device is activated. If so, return information about the real device.
|
Opens the underlying block device of a disk.
|
Check if a device is activated. If it is, return information about the real device.
|
Computes the size of the given disks. If a disk is not found, returns None instead.
|
Export a block device to a remote node.
|
Write a file to the filesystem. This allows the master to overwrite(!) a file. It will only perform the operation if the file belongs to a list of configuration files.
|
Update all ssconf files. Wrapper around the SimpleStore.WriteFiles. |
Format an EnvironmentError exception. If the
|
Compute and return the API version of a given OS. This function will try to read the API version of the OS residing in the 'os_dir' directory.
|
Compute the validity for all OSes.
|
Create an OS instance from disk. This function will return an OS instance if the given name is a valid OS name.
|
Create an OS instance from disk. This function will return an OS instance if the given name is a valid OS name. Otherwise, it will raise an appropriate RPCFail exception, detailing why this is not a valid OS. This is just a wrapper over _TryOSFromDisk, which doesn't raise an exception but returns true/false status data.
|
Calculate the basic environment for an os script.
|
Calculate the environment for an os script.
|
Grow a stack of block devices. This function is called recursively, with the childrens being the first ones to resize.
|
Create a snapshot copy of a block device. This function is called recursively, and the snapshot is actually created just for the leaf lvm backend device.
|
Write out the export configuration information.
|
Get export configuration information.
|
Return a list of exports currently available on this machine.
|
Remove an existing export from the node.
|
Rename a list of block devices.
|
Checks whether given file_storage_dir is valid. Checks wheter the given file_storage_dir is within the cluster-wide default file_storage_dir stored in SimpleStore. Only paths under that directory are allowed.
|
Create file storage directory.
|
Remove file storage directory. Remove it only if it's empty. If not log an error and return.
|
Rename the file storage directory.
|
Checks whether the given filename is in the queue directory.
|
Updates a file in the queue directory. This is just a wrapper over utils.WriteFile, with proper checking.
|
Renames a job queue file. This is just a wrapper over os.rename with proper checking.
|
Closes the given block devices. This means they will be switched to secondary mode (in case of DRBD).
|
Validates the given hypervisor parameters.
|
Check whether a list of parameters is supported by the OS.
|
Validate the given OS' parameters.
|
Creates a new X509 certificate for SSL/TLS.
|
Removes a X509 certificate.
|
Returns the command for the requested input/output.
|
Starts an import or export daemon.
|
Returns import/export daemon status.
|
Cleanup after an import or export. If the import/export daemon is still running it's killed. Afterwards the whole status directory is removed. |
Hard-powercycle the node. Because we need to return first, and schedule the powercycle in the background, we won't be able to report failures nicely. |
|
_ALLOWED_CLEAN_DIRSdenotes which directories are accepted in the _CleanDirectory function
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Dec 20 13:26:35 2010 | http://epydoc.sourceforge.net |