- Jul 22, 2008
-
-
Guido Trotter authored
Grab a lock for the instance we're working on, and update its params. Reviewed-by: iustinp
-
Guido Trotter authored
When we set the instance params we're not adding a new instance, but just updating an existing one, so why using AddInstance? Reviewed-by: iustinp
-
Guido Trotter authored
For ConnectConsole we just need to lock the instance we're connecting to. We make a few rpcs to its primary node, but node daemons can now handle multiple queries and nodes cannot be removed till they have instances on them anyway. Note that since we return the ssh command, and that's executed outside of the ganeti daemon, without any locks held, the instance can then be subject to operations while we're connected to it, but that was the previous behavior as well. Reviewed-by: iustinp
-
Guido Trotter authored
LUs that take an instance name as input and need to expand its name and lock it can use it to simplify their ExpandNames call. Possibly, and _ExpandAndLockNode will come as well. Reviewed-by: iustinp
-
Guido Trotter authored
LUQueryClusterInfo and LUDumpClusterConfig can be made concurrent and don't need to acquire any locks. In fact they don't interact with the cluster at all, but just with its configuration, which is thread-safe by design. Reviewed-by: iustinp
-
Guido Trotter authored
Two top level definitions were separated only by one empty line. Fixing this. Reviewed-by: imsnah
-
- Jul 09, 2008
-
-
Iustin Pop authored
This removes (hopefully) all traces of the old locking functions and uses. Reviewed-by: imsnah
-
- Jul 08, 2008
-
-
Guido Trotter authored
In order to do so: - We set REQ_BGL to False - We implement ExpandNames That's it, really. Reviewed-by: iustinp
-
Guido Trotter authored
New concurrent LUs will need to call ExpandNames so that any names passed in by the user are canonicalized, and can be used by hooks, locking and other parts of the code. This was done in CheckPrereq before, but it's now splitted out, as it's needed for locking, which in turn CheckPrereq needs. Old LUs can be converted gradually. Reviewed-by: iustinp
-
Guido Trotter authored
cmdlib uses some constants from locking (ie. locking levels) but doesn't import it. This patch fixes the issue. Reviewed-by: iustinp
-
Guido Trotter authored
Since the context is passed to LogicalUnit, rather than the cfg, we can only access the cfg as self.cfg, self.context.cfg, or context.cfg (in the constructor). cfg is not valid anymore. Reviewed-by: iustinp
-
Guido Trotter authored
Whenever we add an instance or node to the cluster (i.e. to the config and whenever we remove them we should add/remove locks as well). In the future we may want to optimize this so that the configwriter does it, or it's handled at the context level, but till we're adding/removing instances and nodes with the BGL held it doesn't matter too much. Reviewed-by: iustinp
-
Guido Trotter authored
Rather than passing a ConfigWriter to the LUs we'll pass the whole context, from which a ConfigWriter can be extracted, but we can also access the GanetiLockManager. This also fixes the places where a FakeLU is created. Reviewed-by: iustinp
-
Guido Trotter authored
Reviewed-by: iustinp
-
- Jul 01, 2008
-
-
Guido Trotter authored
When logical units have REQ_BGL set (it is currently the default) they need to be the only ganeti operation run on the cluster, and we'll guarantee it at the master daemon level. Currently only one thread is running at a time, so this requirement is never broken. Reviewed-by: iustinp
-
- Jun 27, 2008
-
-
Guido Trotter authored
From the master node we can't start ssh and connect to the remote node, nor we can do it from ganeti-noded as this ssh section will possibly ask for key confirmation and password. So the code to copy the ganeti-noded password and SSL key has been moved to bootstrap.py, and it's called by gnt-node before the AddNode opcode. Reviewed-by: iustinp
-
Guido Trotter authored
As we can't use ssh.VerifyNodeHostname directly, we'll set up a mini node-verify to do checking between the master and the new node. In the future networking checks, or more nodes, can be added as well. Reviewed-by: iustinp
-
Guido Trotter authored
Since we're inside a LU we have access to self.sstore. No need to use ss, which separate instantiation will disappear in a few patches! ;) Reviewed-by: iustinp
-
Guido Trotter authored
We used to scp all the ssconf files, and the vnc password file to the new node. With this patch we use the upload_file rpc, specifying just the new node as a destination. All the files previously copied by scp are already allowed by the backend. Reviewed-by: iustinp
-
Guido Trotter authored
Two LUs are using RunCmd to call fping, in order to check for an IP presence on the network. Substituting it with TcpPing will get rid of it, which makes it not break in the new world order, where the master cannot fork. Reviewed-by: iustinp
-
- Jun 26, 2008
-
-
Guido Trotter authored
Even in 1.2 this behaviour is broken, as the rpc call will remove the ssh keys before we get a chance to log in. Now the rpc takes care of shutting down the node daemon as well, so we definitely can avoid this. This makes the LURemoveNode operation work again with the threaded master daemon. Reviewed-by: iustinp
-
Guido Trotter authored
There is no point in checking whether the cluster VNC password file exists as a prerequisite for AddNode, considering the check happens on the master node, not the target one. Removing this check. Reviewed-by: iustinp
-
Guido Trotter authored
Reviewed-by: iustinp
-
- Jun 25, 2008
-
-
Michael Hanselmann authored
Apparently there were still some leftovers. While removing an instance, I got the message "unhandled exception 'module' object has no attribute 'LD_MD_R1'". Reviewed-by: iustinp
-
- Jun 23, 2008
-
-
Iustin Pop authored
Since the disabling of forking in the master daemon, the two ssh-based subcommands were not working anymore. However, there is no need at all for the commands to be run from the master daemon (permissions to read the cluster private ssh key notwithstanding), they can be run directly from the command line utilities. The patch removes the two opcodes OpRunClusterCommand and OpClusterCopyFile (and their associated LUs) and changes the code in ‘gnt-cluster’ to query the list of nodes and run directly the SshRunner over the list. As such, all forking is done from the gnt-cluster script, and the commands are working again. Reviewed-by: imsnah
-
- Jun 22, 2008
-
-
Iustin Pop authored
Currently there isn't any easy way to list all nodes or instance and their tags; you have to query each node in turn, or list all the tags via something like “gnt-cluster search-tags '.*'”. Of course, this is not optimal. The patch adds a new fields to “gnt-instance list” and “gnt-node list” called ‘tags’, that will list the tags of the object in comma-separated form. This field will be empty if there are no tags (when using a separator this output can still be parsed by other scripts). At opcode level, there is a new fields called ‘tags’ that returns a (python) list of the object tags. Reviewed-by: ultrotter
-
- Jun 17, 2008
-
-
Iustin Pop authored
There is a mistake in handling grow-disk for an invalid disk. This patch fixes it. Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds a new opcode and LU for growing an instance's disk. The opcode allows growing only one disk at time, and will throw an error if the operation fails midway (e.g. on the primary node after it has been increased on the secondary node). As such, it might actually leave different sized LVs on different nodes, but this will not create problems. Reviewed-by: imsnah
-
- Jun 16, 2008
-
-
Guido Trotter authored
Before we used to be able to update SimpleStore by just calling SetKey, this feature is now moved to an external class, which inherits from it. In this patch the new WritableSimpleStore class is also put to use, in the LUs that need it. Rather than making each LU instantiate it, we have a new LogicalUnit flag REQ_WSSTORE which defaults to False, but when declared to be True asks the LogicalUnit to be initialized with a writeable version of the SimpleStore. LUMasterFailover and LURenameCluster are then changed to use it. InitCluster is also changed to instantiate a WritableSimpleStore, rather than a normal one. Reviewed-by: imsnah
-
- Jun 15, 2008
-
-
Guido Trotter authored
When replacing disks or evacuating nodes with instances administratively down ganeti fails because the instance disks are not active. This patch activates them, performs the replacement, and shuts them down again. Changing this also fixes the same issue on gnt-node evacuate. Reviewed-by: iustinp
-
Guido Trotter authored
We're not adding a new instance, just making configuration changes to the one we're working on. Reviewed-by: imsnah
-
Iustin Pop authored
There is a mistake in the error message generated when we can't reach a node for checking for available disk space. Without it, the error message is: Failure: prerequisites not met for this operation: Cannot get current information from node '{u'gnte2.lab.k1024.org': {'cpu_total': 1, 'memory_free': 480, 'vg_size': 131068, 'memory_total': 504, 'bootid': '2176dd3b-2f96-42f0-8b6e-2873ecaf5f9c', 'memory_dom0': 134, 'vg_free': 130172}, u'gnte1.lab.k1024.org': False}' instead of the expected: Failure: prerequisites not met for this operation: Cannot get current information from node 'gnte2.lab.k1024.org' Reviewed-by: imsnah
-
- Jun 12, 2008
-
-
Michael Hanselmann authored
This allows us to initialize a new cluster. The code certainly contains bugs and hooks aren't implemented yet. Reviewed-by: iustinp
-
Michael Hanselmann authored
This is required for splitting the cluster initialization code. Reviewed-by: iustinp
-
Michael Hanselmann authored
This is required for the split of the cluster initialization code. Reviewed-by: iustinp, ultrotter
-
Michael Hanselmann authored
It's not needed anymore now that all opcodes require a cluster. Cluster initialization was the only exception. Reviewed-by: iustinp
-
- May 31, 2008
-
-
Iustin Pop authored
Currently the check for enough memory is done only on instance start command and failover command. But we also start an instance in instance create, therefore we need to check this instead of failing to start in the hypervisor phase. The patch adds a check for node memory in the case the creation command specifies that the instance should be started. It is allowed for the memory to be less than needed if the instance will not be started, in order to allow migration and other such cases. Reviewed-by: imsnah
-
Iustin Pop authored
Author: schreiberal Reviewed-by: iustinp
-
Iustin Pop authored
This fixes gnt-instance modify so it actually works with the new HVM parameters for Ganeti 1.2 Author: schreiberal Reviewed-by: iustinp
-
Iustin Pop authored
This patch modifies the code for "gnt-instance info .." to only display instance parameters that actually apply to that instance, i.e. for PVM instances no HVM parameters are shown and vice versa. Author: schreiberal Reviewed-by: iustinp
-