Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-High Milestone-Release2.9
New issue 608 by [email protected]: Instance console not working in 2.9.0
http://code.google.com/p/ganeti/issues/detail?id=608
What steps will reproduce the problem?
1. Create a new KVM instance
2. Try to attach its console
3. The operation fails
What is the expected output? What do you see instead?
# gnt-instance console test
Unhandled Ganeti error: Cannot change directory permissions
on '/var/run/ganeti/kvm-hypervisor': [Errno 1] Operation not
permitted: '/var/run/ganeti/kvm-hypervisor'
The full backtrace from the master daemon is:
2013-11-08 10:34:23,109: ganeti-masterd pid=2719/ClientReq14 ERROR
Unexpected exception
Traceback (most recent call last):
File "/usr/share/ganeti/ganeti/server/masterd.py", line 106, in RunTask
result = client_ops.handle_request(method, args)
File "/usr/share/ganeti/ganeti/server/masterd.py", line 385, in
handle_request
return self._Query(op)
File "/usr/share/ganeti/ganeti/server/masterd.py", line 466, in _Query
return proc.ExecOpCode(op, None)
File "/usr/share/ganeti/ganeti/mcpu.py", line 517, in ExecOpCode
calc_timeout)
File "/usr/share/ganeti/ganeti/mcpu.py", line 468, in _LockAndExecLU
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
File "/usr/share/ganeti/ganeti/mcpu.py", line 468, in _LockAndExecLU
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
File "/usr/share/ganeti/ganeti/mcpu.py", line 468, in _LockAndExecLU
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
File "/usr/share/ganeti/ganeti/mcpu.py", line 468, in _LockAndExecLU
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
File "/usr/share/ganeti/ganeti/mcpu.py", line 468, in _LockAndExecLU
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
File "/usr/share/ganeti/ganeti/mcpu.py", line 468, in _LockAndExecLU
result = self._LockAndExecLU(lu, level + 1, calc_timeout)
File "/usr/share/ganeti/ganeti/mcpu.py", line 407, in _LockAndExecLU
result = self._ExecLU(lu)
File "/usr/share/ganeti/ganeti/mcpu.py", line 374, in _ExecLU
result = _ProcessResult(submit_mj_fn, lu.op, lu.Exec(self.Log))
File "/usr/share/ganeti/ganeti/cmdlib/instance_query.py", line 217, in
Exec
return self.iq.OldStyleQuery(self)
File "/usr/share/ganeti/ganeti/cmdlib/base.py", line 539, in OldStyleQuery
return self.query.OldStyleQuery(self._GetQueryData(lu),
File "/usr/share/ganeti/ganeti/cmdlib/instance_query.py", line 170, in
_GetQueryData
lu.cfg.GetNodeInfo(inst.primary_node))
File "/usr/share/ganeti/ganeti/cmdlib/instance_operation.py", line 436,
in GetInstanceConsole
hyper = hypervisor.GetHypervisor(instance.hypervisor)
File "/usr/share/ganeti/ganeti/hypervisor/__init__.py", line 75, in
GetHypervisor
return cls()
File "/usr/share/ganeti/ganeti/hypervisor/hv_kvm.py", line 610, in
__init__
utils.EnsureDirs(dirs)
File "/usr/share/ganeti/ganeti/utils/io.py", line 597, in EnsureDirs
" '%s': %s" % (dir_name, err))
GenericError: Cannot change directory permissions
on '/var/run/ganeti/kvm-hypervisor': [Errno 1] Operation not
permitted: '/var/run/ganeti/kvm-hypervisor'
This is due to GetInstanceConsole instantiating a KVMHypervisor object,
which calls EnsureDirs during __init__(). The operation fails because
masterd is running as a non-privileged user. Also, this is a logic error
since operating on an instance residing on an arbitrary node shouldn't
impact hypervisor files on the master.
This bug was introduced with the following stanza in commit
8ef418bb92fab256f5013d1be37f96e862ac137d:
diff --git a/lib/cmdlib/instance_operation.py
b/lib/cmdlib/instance_operation.py
index e9e5eb2..480ba32 100644
--- a/lib/cmdlib/instance_operation.py
+++ b/lib/cmdlib/instance_operation.py
@@ -440,7 +440,7 @@ def GetInstanceConsole(cluster, instance):
@rtype: dict
"""
- hyper = hypervisor.GetHypervisorClass(instance.hypervisor)
+ hyper = hypervisor.GetHypervisor(instance.hypervisor)
# beparams and hvparams are passed separately, to avoid editing the
# instance and then saving the defaults in the instance itself.
hvparams = cluster.FillHV(instance)
The same commit also changed XenHypervisor.GetInstanceConsole from a class
to an instance method, while leaving it a class method for the other
hypervisor classes.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings