Darshan N has uploaded a new change for review. Change subject: gluster: Adds a new element 'extraFeaturesSupported' to getVdsCaps. ......................................................................
gluster: Adds a new element 'extraFeaturesSupported' to getVdsCaps. This patch adds a new element 'extraFeaturesSupported' to getVdsCaps, which gives the list of extra fetures supported by the host. This patch adds 'GLUSTER_37_FEATURES' to the above list if the host has vdsm support for gluster-3.7 features like snapshot, geo-replication and disk- provisoning. Change-Id: Ic203fa0565914d528ae457427f6f1ff7708017d2 Signed-off-by: Darshan N <[email protected]> --- M vdsm/caps.py M vdsm/rpc/vdsmapi-schema.json 2 files changed, 71 insertions(+), 50 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/40044/1 diff --git a/vdsm/caps.py b/vdsm/caps.py index 7236a99..3dcea2f 100644 --- a/vdsm/caps.py +++ b/vdsm/caps.py @@ -57,6 +57,7 @@ try: from gluster.api import GLUSTER_RPM_PACKAGES from gluster.api import GLUSTER_DEB_PACKAGES + from gluster.api import GlusterApi _glusterEnabled = True except ImportError: _glusterEnabled = False @@ -599,6 +600,20 @@ return False +def _getGluster3_7FeatureSupport(): + # Check if gluster 3.7 features are supported by this Vdsm. + # This Check is done by seeing if sample verbs for supporting + # gluster 3.7 features are available in gluster api. + gluster3_7featureSampleVerbs = ('volumeSnapshotCreate', + 'volumeGeoRepSessionCreate', + 'storageDevicesList') + for feature in gluster3_7featureSampleVerbs: + if feature not in dir(GlusterApi): + return False + else: + return True + + def get(): targetArch = getTargetArch() @@ -692,7 +707,9 @@ caps['kdumpStatus'] = _getKdumpStatus() caps['hostdevPassthrough'] = str(_getHostdevPassthorughSupport()).lower() - + caps['extraFeaturesSupported'] = [] + if _glusterEnabled and _getGluster3_7FeatureSupport(): + caps['extraFeaturesSupported'].append('GLUSTER_37_FEATURES') return caps diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json index e6b56bb..faa5b44 100644 --- a/vdsm/rpc/vdsmapi-schema.json +++ b/vdsm/rpc/vdsmapi-schema.json @@ -1181,93 +1181,97 @@ # # Host information and capabilities. # -# @kvmEnabled: KVM is enabled on the host +# @kvmEnabled: KVM is enabled on the host # -# @cpuThreads: The number of CPU threads present +# @cpuThreads: The number of CPU threads present # -# @cpuCores: The number of CPU cores present +# @cpuCores: The number of CPU cores present # -# @cpuSockets: The number of CPU sockets +# @cpuSockets: The number of CPU sockets # -# @onlineCpus: The list of online logical CPUs -# (new in version 4.16.7) +# @onlineCpus: The list of online logical CPUs +# (new in version 4.16.7) # -# @cpuSpeed: The speed of each CPU (in MHz) +# @cpuSpeed: The speed of each CPU (in MHz) # -# @cpuModel: The CPU model +# @cpuModel: The CPU model # -# @cpuFlags: CPU feature flags (a comma-separated string) +# @cpuFlags: CPU feature flags (a comma-separated string) # -# @version_name: The name given to this version of VDSM +# @version_name: The name given to this version of VDSM # -# @software_version: VDSM version (x.y.z) +# @software_version: VDSM version (x.y.z) # -# @software_revision: Extra VDSM version information +# @software_revision: Extra VDSM version information # -# @supportedENGINEs: A list of supported ovirt-engine versions +# @supportedENGINEs: A list of supported ovirt-engine versions # -# @supportedProtocols: A list of supported xmlrpc protocol versions +# @supportedProtocols: A list of supported xmlrpc protocol versions # -# @clusterLevels: A list of supported cluster versions +# @clusterLevels: A list of supported cluster versions # -# @networks: Information about configured VDSM networks +# @networks: Information about configured VDSM networks # -# @bridges: Information about the network bridges on the host +# @bridges: Information about the network bridges on the host # -# @nics: Information about the network cards on the host +# @nics: Information about the network cards on the host # -# @bondings: Information about configured bonding devices +# @bondings: Information about configured bonding devices # -# @vlans: Information about configured vlans +# @vlans: Information about configured vlans # -# @hooks: #optional Information about installed hooks +# @hooks: #optional Information about installed hooks # -# @operatingSystem: Operating system version information +# @operatingSystem: Operating system version information # -# @uuid: A unique host ID +# @uuid: A unique host ID # -# @packages2: Version information of important software packages +# @packages2: Version information of important software packages # -# @emulatedMachines: A list of supported emulated machines +# @emulatedMachines: A list of supported emulated machines # -# @ISCSIInitiatorName: The iSCSI initiator name for this host +# @ISCSIInitiatorName: The iSCSI initiator name for this host # -# @HBAInventory: Information about available host bus adapters +# @HBAInventory: Information about available host bus adapters # -# @vmTypes: A list of supported virtual machine types +# @vmTypes: A list of supported virtual machine types # -# @memSize: The amount of total memory installed in the host +# @memSize: The amount of total memory installed in the host # -# @reservedMem: The amount of memory reserved for hypervisor overhead +# @reservedMem: The amount of memory reserved for hypervisor overhead # -# @guestOverhead: The amount of memory reserved for per-guest overhead +# @guestOverhead: The amount of memory reserved for per-guest overhead # -# @netConfigDirty: Indicates if there are uncommitted changes to the -# network configuration +# @netConfigDirty: Indicates if there are uncommitted changes to the +# network configuration # -# @rngSources: Sources of entropy available at this host +# @rngSources: Sources of entropy available at this host # -# @numaNodes: Information about host numa topology +# @numaNodes: Information about host numa topology # -# @numaNodeDistance: Distance information between each two numa nodes +# @numaNodeDistance: Distance information between each two numa nodes # -# @autoNumaBalancing: The status of auto numa balancing function +# @autoNumaBalancing: The status of auto numa balancing function # -# @selinux: The status and configuration of SELinux on the host. +# @selinux: The status and configuration of SELinux on the host. # -# @liveSnapshot: #optional Indicates if the host supports live -# snapshotting (new in version 4.15.0) +# @liveSnapshot: #optional Indicates if the host supports live +# snapshotting (new in version 4.15.0) # -# @kdumpStatus: The current status of kdump configuration for the host: -# enabled (1), disabled(0), unknown(-1) -# (new in version 4.15.0) +# @kdumpStatus: The current status of kdump configuration for the host: +# enabled (1), disabled(0), unknown(-1) +# (new in version 4.15.0) # -# @liveMerge: #optional Indicates if live merge is supported on this -# host. -# (new in version 4.15.0) +# @liveMerge: #optional Indicates if live merge is supported on this +# host. +# (new in version 4.15.0) # -# @directedPassthrough: Indicates status of Intel VT-d or AMD-vi -# (new in version 4.17.0) +# @directedPassthrough: Indicates status of Intel VT-d or AMD-vi +# (new in version 4.17.0) +# +# @extraFeaturesSupported: Provides a list of extra features +# supported in this host. +# (new in version 4.17.0) # # Since: 4.15.0 # @@ -1295,7 +1299,7 @@ 'autoNumaBalancing': 'AutoNumaBalancingStatus', 'selinux': 'SELinuxStatus', '*liveSnapshot': 'bool', 'kdumpStatus': 'int', '*liveMerge': 'bool', - 'directedPassthrough': 'bool'}} + 'directedPassthrough': 'bool', 'extraFeaturesSupported': ['str']}} ## # @Host.getCapabilities: -- To view, visit https://gerrit.ovirt.org/40044 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic203fa0565914d528ae457427f6f1ff7708017d2 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.5-gluster Gerrit-Owner: Darshan N <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
