Disable forking in the master daemon
This patch adds a mechanism to disable utils.RunCmd in selectedprograms. This is needed in the master daemon unless we confirmthreading doesn't pose any problems.
This makes cluster init fail, but creating new trunk clusters is anyway...
Raise PrereqError when exporting file-based instance
This patch adds a check to LUExportInstance.CheckPrereq to raise anerror when an instance with file disks is exported.
Reviewed-by: ultrotter
Add file backend storage options to ImportInstance
This patch adds the file storage options to gnt-backup import whichwould otherwise fail since the values of file_storage_dir andfile_driver are accessed in LUCreateInstance.
Split hypervisor.py into several files
Before it was a huge file with more than 700 lines. No code changes weremade except for changing imports and class names where needed. In thefuture, we could even think about only importing the hypervisors weactually need. The patch finished QA scripts and distcheck successfully....
Move the 'cmd' lock from cli.py to ganeti-masterd
This patch removes the lock and the lock options from cli.py and movesthem to the master.
Later during development we can remove it completely, but for now it'sgood to protect any other tool that uses the lock directly....
Convert cli.SubmitOpCode to use the master
This patch converts the cli.py SubmitOpCode method to use the unixprotocol and thus execute the opcodes via the master.
The patch allows a partial burnin to work with the master. Currently thequery opcodes, since they are executed via the SubmitOpCode, are...
Add check for major/minor in _FormatBlockDevInfo
bdev.FileStorage does not have major or minor fields, so gnt-instanceinfo for file backed instances fails with a TypeError. This patchadds checks to prevent that and print 'N/A' instead.
Reviewed-by: imsnah
Make testSignal unittest not depend on default shell
This patch changes the code executed when testing the signal handlingof RunCmd. Since sh does not always point to bash (e.g. on Ubuntu,where it points to /bin/dash) this test might fail due to the returned...
Move iallocator script execution to ganeti-noded
Currently the iallocator execution takes place in the master, which is aviolation of the current architecture, and will create problems with athreaded master daemon.
This patch moves the execution to the backend, similar to the hooks...
Fix iallocator instance info
The commit "IAllocator: some more info exported" broke the instance listgeneration due to a wrong index variable. This patch fixes that.
Extend utils.WriteFile
Add parameters to not check the path for absoluteness, implement a dryrun mode and automatically create a backup if requested. This will beused by the cfgupgrade utility.
Reviewed-by: schreiberal
IAllocator: some more info exported
This patch adds the following information to the exported info: - hypervisor type (in the main dict) - total memory used by primary instances (in each node dict) (can be computed from the node+instance dicts, but it's cheap to compute...
IAllocator: simplify node info computation
Currently we try to convert the values returned by call_node_info toints, and if all succeed, we actually do the conversion. Simplify thisby doing it in one step.
The patch also adds exporting of node memory as 'reserved_memory'....
patch 1/4 extended HVM features for 1.2
This patch extends the config objects with the slots to handlemore HVM configuration items.
Author: schreiberalReviewed-by: iustinp,imsnah
Move target creating symlinks in lib/ into Makefile.libcommon
Reviewed-by: iustinp
Add iallocator documentation
backend.FinalizeExport: safely initialize some vars
This patch initializes nic_count and disk_count with 0. This preventssome reference errors if the snap_disks block device list is empty.
Style fixes for trunk
This small patch fixes: - wrong indentation in two places - use of 'os' variable that hides global scope os module
Implement replace secondary via the iallocator
This patch implements secondary replace via the iallocator. The newopcode parameter 'iallocator' behaves like this: if passed, it willalways compute and assign a new secondary, behaving in effect as if the...
Implement memory size option for burnin
This simple patch adds memory size for the burnin instances, which helpstesting allocator algorithm response based on the available node memoryand instance memory size values.
Fix generalized relocate mode of IAllocator
The patch which generalized the IAllocator was half-true: it actuallyput the selection of the node inside the IAllocator, so callers were notable to specify replace primary node.
This patch does: - split the arguments to the constructor in three sets: mode and name...
Fix burnin ImportExport CreateInstance opcode
This patch adds the two attributes file_storage_dir and file_driverto the CreateInstance opcode in the ImportExport method, sinceotherwise it will fail with the file storage patches.
burnin: improve instance create message
When the allocator or a non-mirrored template are used the message shown byburnin at instance creation time was wrong. Fixing it.
burnin: remove created exports
Make burnin remove exports after importing the instance back.
Add gnt-backup remove functionality
This patch also fixes the LUExportInstance Prereq docstring.
Add instance rename to burnin
This patch adds the possibility to execute instance renaming whendoing a cluster burnin. The optional parameter --rename takesone 'spare' instance name.Given this option it renames all given instances to the spare oneand back to their original name....
Generalize the replace_secondary mode in iallocator
Currently the replace_secondary mode is too restrictive. This patchchanges this to a general 'relocate' mode where the node(s) to bechanged are specified via a new key in the request dict ('nodes') so...
Implement replace_secondary in the dumb allocator
This patch allows the dumb allocator to perform the replace secondaryrequest type. This is done simply by not allowing the current instancesnodes as a valid selection, and using the existing instance data instead...
Send required_nodes field to the iallocator scripts
This patch adds the 'required_nodes' field in the request dict for theiallocator.
This means that the handmade-checks in the create instance can besimplified, and that the dumb allocator can be made simple. Therefore...
Allow burnin to use an iallocator in instance creation
This patch adds iallocator support to burnin, currently only in instancecreation. This means that, depending on the external algorithm, not allnodes might get instances.
The patch also restricts node selection and iallocator options together....
Move all iallocator functions into a class
This patch moves all the iallocator function into a separate class thatis then somewhat easier to use. It doesn't bring any new functionality.
The patch also changes the way the iallocator is called - theOpTestAllocator opcode is no longer needed, and all its parameters...
Correctly filter out Domain-0 from domain list if requested.
Only change instance status if not already so
This patch makes the _SetInstanceStatus only change the status of theinstance (in the config file) if it's not already in the desired state.This skips the increase of the config serial no without actual data...
Reuse common code between MarkInstance{Up,Down}
This patch creates a new method ConfigWriter._SetInstanceStatus thatconsists of the common code between MarkInstanceUp and MarkInstanceDown.These two methods become wrappers over the _SetInstanceStatus.
Abstract the json functions into a separate module
This simple patch adds a new module that holds the simplejson functionsfor serialization/deserialization. This reduces the amount of redundantcode.
The patch also adds some normalizations to the json output:...
Add --readd option to “gnt-node add”
This allows us to readd a node after it failed and required areinstallation or replacement.
A pure whitespace change for style compliance
Reviewed-by: amishchenko
IAllocator part 3: LUCreateInstance changes
This (final) patch allows the instance's nodes to be selectedautomatically based on the passed allocator algorithm.
The patch changes the pnode opcode parameter from required to optional,now either the pnode or the iallocator must be passed....
Reorder checks in instance create
This patch reorders the checks in the instance create prereq so that allchecks and normalisations that are not node-dependent are done beforethe node dependent checks.
This is done so that, after the instance-related opcode parameters are...
Implement 'out' direction on allocator tests
This patch adds the paths for searching for instance allocators andmakes the LUTestAllocator code run the allocator and return the resultsif the direction specified is 'out'. 'out' means that the opcode will...
Allocator framework, 1st part: allocator input generation
In preparation for the introduction of automatic instance allocator,this patch adds an allocator simulation opcode, that based on the inputparameters, will return either the input message to the allocator...
Fix two pylint uninitialized variable errors
Bugfix: wrong identifier in CheckPrereq message
Modify burnin to support file storage backend
This patch does two things:- adjusts burnin to work with the file storage backend patches- adds the possibilty to do a burnin for file based instances
Move the disk size computation to its own function
This is currently hard-coded for the two drive case and will need to bereworked for multi-disk support.
The patch is needed to support passing the total required size to theiallocator interface.
SharedLock: restrict assertion condition
When we release a shared lock if there are no exclusive waiter then the numberof shared waiters must be exactly equal to the ones scheduled to pass.
Make the init script start the master daemon too
Verify: make skipping checks possible
Add a general way to skip some checks at cluster-verify time and make the N+1memory redundancy check optional.
Verify: add N+1 Memory redundancy verification
For every node we check that we can host all the instances it's currentlysecondary for belonging to the same primary. This ensures that if a node failsall its instances can fit on their secondary node. The code only works when...
Verify: save instance config
Save the instance config after we queried it in an instance_cfg dict. This canbe used later by any function that wants it, without reloading it from theconfiguration module. It will be used for N+1 memory resilience checking....
Verify: add more instance information to node_info
The sisnt-by-pnode field contains all secondary instances of a node, grouped bytheir primary node. This information allows us to see quickly if when a nodedies some of its instances cannot be started on their secondary node....
Verify: add instance information to node_info
With this patch node_info is changed to store information about which primaryand secondary instances are configured on a node. This information is useful tocheck memory and disk allocation. A list of non-redundant instances is also...
Verify: Add and populate node_info dict
During information gathering we collect information from call_node_info, andthen when we cycle trough the nodes add it into a node_info dict containing anode's free memory and disk. This will be useful later to verify that the...
Rework the results of OpDiagnoseOS opcode
Currently, the opcode DiagnoseOS is the only opcode that return astructure of objects.OS (which is a custom class, and not a simplepython object) and furthermore all the processing of OS validity acrossnodes is left to the clients of this opcode....
Add generic opcode submit functionality to gnt-debug
This patch enhances gnt-debug to be able to submit any opcodes. Theopcodes are input from a json file containing a list of opcodes.
This allows enhanced testing of opcodes until the other gnt-* commands...
Change client protocol to raise exception on failures
Currently the luxi.client.SubmitJob and Query methods return the unserializedresult without processing it at all. This patch changes this by adding a'RequestException' error that is raised if the query itself or the...
Add per-opcode results to job processing
This patch changes the definition of a job and introduces per-opcoderesults.
First, the result and status fields of a job are condensed into a single'status' attribute. Then, we introduce an opcode status and one result...
Move the OS search code into an abstract function
Based on the previous OS search code changes, we can now move the OSsearch code into a generic look-for-file function in utils.py. Thismeans that the allocator code can use the same function.
Change backend._OSSearch return values
Currently, the function backend._OSSearch() returns the (first) base dirin which this OS can be found. Thereafter the full actual path to the OSdir is built in the backend.OSFromDisk() function.
This patch changes this so that _OSSearch() always returns the full path...
Fix example scripts build dependencies
Currently, the example scripts (the init.d and the cron script) do notdepend on the Makefile, so if configure is rerun with differentparameters these scripts are not rebuild.
The patch adds Makefile as a dependency so changes to installation paths...
Verify: remove useless check in _VerifyInstance
The list of instances passed to _VerifyInstance is the one coming fromself.cfg.GetInstanceList(). So there's no point, inside that function, inchecking whether the current instance is a member of that list. Moreover...
Verify: instance verification cleanup
The instance configuration is grabbed both in the _VerifyInstance function andin the loop that calls it. Clean this up by passing the configuration as aparameter.
Verify: fix crash when a node is down
Currently if ganeti-noded doesn't respond on a node gnt-cluster verify will diewhen verifying primary instances for that node. Fix this by just emitting anerror message if no information about running instances is returned from the...
Verify: fix ERROR message indentation
All ERROR messages in cluster verify are indented by four spaces, this one isindented by two. Fixing this skew.
Reviewed-by: imsnah, iustinp
Fix spelling mistake in constants.py
Of course instance creation don't have any modem, and the comment was justtalking about modes. Sorry to everybody expecting whistles.
Add lvm storage option to gnt-cluster man page
This patch adds the previously introduced lvm storage togglinginfo to the gnt-cluster man page. It adds some info the thegnt-cluster init -g option and adds the gnt-cluster modify command.
Small code style fix
Bugfix instance create when file-storage-dir None
os.path.join does not like None as argument and fails withAttributeError: 'NoneType' object has no attribute 'startswith'.
This patch makes sure the passed argument is a string in any case.
Two small code style fixes
Modify gnt-instance to support file backend
Add file_storage_dir,file_driver to OpCreateInstance
Reviewed-by: ultrotter, iustinp
Modify LURenameInstance to support file backend
This patch does two things:- Modify LURenameInstance.Exec to rename directory when a file-based instance is renamed- Modify config.RenameInstance() to replace the directory name in config.data for file devices...
Modify LUCreateInstance to support file backend
- Modfiy _GenerateDiskTemplate to support file-based disk template- Modify _CreateDisks to create directory needed for file-based instances before creating the actual files- Modify _RemoveDisks to delete directory for file-based instances...
Bump version number to 1.3.0~alpha1
Provide more flexible version numbers to the code
Having the individual parts in the code allows us to build versionnumbers like "1.2" while leaving "3" out in a clean fashion, that iswithout regular expressions or the like. This might be used together...
Modify hypervisor to support file backend
The driver in the xen config file needs to be changed when dealing withfiles rather then bdevs.
This patch does two things:- Add _GetConfigFileDiskData to XenHypervisor which returns the correct disk xen config line. This function checks the logical disk type of...
Remove support for Pickle configuration files
Add more explicit help for command line
Update copyright year, imports of cfgupgrade
Implement selective job query
This patch implements query-ing of only selected jobs instead of all.
Move some checks from cli.py to luxi.py
The idea of cli.py and luxi.py is that all protocol checks should be inluxi, and cli.py should just offer some helpful shortcuts for thecommand line scripts.
This patch removes the result checks from cli and adds some other checks...
A small capitalization change (OpCode.LoadOpcode)
This small patch fixed the opcodes.OpCode.LoadOpcode capitalization towhat was intented to be (as the comment says): LoadOpCode.
Implement forking/master role checking in masterd
This patch adds checks for the master role and daemonize support toganeti-masterd.
The patch modifies the startup/shutdown of the server because: - we want bind()/listen() to the master socket to occur before forking...
Add FileStorage class
This is the representation of file VBDs on the backend. It's the firstimplementation an supports only raw files.
rpc directory functions for file backend
ganeti-noded directory functions for file backend
Backend directory functions for file backend
Add _[Create,Remove,Rename]FileStorageDir function which are needed forfile-based instance management. These function check whether the givendirectory to operate on is under the cluster-wide defined default file...
Fix SetVGName() to access object not dict
Allow utils.Daemonize() to not close some fds
This patch implements an optional parameter to utils.Daemonize() whichallows that function to not close some file descriptors.
This will allow the master daemon to open the listening socket beforefork - in order to be able to notify errors and return a meaningful exit...
Add a simple gnt-job script
This patch adds a very basic gnt-job script that allows job querying.This goes on top of the previous master daemon patches.
Currently, because of the not-changed cmd lock, you can't query the jobsas long as a job is running - you have to rm the cmd lock and then you...
Move the daemonize function to utils.py
Currently, in ganeti-noded we have the createDaemon function. Sincewe'll need the same in other daemons, we move this function to utils.py
With the move, a few changes were also done: - change the name to Daemonize()...
Improve disk consistency error message again
This new version includes all the possible failure options.
Fix misleading error message when checking disks
_CheckDiskConsistency outputs "Can't get any data from node NODE" when no drbdis found on the target node. This causes a misleading error message to beoutput for example on failover (when the primary node is down, or the instance...
Handle better failing over non-running instances
Right now if you try to failover an instance which is not marked as up theoperation will fail unless you pass the --ignore-consistency flag because thedisks won't be considered to be consistent. Allow them to be if we know the...
Improve export and fix export-on-norun bug
Currently gnt-backup export chains the ShutdownInstance and StartupInstanceopcodes to itself. This works but (a) it's suboptimal, because there's no needto deactivate the instance's disks as we are about to restart it anyway, and...
Forcibly convert export data to str object
ConfigParser.SafeConfigParser doesn't support unicode string objects.Unicode string objects are returned by simplejson.
failover: only start instance if we should
gnt-instance failover on an instance marked as down will mistakenly bring itup. The watcher will then shut it down again, but it's a lot better (and safer)not to start it at all.
Locking: fix one indentation error (codestyle)
Locking: fix superlong lines (codestyle)
Check whether path is valid before accessing it