Nir Soffer has posted comments on this change.
Change subject: storage: introducing vdsm-dump-chains script
......................................................................
Patch Set 5:
I think the best place for this would be as part of vdsm-tool, so we don't need to deal with packaging at all.
--
To view, visit https://gerrit.ovirt.org/38281
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I428c443bb7d6b2a504a6f77efcd4838f7ae6c404
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Yaniv Dary <ydary(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
Nir Soffer has posted comments on this change.
Change subject: storage: introducing vdsm-dump-chains script
......................................................................
Patch Set 5:
(1 comment)
https://gerrit.ovirt.org/#/c/38281/5//COMMIT_MSG
Commit Message:
Line 3: AuthorDate: 2015-03-02 16:33:50 +0200
Line 4: Commit: Ido Barkan <ibarkan(a)redhat.com>
Line 5: CommitDate: 2015-03-03 12:15:23 +0200
Line 6:
Line 7: storage: introducing vdsm-dump-chains script
maybe vdsm-dump-images ?
Line 8:
Line 9: This script queries VDSM about the existing structure of image
Line 10: volumes and prints them in an ordered fashion with optional
Line 11: additional info per volume
--
To view, visit https://gerrit.ovirt.org/38281
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I428c443bb7d6b2a504a6f77efcd4838f7ae6c404
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Yaniv Dary <ydary(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
Ido Barkan has posted comments on this change.
Change subject: storage: introducing vdsm-dump-chains script
......................................................................
Patch Set 5: Code-Review-1
(22 comments)
code review with nsoffer
https://gerrit.ovirt.org/#/c/38281/5/client/vdsm_dump_chains.py
File client/vdsm_dump_chains.py:
Line 28: class ServerError(Exception):
Line 29: pass
Line 30:
Line 31:
Line 32: def _volume_dict_to_volume_chains(dct):
assuming we only have a single volume without a parent (base) we can simplify this by just probing for the next child, until the dictionary is exhausted. if there is a child that is not present in the dictionary- shout.
Line 33:
Line 34: def _tails_indices(chains_):
Line 35: return dict(
Line 36: (chain[-1], chain_index)
Line 82: return res
Line 83:
Line 84:
Line 85: def _get_volumes_chains(sd_uuid, server):
Line 86: pools = _call_server(server.getConnectedStoragePoolsList)
factor out, and add a comment about the single pool
Line 87: sp_uuid, = pools['poollist']
Line 88: images = _call_server(server.getImagesList, sd_uuid)
Line 89:
Line 90: dct_image_volume_chains = {} # {image_uuid -> vol_chains}
Line 84:
Line 85: def _get_volumes_chains(sd_uuid, server):
Line 86: pools = _call_server(server.getConnectedStoragePoolsList)
Line 87: sp_uuid, = pools['poollist']
Line 88: images = _call_server(server.getImagesList, sd_uuid)
maybe create a small wrapper for each api call to clean up this code
Line 89:
Line 90: dct_image_volume_chains = {} # {image_uuid -> vol_chains}
Line 91: dct_volumes_info = {} # {vol_uuid-> vol_info}
Line 92: for img_uuid in images['imageslist']:
Line 88: images = _call_server(server.getImagesList, sd_uuid)
Line 89:
Line 90: dct_image_volume_chains = {} # {image_uuid -> vol_chains}
Line 91: dct_volumes_info = {} # {vol_uuid-> vol_info}
Line 92: for img_uuid in images['imageslist']:
factor put this get
Line 93: volumes = _call_server(
Line 94: server.getVolumesList, sd_uuid, sp_uuid, img_uuid)
Line 95:
Line 96: dct_volumes = {} # {parent_vol_uuid-> child_vol_uuid}
Line 92: for img_uuid in images['imageslist']:
Line 93: volumes = _call_server(
Line 94: server.getVolumesList, sd_uuid, sp_uuid, img_uuid)
Line 95:
Line 96: dct_volumes = {} # {parent_vol_uuid-> child_vol_uuid}
volumes_children
Line 97:
Line 98: for vol_uuid in volumes['uuidlist']:
Line 99: vol_info_answer = _call_server(server.getVolumeInfo, sd_uuid,
Line 100: sp_uuid, img_uuid, vol_uuid)
Line 97:
Line 98: for vol_uuid in volumes['uuidlist']:
Line 99: vol_info_answer = _call_server(server.getVolumeInfo, sd_uuid,
Line 100: sp_uuid, img_uuid, vol_uuid)
Line 101: if 'info' not in vol_info_answer:
can this really happen?
Line 102: print 'ERROR getting info for volume %s:%s' % (
Line 103: vol_uuid, vol_info_answer)
Line 104: continue
Line 105: vol_info = vol_info_answer['info']
Line 98: for vol_uuid in volumes['uuidlist']:
Line 99: vol_info_answer = _call_server(server.getVolumeInfo, sd_uuid,
Line 100: sp_uuid, img_uuid, vol_uuid)
Line 101: if 'info' not in vol_info_answer:
Line 102: print 'ERROR getting info for volume %s:%s' % (
write to stderr
Line 103: vol_uuid, vol_info_answer)
Line 104: continue
Line 105: vol_info = vol_info_answer['info']
Line 106: dct_volumes_info[vol_uuid] = vol_info
Line 105: vol_info = vol_info_answer['info']
Line 106: dct_volumes_info[vol_uuid] = vol_info
Line 107:
Line 108: parent_uuid = vol_info['parent']
Line 109: if vdsClient.BLANK_UUID == parent_uuid:
define here or try to import from vdsm
Line 110: dct_volumes[None] = vol_uuid
Line 111: else:
Line 112: dct_volumes[parent_uuid] = vol_uuid
Line 113:
Line 106: dct_volumes_info[vol_uuid] = vol_info
Line 107:
Line 108: parent_uuid = vol_info['parent']
Line 109: if vdsClient.BLANK_UUID == parent_uuid:
Line 110: dct_volumes[None] = vol_uuid
use BLANK_UUID?
Line 111: else:
Line 112: dct_volumes[parent_uuid] = vol_uuid
Line 113:
Line 114: dct_image_volume_chains[img_uuid] = _volume_dict_to_volume_chains(
Line 145: relevant_info if verbose else ''
Line 146: )
Line 147:
Line 148:
Line 149: if __name__ == '__main__':
just call main() here and implement it at the top of the module.
Line 150:
Line 151: usage = "usage: vdsm-dump-chains [options] <ip|0> <storage_domain_UUID>"
Line 152: parser = optparse.OptionParser(usage)
Line 153: parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
Line 148:
Line 149: if __name__ == '__main__':
Line 150:
Line 151: usage = "usage: vdsm-dump-chains [options] <ip|0> <storage_domain_UUID>"
Line 152: parser = optparse.OptionParser(usage)
localhost + ssl should be the default. add options to override it.
Line 153: parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
Line 154: help="show additional volume info")
Line 155: parser.add_option("-s", "--SSL", action="store_true", dest="use_ssl",
Line 156: help="use SSL")
Line 154: help="show additional volume info")
Line 155: parser.add_option("-s", "--SSL", action="store_true", dest="use_ssl",
Line 156: help="use SSL")
Line 157:
Line 158: (options, args) = parser.parse_args()
remove (,)
Line 159: if len(args) != 2:
Line 160: parser.error('incorrect number of arguments')
Line 161:
Line 162: ip, sd_uuid = args
Line 156: help="use SSL")
Line 157:
Line 158: (options, args) = parser.parse_args()
Line 159: if len(args) != 2:
Line 160: parser.error('incorrect number of arguments')
show a more verbose error message (what should have been entered)
Line 161:
Line 162: ip, sd_uuid = args
Line 163:
Line 164: host_port = vdscli.cannonizeHostPort(ip)
Line 160: parser.error('incorrect number of arguments')
Line 161:
Line 162: ip, sd_uuid = args
Line 163:
Line 164: host_port = vdscli.cannonizeHostPort(ip)
additional parameter for port (and use it directly without requiring cannonizeHostPort)
Line 165: service = vdsClient.service()
Line 166: service.useSSL = bool(options.use_ssl)
Line 167:
Line 168: try:
Line 161:
Line 162: ip, sd_uuid = args
Line 163:
Line 164: host_port = vdscli.cannonizeHostPort(ip)
Line 165: service = vdsClient.service()
use vdsm/lib/vdsm/vdscli.py directly instead of vdsClient
Line 166: service.useSSL = bool(options.use_ssl)
Line 167:
Line 168: try:
Line 169: service.do_connect(host_port)
Line 167:
Line 168: try:
Line 169: service.do_connect(host_port)
Line 170: except socket.error as e:
Line 171: if e[0] == 111:
use errno
Line 172: print "Connection to %s refused" % host_port
Line 173: else:
Line 174: traceback.print_exc()
Line 175: sys.exit(-1)
Line 168: try:
Line 169: service.do_connect(host_port)
Line 170: except socket.error as e:
Line 171: if e[0] == 111:
Line 172: print "Connection to %s refused" % host_port
write to stderr (maybe use a proper func for this) and exit
Line 173: else:
Line 174: traceback.print_exc()
Line 175: sys.exit(-1)
Line 176:
Line 170: except socket.error as e:
Line 171: if e[0] == 111:
Line 172: print "Connection to %s refused" % host_port
Line 173: else:
Line 174: traceback.print_exc()
just raise
Line 175: sys.exit(-1)
Line 176:
Line 177: volume_chains, dct_volumes_info = _get_volumes_chains(sd_uuid, service.s)
Line 171: if e[0] == 111:
Line 172: print "Connection to %s refused" % host_port
Line 173: else:
Line 174: traceback.print_exc()
Line 175: sys.exit(-1)
1
Line 176:
Line 177: volume_chains, dct_volumes_info = _get_volumes_chains(sd_uuid, service.s)
Line 173: else:
Line 174: traceback.print_exc()
Line 175: sys.exit(-1)
Line 176:
Line 177: volume_chains, dct_volumes_info = _get_volumes_chains(sd_uuid, service.s)
there could be one, and only one chain per image- need to reflect it in data structure.
also non need for hungarian notation
https://gerrit.ovirt.org/#/c/38281/5/tests/vdsmDumpChainsTests.py
File tests/vdsmDumpChainsTests.py:
Line 22:
Line 23: from vdsm_dump_chains import _volume_dict_to_volume_chains
Line 24:
Line 25:
Line 26: class vdsmDumpChainsTest(TestCaseBase):
also test the base where there is no parent (parent is BLANK_UUID)
Line 27: def test_single_chain(self):
Line 28: d = {'a': 'b', 'b': None}
Line 29: self.assertEqual(_volume_dict_to_volume_chains(d), [['a', 'b', None]])
Line 30:
Line 28: d = {'a': 'b', 'b': None}
Line 29: self.assertEqual(_volume_dict_to_volume_chains(d), [['a', 'b', None]])
Line 30:
Line 31: def test_two_disconnected_chains(self):
Line 32: d = {'a': 'b', 'c': 'd', 'b': None, 'd': None}
there is no such case (to chains)
Line 33: self.assertEqual(
Line 34: _volume_dict_to_volume_chains(d).sort(),
Line 35: [['a', 'b', None], ['c', 'd', None]].sort())
Line 36:
--
To view, visit https://gerrit.ovirt.org/38281
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I428c443bb7d6b2a504a6f77efcd4838f7ae6c404
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Yaniv Dary <ydary(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
Hello Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/38322
to review the following change.
Change subject: json-rpc: fix the Host.getVMList return value
......................................................................
json-rpc: fix the Host.getVMList return value
Host.getVMList() should return either VmDefinition or
VmShortStatus depending on the parameter fullStatus.
The return value in case fullStatus=False was wrong,
as it was just a list of UUIDs, while VmShortStatus
is supposed to be a dictionary holding (at least)
vmId and vmStatus.
This change made life harder to Engine monitoring code.
Missing the status, Engine's monitoring had no choice
but to call Vm.getStats() after each getVmList(), and that
has a not-negligible performance cost.
This patch makes the JSON-RPC output compliant to the
schema, to what Engine's monitoring expects and also
to XML-RPC output.
Change-Id: I2b8b2ed205385f4bdd341cdc576b44312c3fc117
Bug-Url: https://bugzilla.redhat.com/1196327
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/rpc/Bridge.py
1 file changed, 1 insertion(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/38322/1
diff --git a/vdsm/rpc/Bridge.py b/vdsm/rpc/Bridge.py
index e4b12aa..e1781a2 100644
--- a/vdsm/rpc/Bridge.py
+++ b/vdsm/rpc/Bridge.py
@@ -333,13 +333,6 @@
return API.Global().getVMList(True, vmList)
-def Host_getVMList_Ret(ret):
- """
- Just return a list of VM UUIDs
- """
- return [v['vmId'] for v in ret['vmList']]
-
-
def StoragePool_getInfo_Ret(ret):
"""
The result contains two data structures which must be merged
@@ -409,7 +402,7 @@
'Host_getStorageRepoStats': {'ret': Host_getStorageRepoStats_Ret},
'Host_startMonitoringDomain': {},
'Host_stopMonitoringDomain': {},
- 'Host_getVMList': {'call': Host_getVMList_Call, 'ret': Host_getVMList_Ret},
+ 'Host_getVMList': {'call': Host_getVMList_Call, 'ret': 'vmList'},
'Host_getVMFullList': {'call': Host_getVMFullList_Call, 'ret': 'vmList'},
'Host_getAllVmStats': {'ret': 'statsList'},
'Host_setupNetworks': {'ret': 'status'},
--
To view, visit https://gerrit.ovirt.org/38322
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b8b2ed205385f4bdd341cdc576b44312c3fc117
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Ondřej Svoboda has uploaded a new change for review.
Change subject: testSetupNetworksOverDhcpIface: respect the system version for dnsmasq
......................................................................
testSetupNetworksOverDhcpIface: respect the system version for dnsmasq
Change-Id: I692f09f406dd10746b79edcec04f9c564f180efc
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M tests/functional/networkTests.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/37735/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 7edd21b..5e69625 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -2167,7 +2167,7 @@
with veth.pair() as (server, client):
veth.setIP(server, IP_ADDRESS, IP_CIDR)
veth.setLinkUp(server)
- with dnsmasqDhcp(server):
+ with dnsmasqDhcp(server, _system_is_el6()):
with namedTemporaryDir(dir='/var/lib/dhclient') as dhdir:
# Start a non-vdsm owned dhclient for the 'client' iface
dhclient_runner = dhcp.DhclientRunner(
--
To view, visit http://gerrit.ovirt.org/37735
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I692f09f406dd10746b79edcec04f9c564f180efc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>