From 1441f4f62d2ee6c7a31312647fca14cc28005203 Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Wed, 26 Apr 2017 15:02:04 -0400 Subject: [PATCH] Adds MISC_SHARES_VIA_AGGREGATE standard trait As discussed in Atlanta's PTG meetings, we will use the newly-added traits functionality to mark a resource provider as providing shared resources to a set of other resource providers. We need a new standard trait to represent this shared provider characteristic, and this patch adds it MISC_SHARES_VIA_AGGREGATE along with a fairly lengthy explanation of the trait's meaning. Change-Id: I4e9d8389c9b93ffee20adb53d864d55d335a27fd blueprint: shared-resources-pike --- os_traits/misc/__init__.py | 38 +++++++++++++++++++++++++++++++ os_traits/tests/test_os_traits.py | 1 + 2 files changed, 39 insertions(+) create mode 100644 os_traits/misc/__init__.py diff --git a/os_traits/misc/__init__.py b/os_traits/misc/__init__.py new file mode 100644 index 0000000..bacba82 --- /dev/null +++ b/os_traits/misc/__init__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +TRAITS = [ + # Indicates that the resource provider decorated with this trait exposes + # its resources for consumption on *other* resource providers via an + # aggregate association. The canonical example here would be a shared + # storage pool. + # + # The deployer might create a resource provider, let's call it "NFS_SHARE" + # that has an inventory record of 2000 total DISK_GB resources. + # + # There may be 10 other resource providers, let's call them "CN_1" through + # "CN_10" that represent compute nodes. These compute node resource + # providers have inventory records for MEMORY_MB and VCPU resources, but no + # DISK_GB inventory. + # + # Both the "NFS_SHARE" resource provider and each of the "CN_x" resource + # providers are associated to the same aggregate, let's call it "AGG_A". + # + # Deployers would decorate the "NFS_SHARE" resource provider with the + # "MISC_SHARES_VIA_AGGREGATE" trait to indicate to the system that the + # DISK_GB inventory it provides can be consumed by consumers of resources + # on any of the other resource providers associated with any aggregate + # "NFS_SHARE" is associated to. + 'SHARES_VIA_AGGREGATE', +] diff --git a/os_traits/tests/test_os_traits.py b/os_traits/tests/test_os_traits.py index 28c0cf9..7857d2c 100644 --- a/os_traits/tests/test_os_traits.py +++ b/os_traits/tests/test_os_traits.py @@ -36,6 +36,7 @@ class TestSymbols(base.TestCase): self.assertIn("HW_CPU_X86_AVX2", names) self.assertIn("STORAGE_DISK_SSD", names) self.assertIn("HW_NIC_SRIOV", names) + self.assertIn("MISC_SHARES_VIA_AGGREGATE", names) def test_get_traits(self): traits = ot.get_traits('HW_CPU')