用于以前 RHN 用户的订阅管理器,第 13 部分:系统目的
用于以前 RHN 用户的订阅管理器,第 13 部分:系统目的(或者我如何再次爱上订阅)。
什么是系统目的,以及我为什么应该关注它?
有多种方法来定义如何创建一个红帽订阅,但我们的团队(订阅管理体验团队)是这样定义的。
红帽将 技术 与以下内容相结合:
- 技术 用例信息(RHEL 用作服务器)
- 业务 用例信息(用于灾难恢复目的)
- 操作 用例信息(高级与标准,仅 L3 与 L1-L3)。
选择正确的订阅是将您需要的产品与上面定义的三种用法相匹配的问题,根据您需要的数量。定义很简单,可用于阐明每个红帽订阅中包含的内容。
在订阅体验中,我们多年来遇到的两个挑战是:
- 如何确保我得到了附加到系统的正确权利?
- 如何了解我在帐户级别的订阅利用率?
创建系统目的是通过允许管理员以简单的方式反映这些 技术、业务 和 操作 用例,来帮助解决这两个问题。
要求:
- Red Hat Satellite 6.5 或更新版本
- 红帽客户门户网站
- Red Hat Enterprise Linux 8.0+ 或 7.7+
系统目的是 subscription-manager 系列工具的一部分,还通过 redhat_subscription Ansible 模块、RHEL8 中的 Web 控制台、Satellite 以及 Red Hat Subscription Management 公开。
现在,我们了解了什么是系统目的,让我们深入了解如何使用它。
开始使用系统目的。
系统目的允许您设置如何使用系统的各种参数,这些参数是持久的,供订阅工具用于清单目的,并更好地指导系统进行合适的订阅。如果您有一种场景,其中"自动附加抓住了'错误的'订阅',则系统目的帮助解决这个问题。通过提供这些 技术、业务 和 操作 用例,订阅工具可以做出更明智的决策。
- ROLE - 系统上运行的工作负载是什么?
- 例如‘Red Hat Enterprise Linux Server’
- SLA - 期望的此系统的服务级别是什么?
- 例如自助支持、标准(工作时间)、高级
- USAGE - 此系统的支持范围是什么?
- 例如开发(设计协助)、生产(安装协助和运行时问题)
让我们介绍一下在新的 RHEL 8.3 系统上设置系统目的。

对于这个系统,我计划将其用作服务器,因此我选择 "Red Hat Enterprise Linux Server" 作为其 ROLE。我希望将此系统标记为 "Premium" 服务等级协议 - (SLA),我需要产品支持,因此我选择 "Production" 作为我的 USAGE。

