Nir Soffer has uploaded a new change for review.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
fencing: Make getHostLeaseStatus API public
Getting host lease status will allow engine to make smarter decisions when a host is non-responsive by using a proxy host to get the non-responsive host status.
See http://pastebin.com/KqqeAdSu for example output from this API.
Change-Id: I415c1fee6256bf8d4e03ee542cc58e193162e9b8 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M client/vdsClient.py M vdsm/API.py M vdsm/rpc/BindingXMLRPC.py M vdsm/rpc/Bridge.py M vdsm/rpc/vdsmapi-schema.json 5 files changed, 62 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/29157/1
diff --git a/client/vdsClient.py b/client/vdsClient.py index 2c09b28..aea1503 100644 --- a/client/vdsClient.py +++ b/client/vdsClient.py @@ -1760,6 +1760,18 @@ status = self.s.stopMonitoringDomain(sdUUID) return status['status']['code'], status['status']['message']
+ def getHostLeaseStatus(self, args): + domains = {} + for pair in args: + sdUUID, hostId = pair.split('=', 1) + domains[sdUUID] = int(hostId) + response = self.s.getHostLeaseStatus(domains) + if response['status']['code']: + print "Cannot get host storage liveliness" + return response['status']['code'], response['status']['message'] + pp.pprint(response['domains']) + return 0, '' + def snapshot(self, args): vmUUID, sdUUID, imgUUID, baseVolUUID, volUUID = args
@@ -2579,6 +2591,11 @@ ('<sdUUID>', 'Stop monitoring SD: sdUUID' )), + 'getHostLeaseStatus': (serv.getHostLeaseStatus, + ('<sdUUID>=<hostId> [<sdUUID>=<hostId>] ...', + 'Returns host lease status for hostId on ' + 'each domain.' + )), 'snapshot': (serv.snapshot, ('<vmId> <sdUUID> <imgUUID> <baseVolUUID> <volUUID>', 'Take a live snapshot' diff --git a/vdsm/API.py b/vdsm/API.py index e739294..0b44459 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -1497,6 +1497,9 @@ def stopMonitoringDomain(self, sdUUID): return self._irs.stopMonitoringDomain(sdUUID)
+ def getHostLeaseStatus(self, domains): + return self._irs.getHostLeaseStatus(domains) + def getLVMVolumeGroups(self, storageType=None): return self._irs.getVGList(storageType)
diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py index c1c7490..a06a3b4 100644 --- a/vdsm/rpc/BindingXMLRPC.py +++ b/vdsm/rpc/BindingXMLRPC.py @@ -917,6 +917,10 @@ api = API.Global() return api.stopMonitoringDomain(sdUUID)
+ def getHostLeaseStatus(self, domains, options=None): + api = API.Global() + return api.getHostLeaseStatus(domains) + def vgsGetList(self, storageType=None, options=None): api = API.Global() return api.getLVMVolumeGroups(storageType) @@ -1070,6 +1074,7 @@ (self.storageRepoGetStats, 'repoStats'), (self.startMonitoringDomain, 'startMonitoringDomain'), (self.stopMonitoringDomain, 'stopMonitoringDomain'), + (self.getHostLeaseStatus, 'getHostLeaseStatus'), (self.vgsGetList, 'getVGList'), (self.devicesGetList, 'getDeviceList'), (self.devicesGetVisibility, 'getDevicesVisibility'), diff --git a/vdsm/rpc/Bridge.py b/vdsm/rpc/Bridge.py index 7e898de..ba700d1 100644 --- a/vdsm/rpc/Bridge.py +++ b/vdsm/rpc/Bridge.py @@ -349,6 +349,7 @@ 'Host_getStorageRepoStats': {'ret': Host_getStorageRepoStats_Ret}, 'Host_startMonitoringDomain': {}, 'Host_stopMonitoringDomain': {}, + 'Host_getHostLeaseStatus': {'ret': 'domains'}, 'Host_getVMList': {'call': Host_getVMList_Call, 'ret': Host_getVMList_Ret}, 'Host_getVMFullList': {'call': Host_getVMFullList_Call, 'ret': 'vmList'}, 'Host_getAllVmStats': {'ret': 'statsList'}, diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json index 0c8a6f6..7617185 100644 --- a/vdsm/rpc/vdsmapi-schema.json +++ b/vdsm/rpc/vdsmapi-schema.json @@ -2052,6 +2052,42 @@ 'returns': ''}
## +# @HostIdMap: +# +# A mapping of hostId indexed by domain UUID. +# +# Since: 4.15.0 +## +{'map': 'HostIdMap', + 'key': 'UUID', 'value': 'int'} + +## +# @HostLeaseStatusMap: +# +# A mapping of status codes indexed by domain UUID. +# +# Since: 4.15.0 +## +{'map': 'HostLeaseStatusMap', + 'key': 'UUID', 'value': 'str'} + +## +# @Host.getHostLeaseStatus: +# +# Returns host status for for specified domains +# +# @domains: A mapping of hostId indexed by domain UUID +# +# Returns: +# Host status code for each domain +# +# Since: 4.15.0 +## +{'command': {'class': 'Host', 'name': 'getHostLeaseStatus'}, + 'data': {'domains': 'HostIdMap'} + 'returns': {'domains': 'HostLeaseStatusMap'}} + +## # @VmStatus: # # An enumeration of possible virtual machine statuses.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/9605/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/10390/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/10547/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_verify-error-codes_merged/5471/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_merged/3629/ : SUCCESS
Nir Soffer has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 2: Verified+1
Verified on top of http://gerrit.ovirt.org/28873 using vdsClient - see the log url in the commit message.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/9607/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/10392/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/10549/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_verify-error-codes_merged/5473/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_merged/3631/ : SUCCESS
Dan Kenigsberg has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 2:
Martin, is this needed?
Martin Peřina has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 2:
AFAIK it's not needed to fix #1090799 as we plan to check host lease status on fence proxy host as a part of fenceNode call. But I cannot tell you if this won't be needed in future for other tasks ...
Martin Peřina has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 2:
I wanted this additional parameter to cover all other possible parameters regarding to do some logic in fenceNode method. That was the reason to name it fencing policy. And also naming this fencingPolicy with Map type we won't need to modify API call in future, we will just add more items into map).
About the map parameter needed for getHostLeaseStatus, you are right, I didn't look into this new call too much. I will have to find out how will I get the data from engine db, but anyway I will just add this map as another item in fencingPolicy map.
Martin Peřina has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 2:
Please ignore my previous comment :-(
Nir Soffer has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 3:
Rebase
oVirt Jenkins CI Server has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/10685/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/11627/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/11470/ : SUCCESS
Nir Soffer has abandoned this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Abandoned
We don't have any used for this yet. Will reintroduce when needed.
automation@ovirt.org has posted comments on this change.
Change subject: fencing: Make getHostLeaseStatus API public ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found
Jenkins CI RO has abandoned this change.
Change subject: HA: Make getHostLeaseStatus API public ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
gerrit-hooks has posted comments on this change.
Change subject: HA: Make getHostLeaseStatus API public ......................................................................
Patch Set 6:
* update_tracker: OK
Nir Soffer has restored this change.
Change subject: HA: Make getHostLeaseStatus API public ......................................................................
Restored
vdsm-patches@lists.fedorahosted.org