分配给主机或激活码的内容视图环境顺序决定了内容优先级。在主机注册过程中,激活码按存储的顺序分配内容视图环境。
hammer host update \
--content-view-environments "Library/cv1, dev/cv1" \
--name "server.example.com" \
--organization-id My_Organization_ID
$ hammer host update \
--content-view-environments "Library/cv1, dev/cv1" \
--name "server.example.com" \
--organization-id My_Organization_ID
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
这两个内容视图环境都包含 satellite-client-6-for-rhel-9-x86_64-rpms
存储库。以 root
用户身份登录,然后运行 subscription-manager repos
以检查主机上可用的存储库。输出反映了 Library/cv1
内容视图环境:
subscription-manager repos
# subscription-manager repos
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
这会生成以下输出:
+----------------------------------------------------------+
Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: satellite-client-6-for-rhel-9-x86_64-rpms
Repo Name: Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)
Repo URL: https://satellite.example.com/pulp/content/_My_Organization_/Library/cv1/content/dist/layered/rhel9/x86_64/_My_Product_/_My_Repository_ID_/os
Enabled: 0
+----------------------------------------------------------+
Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: satellite-client-6-for-rhel-9-x86_64-rpms
Repo Name: Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)
Repo URL: https://satellite.example.com/pulp/content/_My_Organization_/Library/cv1/content/dist/layered/rhel9/x86_64/_My_Product_/_My_Repository_ID_/os
Enabled: 0
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Repo URL
反映了 Library/cv1
内容视图环境,这意味着系统使用来自 Library/cv1
的内容,并忽略 dev/cv1
。
hammer host update \
--content-view-environments "dev/cv1,Library/cv1" \
--name "server.example.com" \
--organization-id My_Organization_ID
$ hammer host update \
--content-view-environments "dev/cv1,Library/cv1" \
--name "server.example.com" \
--organization-id My_Organization_ID
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
重新排序后,检查存储库再次显示 dev/cv1
内容视图环境:
subscription-manager repos
# subscription-manager repos
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
这会生成以下输出:
+----------------------------------------------------------+
Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: satellite-client-6-for-rhel-9-x86_64-rpms
Repo Name: Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)
Repo URL: https://satellite.example.com/pulp/content/_My_Organization_/Library/cv1/content/dist/layered/rhel9/x86_64/_My_Product_/_My_Repository_ID_/os
Enabled: 0
+----------------------------------------------------------+
Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: satellite-client-6-for-rhel-9-x86_64-rpms
Repo Name: Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)
Repo URL: https://satellite.example.com/pulp/content/_My_Organization_/Library/cv1/content/dist/layered/rhel9/x86_64/_My_Product_/_My_Repository_ID_/os
Enabled: 0
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Repo URL
现在反映 dev/cv1
内容视图环境,这意味着系统使用来自 dev/cv1
的内容,并忽略 Library/cv1
。