在 RHEL 8.2 (及更新版本)中,您可以在安装过程中注册到 Red Hat Subscription Management,但对于此例,我们将跳过这一步。
登录后,我们来看一下安装过程中设置的系统用途,并注册系统。
首先,让我们看看各种可用的选项:
# syspurpose --help
usage: syspurpose [-h]
{set,unset,add,remove,set-role,unset-role,add-addons,remove-addons,unset-addons,set-sla,unset-sla,set-usage,unset-usage,show}
...
System Syspurpose Management Tool
positional arguments:
{set,unset,add,remove,set-role,unset-role,add-addons,remove-addons,unset-addons,set-sla,unset-sla,set-usage,unset-usage,show}
sub-command help
set Sets the value for the given property
unset Unsets (clears) the value for the given property
add Adds the value(s) to the given property
remove Removes the value(s) from the given property
set-role Set the system role to the system syspurpose
unset-role Clear set role
add-addons Add addons to the system syspurpose
remove-addons Remove addons from the system syspurpose
unset-addons Clear set addons
set-sla Set the system sla
unset-sla Clear set sla
set-usage Set the system usage
unset-usage Clear set usage
show Show the current system syspurpose
optional arguments:
-h, --help show this help message and exit
让我们确认在安装过程中设置的系统用途属性已被应用。
# syspurpose show
{
"role": "Red Hat Enterprise Linux Server",
"service_level_agreement": "Premium",
"usage": "Production"
}
有了定义的系统目的,让我们来注册系统
subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username:
Password:
The system has been registered with ID: f4cc3ae4-5077-4f33-a710-a3d374705183
The registered system name is: syspurpose.example.com
让我们来看看我帐户中的订阅
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat OpenShift Container Platform Broker/Master Infrastructure
Provides: dotNET on RHEL Beta (for RHEL Server)
Oracle Java (for RHEL Server)
Red Hat Software Collections (for RHEL Server)
Red Hat CodeReady Linux Builder for x86_64
Red Hat Ansible Engine
Red Hat OpenShift Enterprise Infrastructure
Red Hat Enterprise Linux Fast Datapath
Red Hat CloudForms
Red Hat Enterprise Linux Atomic Host
Red Hat Enterprise Linux Fast Datapath Beta for x86_64
Red Hat Beta
Red Hat Software Collections Beta (for RHEL Server)
Red Hat Enterprise Linux Server
Red Hat Enterprise Linux for x86_64
Red Hat Enterprise Linux for x86_64 - Extended Update Support
Red Hat OpenShift Container Platform
Red Hat OpenShift Service Mesh
Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
dotNET on RHEL (for RHEL Server)
Red Hat OpenShift Enterprise Client Tools
Red Hat CloudForms Beta
SKU: MCT2741
Contract:
Pool ID: 8a85f9926ed5daef016efae43853718e
Provides Management: Yes
Available: 88
Suggested: 1
Service Type: L1-L3
Roles:
Service Level: Layered
Usage:
Add-ons:
Subscription Type: Stackable
Starts: 12/12/2019
Ends: 12/11/2020
Entitlement Type: Physical
Subscription Name: Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)
Provides: dotNET on RHEL Beta (for RHEL Server)
Red Hat CodeReady Linux Builder for x86_64
Red Hat Ansible Engine
Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
Red Hat Container Images Beta
Red Hat Enterprise Linux Atomic Host Beta
Red Hat Container Images
Red Hat Beta
Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
dotNET on RHEL (for RHEL Server)
Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
Oracle Java (for RHEL Server)
Red Hat Software Collections (for RHEL Server)
Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
Oracle Java (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux Atomic Host
Red Hat Developer Tools (for RHEL Server)
Red Hat Software Collections Beta (for RHEL Server)
Red Hat Enterprise Linux Server
Red Hat Developer Tools Beta (for RHEL Server)
Red Hat Enterprise Linux for x86_64
Red Hat Enterprise Linux for x86_64 - Extended Update Support
Red Hat Developer Toolset (for RHEL Server)
Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
SKU: RH00003
Contract: 12166233
Pool ID: 8a85f99970d04f150171086a1c483ad5
Provides Management: No
Available: 28
Suggested: 0
Service Type: L1-L3
Roles: Red Hat Enterprise Linux Server
Service Level: Premium
Usage: Production
Add-ons:
Subscription Type: Instance Based
Starts: 03/23/2020
Ends: 03/22/2021
Entitlement Type: Physical
在此帐户中,您可以看到有两个订阅,突出显示的是每个订阅的系统目的参数(ROLE、SLA、USAGE)。除了系统事实(套接字、核、我是物理的或虚拟的,等等)之外,还使用了这些参数来指导系统的匹配的订阅。
现在,让我们附加一个订阅。当定义了系统目的时,与定义的目的属性匹配的订阅将强烈优先于其他订阅。
[root@syspurpose ~]# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status: Subscribed
并检查附加了哪个订阅。
subscription-manager list --consumed
+-------------------------------------------+
Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)
Provides: Red Hat CodeReady Linux Builder for x86_64
Red Hat Enterprise Linux Atomic Host
Red Hat Enterprise Linux Atomic Host Beta
Red Hat Developer Tools (for RHEL Server)
Red Hat Container Images
Red Hat Container Images Beta
Red Hat Developer Tools Beta (for RHEL Server)
Red Hat Developer Toolset (for RHEL Server)
Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux for x86_64
Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
Red Hat Enterprise Linux for x86_64 - Extended Update Support
dotNET on RHEL (for RHEL Server)
Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
dotNET on RHEL Beta (for RHEL Server)
Red Hat Beta
Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
Oracle Java (for RHEL Server)
Red Hat Software Collections (for RHEL Server)
Oracle Java (for RHEL Server) - Extended Update Support
Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
Red Hat Software Collections Beta (for RHEL Server)
Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
Red Hat Ansible Engine
Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux Server
SKU: RH00003
Contract: 12166233
Account: 5644938
Serial: 3955053163637465727
Pool ID: 8a85f99970d04f150171086a1c483ad5
Provides Management: No
Active: True
Quantity Used: 1
Service Type: L1-L3
Roles: Red Hat Enterprise Linux Server
Service Level: Premium
Usage: Production
Add-ons:
Status Details: Subscription is current
Subscription Type: Instance Based
Starts: 03/23/2020
Ends: 03/22/2021
Entitlement Type: Physical
请注意附加的订阅如何与系统目的属性匹配。我们可以通过 subscription-manager 进行确认。
subscription-manager status
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Current
System Purpose Status: Matched
如果您没有与您请求的系统目的属性匹配的订阅,则与您的系统事实和安装的产品匹配的订阅仍被附加到系统上。但是,系统的系统目的状态将设置为 Mismatched
让我们看看实际情况。
首先,删除任何附加的订阅:
subscription-manager remove --all
1 local certificate has been deleted.
1 subscription removed at the server.
接下来,让我们设置一个我的订阅都没有提供的 USAGE 值。在本例中,我将把我的 USAGE 设置为 "Development/Test",以表示我想要开发支持
syspurpose set-usage "Development/Test"
usage set to "Development/Test".
现在,重新)附加一个订阅。
subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status: Subscribed
让我们查看附加的订阅:
subscription-manager list --consumed
+-------------------------------------------+
Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)
Provides: Red Hat CodeReady Linux Builder for x86_64
Red Hat Enterprise Linux Atomic Host
Red Hat Enterprise Linux Atomic Host Beta
Red Hat Developer Tools (for RHEL Server)
Red Hat Container Images
Red Hat Container Images Beta
Red Hat Developer Tools Beta (for RHEL Server)
Red Hat Developer Toolset (for RHEL Server)
Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended
Update Support
Red Hat Enterprise Linux for x86_64
Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
Red Hat Enterprise Linux for x86_64 - Extended Update Support
dotNET on RHEL (for RHEL Server)
Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update
Support
dotNET on RHEL Beta (for RHEL Server)
Red Hat Beta
Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
Oracle Java (for RHEL Server)
Red Hat Software Collections (for RHEL Server)
Oracle Java (for RHEL Server) - Extended Update Support
Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
Red Hat Software Collections Beta (for RHEL Server)
Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
Red Hat Ansible Engine
Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux Server
SKU: RH00003
Contract: 12166233
Account: 5644938
Serial: 6080372749607279725
Pool ID: 8a85f99970d04f150171086a1c483ad5
Provides Management: No
Active: True
Quantity Used: 1
Service Type: L1-L3
Roles: Red Hat Enterprise Linux Server
Service Level: Premium
Usage: Production
Add-ons:
Status Details: Subscription is current
Subscription Type: Instance Based
Starts: 03/23/2020
Ends: 03/22/2021
Entitlement Type: Physical
虽然附加了相同的订阅,但让我们看看系统的订阅状态:
subscription-manager status
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Current
System Purpose Status: Mismatched
- The requested usage preference "Development/Test" is not provided by a currently consumed subscription.
因此,虽然系统有一个提供访问内容的有效订阅,但其系统目的状态被设置为 Mismatched,因为没有一个与系统目的首选项匹配的订阅。
这不仅在 CLI 工具中公开,还通过 RHSM 和 Satellite 中的 UI 公开

系统目的允许您提供有关如何使用系统来更好地将订阅工具指导到匹配订阅的更多信息。
系统订阅和 Subscription Watch:
除了在附加订阅域中提供的功能外,Subscription Watch 使用的系统目的数据还帮助我们的客户端了解其累计的订阅消费。
例如,在 Subscription Watch 中,通过 SLA 过滤的能力由在主机上设置的系统目的属性驱动(通过 CLI、Satellite 或 RHSM)。如果您想按 SLA 过滤(在未来的 USAGE、ROLE 和 SERVICE TYPE 中),则设置系统目的属性至关重要。

系统用途和简单内容访问
如果使用简单内容访问,则系统目的状态被设置为 disabled,因为在简单内容访问模式下,订阅没有附加到主机上。
subscription-manager status
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Disabled
Content Access Mode is set to Organization/Environment Access. This host has access to content, regardless of subscription status.
System Purpose Status: Disabled
虽然系统目的的"更好地将系统指导到匹配的订阅’部分未使用,但设置这些系统目的属性仍很重要,因为它们是发送到 Subscription Watch 的清单属性的一部分,并帮助您更好地理解对红帽技术的使用。
希望这篇文章能帮助您了解什么是系统目的,以及它如何帮助您改进订阅体验。
Comments