Change in vdsm[master]: add and use hypervisor autodetection in bootstrap.
by fromani@gmail.com
Francesco Romani has posted comments on this change.
Change subject: add and use hypervisor autodetection in bootstrap.
......................................................................
Patch Set 5: (1 inline comment)
....................................................
File vdsm_reg/deployUtil.py.in
Line 1328: def cpuHypervisorID():
Line 1329: # we cannot (yet) use _cpuid because of the different
Line 1330: # unpack format.
Line 1331: HYPERVISOR_CPUID_LEAF = 0x40000000
Line 1332: with open('/dev/cpu/0/cpuid') as f:
You're right, for example in debian it (used to) is configured as a module.
I agree a workaround for those situations has to be provided.
However I think this fix is definitively out of scope for this patch, because deployUtil already depends on the avaibility of the file (see the whole virtEnabledInCpuAndBios workhorse function) and this change doesn't worse the situation in any way.
On a sidenote, the ovirt wiki may be out of date also, because it clearly states
"Currently, Vdsm requires Red Hat Enterprise Linux 6.2 or Fedora 16 to run properly. " (http://wiki.ovirt.org/wiki/Vdsm)
After having said all of the above, I don't have any idea yet about how to fix the cpuid availability problem :)
Line 1333: f.seek(HYPERVISOR_CPUID_LEAF)
Line 1334: c = struct.unpack('I12s', f.read(16))
Line 1335: return c[1].strip('\x00')
Line 1336:
--
To view, visit http://gerrit.ovirt.org/7657
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I79f4ab08b838bd75af5d4c26f98923fca0d65d8e
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)gmail.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)gmail.com>
Gerrit-Reviewer: Ryan Harper <ryanh(a)us.ibm.com>
Gerrit-Reviewer: Shu Ming <shuming(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 7 months
Change in vdsm[master]: add and use hypervisor autodetection in bootstrap.
by Ryan Harper
Ryan Harper has posted comments on this change.
Change subject: add and use hypervisor autodetection in bootstrap.
......................................................................
Patch Set 5: I would prefer that you didn't submit this
(1 inline comment)
....................................................
File vdsm_reg/deployUtil.py.in
Line 1328: def cpuHypervisorID():
Line 1329: # we cannot (yet) use _cpuid because of the different
Line 1330: # unpack format.
Line 1331: HYPERVISOR_CPUID_LEAF = 0x40000000
Line 1332: with open('/dev/cpu/0/cpuid') as f:
This file is provided by the kernel if:
CONFIG_X86_MSR=y
in RHEL6 it's currently part of the kernel config. Other distros might not have this compiled in. It may be a module. I'd like to see if we can be robust here and either have deployUtil attempt to load the module or something else so we don't fail on systems that are configured slightly different.
Thoughts?
Line 1333: f.seek(HYPERVISOR_CPUID_LEAF)
Line 1334: c = struct.unpack('I12s', f.read(16))
Line 1335: return c[1].strip('\x00')
Line 1336:
--
To view, visit http://gerrit.ovirt.org/7657
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I79f4ab08b838bd75af5d4c26f98923fca0d65d8e
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)gmail.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)gmail.com>
Gerrit-Reviewer: Ryan Harper <ryanh(a)us.ibm.com>
Gerrit-Reviewer: Shu Ming <shuming(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
11 years, 7 months
Change in vdsm[master]: engine.py: fix nodeCleanup() order call
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: engine.py: fix nodeCleanup() order call
......................................................................
engine.py: fix nodeCleanup() order call
Call deployUtil.nodeCleanup() only if oVirt Engine is reachable.
Even if oVirt Engine is not reachable it will backup cacert.pem and remove it.
However, since we cannot reach the Engine won't be possible to download the new
cacert.pem and TUI will break next time someone try to register oVirt Engine.
Change-Id: I62e86e354b3a588ce6113d7b308ece801af22917
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm_reg/engine.py.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/6859/1
--
To view, visit http://gerrit.ovirt.org/6859
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I62e86e354b3a588ce6113d7b308ece801af22917
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
11 years, 7 months
Change in vdsm[master]: [WIP] Add ballooning support
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: [WIP] Add ballooning support
......................................................................
[WIP] Add ballooning support
Change-Id: I36b1211dbce28bb5bb5926f2db7e2e42a698efc9
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M vdsm/API.py
M vdsm/define.py
M vdsm/libvirtvm.py
M vdsm/vm.py
4 files changed, 27 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/3669/1
--
To view, visit http://gerrit.ovirt.org/3669
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36b1211dbce28bb5bb5926f2db7e2e42a698efc9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
11 years, 7 months
Change in vdsm[master]: Added glusterVolumeProfileStop verb
by tjeyasin@redhat.com
Hello Bala.FA, Saggi Mizrahi, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/7435
to review the following change.
Change subject: Added glusterVolumeProfileStop verb
......................................................................
Added glusterVolumeProfileStop verb
Change-Id: Ie25c7da7208eb4bf68f67d945fb7c63b44886040
Signed-off-by: Timothy Asir <tjeyasin(a)redhat.com>
---
M vdsm/gluster/api.py
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
M vdsm_cli/vdsClientGluster.py
4 files changed, 27 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/7435/1
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 135f4bb..dc3ec0b 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -225,6 +225,10 @@
def volumeProfileStart(self, volumeName, options=None):
self.svdsmProxy.glusterVolumeProfileStart(volumeName)
+ @exportAsVerb
+ def volumeProfileStop(self, volumeName, options=None):
+ self.svdsmProxy.glusterVolumeProfileStop(volumeName)
+
def getGlusterMethods(gluster):
l = []
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index 9d05568..2618aa1 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -568,3 +568,12 @@
if err:
raise ge.GlusterVolumeProfileStartFailedException(err[0], err[1])
return True
+
+
+@exportToSuperVdsm
+def volumeProfileStop(volumeName):
+ command = _getGlusterVolCmd() + ["profile", volumeName, "stop"]
+ err, res = _execGluster(command, xml=True)
+ if err:
+ raise ge.GlusterVolumeProfileStopFailedException(err[0], err[1])
+ return True
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index 29078a9..f5dfb73 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -323,6 +323,11 @@
message = "Volume profile start failed"
+class GlusterVolumeProfileStopFailedException(GlusterVolumeException):
+ code = 4158
+ message = "Volume profile stop failed"
+
+
# Host
class GlusterHostException(GlusterException):
code = 4400
diff --git a/vdsm_cli/vdsClientGluster.py b/vdsm_cli/vdsClientGluster.py
index 1f5d52a..0a253fe 100644
--- a/vdsm_cli/vdsClientGluster.py
+++ b/vdsm_cli/vdsClientGluster.py
@@ -203,6 +203,10 @@
status = self.s.glusterVolumeProfileStart(args[0])
return status['status']['code'], status['status']['message']
+ def do_glusterVolumeProfileStop(self, args):
+ status = self.s.glusterVolumeProfileStop(args[0])
+ return status['status']['code'], status['status']['message']
+
def getGlusterCmdDict(serv):
return {
@@ -364,4 +368,9 @@
('<volume_name>\n\t<volume_name> is existing volume name',
'start gluster volume profile'
)),
+ 'glusterVolumeProfileStop':
+ (serv.do_glusterVolumeProfileStop,
+ ('<volume_name>\n\t<volume_name> is existing volume name',
+ 'stop gluster volume profile'
+ )),
}
--
To view, visit http://gerrit.ovirt.org/7435
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie25c7da7208eb4bf68f67d945fb7c63b44886040
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years, 7 months
Change in vdsm[master]: Added glusterVolumeProfileStart verb
by tjeyasin@redhat.com
Hello Bala.FA, Saggi Mizrahi, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/7285
to review the following change.
Change subject: Added glusterVolumeProfileStart verb
......................................................................
Added glusterVolumeProfileStart verb
Change-Id: I279977bb4dc3631162ce22668612103896646afe
Signed-off-by: Timothy Asir <tjeyasin(a)redhat.com>
---
M vdsm/gluster/api.py
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
M vdsm_cli/vdsClientGluster.py
4 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/7285/1
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 576ddf1..47e5675 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -221,6 +221,10 @@
"""
return {'hosts': self.svdsmProxy.glusterPeerStatus()}
+ @exportAsVerb
+ def volumeProfileStart(self, volumeName):
+ self.svdsmProxy.glusterVolumeProfileStart(volumeName)
+
def getGlusterMethods(gluster):
l = []
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index dd79865..5956bbc 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -543,3 +543,13 @@
else:
return _parsePeerStatus(out, _getGlusterHostName(),
_getGlusterUuid(), HostStatus.CONNECTED)
+
+
+@exportToSuperVdsm
+def volumeProfileStart(volumeName):
+ command = _getGlusterVolCmd() + ["profile", volumeName, "start"]
+ rc, out, err = _execGluster(command)
+ if rc:
+ raise ge.GlusterVolumeProfileStartFailedException(rc, out, err)
+ else:
+ return True
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index 8d48c48..d2ebc1e 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -347,3 +347,8 @@
class GlusterHostListFailedException(GlusterHostException):
code = 4407
message = "Host list failed"
+
+
+class GlusterVolumeProfileStartFailedException(GlusterVolumeException):
+ code = 4408
+ message = "Volume profile start failed"
diff --git a/vdsm_cli/vdsClientGluster.py b/vdsm_cli/vdsClientGluster.py
index e72c424..1f5d52a 100644
--- a/vdsm_cli/vdsClientGluster.py
+++ b/vdsm_cli/vdsClientGluster.py
@@ -199,6 +199,10 @@
pp.pprint(status)
return status['status']['code'], status['status']['message']
+ def do_glusterVolumeProfileStart(self, args):
+ status = self.s.glusterVolumeProfileStart(args[0])
+ return status['status']['code'], status['status']['message']
+
def getGlusterCmdDict(serv):
return {
@@ -355,4 +359,9 @@
('',
'list host info'
)),
+ 'glusterVolumeProfileStart':
+ (serv.do_glusterVolumeProfileStart,
+ ('<volume_name>\n\t<volume_name> is existing volume name',
+ 'start gluster volume profile'
+ )),
}
--
To view, visit http://gerrit.ovirt.org/7285
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I279977bb4dc3631162ce22668612103896646afe
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years, 7 months
Change in vdsm[master]: [WIP] Added glusterVolumeStatus verb
by barumuga@redhat.com
Hello Ayal Baron, Timothy Asir, Saggi Mizrahi, Federico Simoncelli, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/6374
to review the following change.
Change subject: [WIP] Added glusterVolumeStatus verb
......................................................................
[WIP] Added glusterVolumeStatus verb
Change-Id: I8769c2da299a598ed7500c4780a3329972f4a8ac
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M vdsm/gluster/api.py
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
M vdsm_cli/vdsClientGluster.py
4 files changed, 105 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/6374/1
--
To view, visit http://gerrit.ovirt.org/6374
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8769c2da299a598ed7500c4780a3329972f4a8ac
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
11 years, 7 months
Change in vdsm[master]: BZ#856167 - Store engine CA cert in enginecacert.pem
by juan.hernandez@redhat.com
Juan Hernandez has uploaded a new change for review.
Change subject: BZ#856167 - Store engine CA cert in enginecacert.pem
......................................................................
BZ#856167 - Store engine CA cert in enginecacert.pem
Currently we store the CA certificate downloaded that we get from the
engine for registration purposes in the /etc/pki/vdsm/cacert.pem file.
This file is then replaced by VDSM by its default one during reboot,
making a backup before. This means that after the reboot vdsm-reg can't
use it to download the SSH key, and this means that registration fails.
This patch changes deployUtil.py so that it downloads the engine CA
certificate to a new file: /etc/pki/vdsm/enginecacert.pem. This file is
preserved, so that vdsm-reg can use it to download the SSH key
correctly.
Change-Id: I127bf44cbcde90f7dae26a3bd3127f3eac2ca53c
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M vdsm_reg/deployUtil.py.in
M vdsm_reg/engine.py.in
2 files changed, 24 insertions(+), 20 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/8038/1
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index bbda70e..60fda9e 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -629,10 +629,10 @@
"""
This functions returns the public ssh key of @ENGINENAME@.
"""
- CACERT, dontcare = certPaths('')
+ dontcare, dontcare, ENGINECACERT = certPaths('')
for cert in REMOTE_SSH_KEY_FILE:
data = getRemoteFile(IP, port, cert,
- timeout=HTTP_TIMEOUT, certPath=CACERT)
+ timeout=HTTP_TIMEOUT, certPath=ENGINECACERT)
if data != None:
break
@@ -1137,8 +1137,9 @@
if fAddID:
VDSMCERT = tsDir + "/certs/vdsm-" + os.environ.get("SSH_CONNECTION").split()[2] + "-cert.pem"
CACERT = tsDir + "/certs/cacert.pem"
+ ENGINECACERT = tsDir + "/certs/enginecacert.pem"
- return CACERT, VDSMCERT
+ return CACERT, VDSMCERT, ENGINECACERT
def pkiCleanup(key, cert):
"""
@@ -1185,7 +1186,7 @@
nGID = gGroup.gr_gid
uUserInfo = pwd.getpwnam(VDSM_USER)
nUID = uUserInfo.pw_uid
- CACERT, VDSMCERT = certPaths(confFile)
+ CACERT, VDSMCERT, ENGINECACERT = certPaths(confFile)
# Delete old certificates
logging.debug("instCert: try to delete old certificates")
@@ -1447,34 +1448,37 @@
backupTime = dt.strftime("%Y-%m-%d_%H%M%S")
for pemFile in certs:
- certName = os.path.basename(pemFile)
- dirName = os.path.dirname(pemFile)
+ if os.path.exists(pemFile):
+ certName = os.path.basename(pemFile)
+ dirName = os.path.dirname(pemFile)
- bkpCertName = dirName + "/bkp-" + backupTime + '_' + certName
+ bkpCertName = dirName + "/bkp-" + backupTime + '_' + certName
- shutil.copy2(pemFile, bkpCertName)
- st = os.stat(pemFile)
- os.chown(bkpCertName, st.st_uid, st.st_gid)
- ovirtfunctions.ovirt_store_config(bkpCertName)
+ shutil.copy2(pemFile, bkpCertName)
+ st = os.stat(pemFile)
+ os.chown(bkpCertName, st.st_uid, st.st_gid)
+ ovirtfunctions.ovirt_store_config(bkpCertName)
def nodeCleanup():
if isOvirt():
- CACERT, VDSMCERT = certPaths('')
+ CACERT, VDSMCERT, ENGINECACERT = certPaths('')
- _nodeBackupCerts([CACERT, VDSMCERT])
+ _nodeBackupCerts([CACERT, VDSMCERT, ENGINECACERT])
if os.path.exists(CACERT):
ovirtfunctions.ovirt_safe_delete_config(CACERT)
+ if os.path.exists(ENGINECACERT):
+ ovirtfunctions.ovirt_safe_delete_config(ENGINECACERT)
def getRhevmCert(IP, port):
- CACERT, VDSMCERT = certPaths('')
+ dontcare, VDSMCERT, ENGINECACERT = certPaths('')
RHEVM_CERT_FILE = "/ca.crt"
rhevmCert = getRemoteFile(str(IP), str(port), RHEVM_CERT_FILE)
if rhevmCert:
- dirName = os.path.dirname(CACERT)
+ dirName = os.path.dirname(ENGINECACERT)
if not os.path.exists(dirName):
os.makedirs(dirName)
- crt = file(CACERT, "w+")
+ crt = file(ENGINECACERT, "w+")
try:
crt.write(rhevmCert)
finally:
@@ -1542,14 +1546,14 @@
if not getRhevmCert(options.serverIp, options.serverPort):
print 'Failed downloading the @ENGINENAME@ certificate file'
return -1
- CACERT, dontcare = certPaths('')
- fp = generateFingerPrint(CACERT)
+ dontcare, dontcare, ENGINECACERT = certPaths('')
+ fp = generateFingerPrint(ENGINECACERT)
if options.fingerPrint != fp:
print 'Expected fingerprint %s is different from recieved fingerprint %s' % (options.fingerPrint, fp)
return -1
if isOvirt():
- ovirtfunctions.ovirt_store_config(CACERT)
+ ovirtfunctions.ovirt_store_config(ENGINECACERT)
print '@ENGINENAME@ certificate downloaded and verified successfully.'
return 0
print 'Missing arguments'
diff --git a/vdsm_reg/engine.py.in b/vdsm_reg/engine.py.in
index 15e38b5..8be6940 100644
--- a/vdsm_reg/engine.py.in
+++ b/vdsm_reg/engine.py.in
@@ -283,7 +283,7 @@
if self.verify_engine_cert.selected():
if deployUtil.getRhevmCert(self.engine_server.value(), enginePort):
- path, dontCare = deployUtil.certPaths('')
+ path, dontCare, dontCare = deployUtil.certPaths('')
fp = deployUtil.generateFingerPrint(path)
approval = ButtonChoiceWindow(self.ncs.screen,
"Certificate Fingerprint:",
--
To view, visit http://gerrit.ovirt.org/8038
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I127bf44cbcde90f7dae26a3bd3127f3eac2ca53c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
11 years, 7 months
Change in vdsm[master]: BZ#854151 - Fix disconnect iscsi connections.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: BZ#854151 - Fix disconnect iscsi connections.
......................................................................
BZ#854151 - Fix disconnect iscsi connections.
Change-Id: I82f8680a3297da2ab8b766bfb7df9bde1cd20533
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/storageServer.py
2 files changed, 25 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/8275/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index a89274a..330b7c0 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2032,10 +2032,11 @@
conObj = storageServer.ConnectionFactory.createConnection(conInfo)
try:
conObj.disconnect()
- status = 0
except Exception as err:
self.log.error("Could not disconnect from storageServer", exc_info=True)
status, _ = self._translateConnectionError(err)
+ else:
+ status = 0
res.append({'id': conDef["id"], 'status': status})
diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index a7dda01..f9e094a 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -282,6 +282,7 @@
return hash(type(self)) ^ hash(self._mountCon)
class IscsiConnection(object):
+ log = logging.getLogger("StorageServer.IscsiConnection")
@property
def target(self):
return self._target
@@ -314,43 +315,45 @@
host = self._target.portal.hostname
try:
ip = socket.gethostbyname(host)
+ except socket.gaierror:
+ return False
+ else:
if ip != portal.hostname:
return False
- except socket.gaierror:
- return False
-
- if self._target.portal.port != portal.port:
+ elif self._target.portal.port != portal.port:
return False
- if self._target.tpgt != target.tpgt:
+ elif self._target.iqn != target.iqn:
return False
- if self._target.iqn != target.iqn:
+ elif self._iface.name != iface.name:
return False
- if self._iface.name != iface.name:
+ elif self._cred != cred:
return False
- if self._cred != cred:
- return False
-
- return True
+ else:
+ return True
def getSessionInfo(self):
sessions = iscsi.iterateIscsiSessions()
try:
info = iscsi.getSessionInfo(self._lastSessionId)
- sessions = chain(info, sessions)
except Exception:
- pass
+ self.log.warning("Can't get session info, self._lastSessionId %s", self._lastSessionId)
+ else:
+ sessions = chain(info, sessions)
- for session in iscsi.iterateIscsiSessions():
+ self.log.debug("self._target: %s", self._target)
+ for session in sessions:
+ self.log.debug("session %s", session)
if self.isSession(session):
self._lastSessionId = session.id
+ self.log.debug("self._lastSessionId: %s", self._lastSessionId)
return session
-
- raise OSError(errno.ENOENT, "Session not found")
+ else:
+ raise OSError(errno.ENOENT, "Session not found in sessions: %s", sessions)
def isConnected(self):
try:
@@ -362,13 +365,17 @@
raise
def disconnect(self):
+ self.log.debug("Iscsi disconnect called.")
try:
sid = self.getSessionInfo().id
except OSError, e:
if e.errno == errno.ENOENT:
+ self.log.warning("Can't get iscsi session id, ENOENT: %s", e.errno)
return
+ self.log.warning("Cant get iscsi session id, errno: %s", e.errno)
raise
+ self.log.debug("Disconnecting iscsi session id: %s", sid)
iscsi.disconnectiScsiSession(sid)
def __eq__(self, other):
--
To view, visit http://gerrit.ovirt.org/8275
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I82f8680a3297da2ab8b766bfb7df9bde1cd20533
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 7 months
Change in vdsm[master]: Fix check-local build error
by Ryan Harper
Ryan Harper has uploaded a new change for review.
Change subject: Fix check-local build error
......................................................................
Fix check-local build error
Commit a062a1ae5124b6bce0beb73433fe0bf5822e6ebd changed
vm.py removing a call to the caps module, but didn't remove
the module import from source file and now pyflakes complains.
(hungerforce) vdsm % make check-local
find . -path './.git' -prune -type f -o \
-name '*.py' -o -name '*.py.in' | xargs /bin/pyflakes
./vdsm/vm.py:36: 'caps' imported but unused
make: *** [check-local] Error 123
This patch just removes the import.
Change-Id: I1db4f921afb471dd0bd335c178f9b518b0d57c74
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M vdsm/vm.py
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8308/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index c5507e9..77bff41 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -33,7 +33,6 @@
from logUtils import SimpleLogAdapter
import libvirt
from vdsm import vdscli
-import caps
DEFAULT_BRIDGE = config.get("vars", "default_bridge")
--
To view, visit http://gerrit.ovirt.org/8308
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1db4f921afb471dd0bd335c178f9b518b0d57c74
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
11 years, 7 months