ผู้ประกอบการผู้อำนวยการ OSP สร้างชุดของคำจำกัดความทรัพยากรที่กำหนดเองด้านบนของ OpenShift เพื่อจัดการทรัพยากรที่สร้างขึ้นโดย UnderCloud ของ Tripleo CRD เหล่านี้แบ่งออกเป็นสองประเภทสำหรับการจัดเตรียมฮาร์ดแวร์และการกำหนดค่าซอฟต์แวร์
ผู้ให้บริการ OSP ได้รับการติดตั้งและจัดการผ่านตัวจัดการ Lifecycle Manager OLM OLM ถูกติดตั้งโดยอัตโนมัติด้วยการติดตั้ง OpenShift ของคุณ ในการรับสแน็ปช็อตผู้อำนวยการ OSP ผู้อำนวยการล่าสุดคุณต้องสร้างแคตตาล็อกที่เหมาะสมผู้ดำเนินการกลุ่มและการสมัครสมาชิกเพื่อขับเคลื่อนการติดตั้งด้วย OLM:
oc new-project openstack
apiVersion : operators.coreos.com/v1alpha1
kind : CatalogSource
metadata :
name : osp-director-operator-index
namespace : openstack
spec :
sourceType : grpc
image : quay.io/openstack-k8s-operators/osp-director-operator-index:0.0.1
apiVersion : operators.coreos.com/v1
kind : OperatorGroup
metadata :
name : " osp-director-operator-group "
namespace : openstack
spec :
targetNamespaces :
- openstack
apiVersion : operators.coreos.com/v1alpha1
kind : Subscription
metadata :
name : osp-director-operator-subscription
namespace : openstack
spec :
config :
env :
- name : WATCH_NAMESPACE
value : openstack,openshift-machine-api,openshift-sriov-network-operator
source : osp-director-operator-index
sourceNamespace : openstack
name : osp-director-operator
startingCSV : osp-director-operator.v0.0.1
channel : alpha
เรามีสคริปต์เพื่อทำการติดตั้งโดยอัตโนมัติที่นี่ด้วย OLM สำหรับแท็กเฉพาะ: สคริปต์เพื่อทำการติดตั้งโดยอัตโนมัติ
หมายเหตุ : ในบางจุดในอนาคตเราอาจรวมเข้ากับ OperatorHub เพื่อให้ OSP Director Operator พร้อมใช้งานโดยอัตโนมัติในการติดตั้ง OCP เริ่มต้นแหล่งที่มาของ OLM Catalog
สร้างปริมาณข้อมูลฐาน RHEL ก่อนที่จะปรับใช้ OpenStack สิ่งนี้จะถูกใช้โดยคอนโทรลเลอร์ VM ซึ่งจัดเตรียมผ่านการจำลองเสมือน OpenShift วิธีการทำเช่นนี้มีดังนี้:
virtctl
: sudo subscription-manager repos --enable=cnv-2.6-for-rhel-8-x86_64-rpms
sudo dnf install -y kubevirt-virtctl
curl -O http://download.devel.redhat.com/brewroot/packages/rhel-guest-image/8.4/1168/images/rhel-guest-image-8.4-1168.x86_64.qcow2
dnf install -y libguestfs-tools-c
virt-customize -a < rhel guest image > --run-command ' sed -i -e "s/^(kernelopts=.*)net.ifnames=0 (.*)/12/" /boot/grub2/grubenv '
virt-customize -a < rhel guest image > --run-command ' sed -i -e "s/^(GRUB_CMDLINE_LINUX=.*)net.ifnames=0 (.*)/12/" /etc/default/grub '
/etc/hosts
ของคุณ: <cluster ingress VIP> cdi-uploadproxy-openshift-cnv.apps.<cluster name>.<domain name>
virtctl
: virtctl image-upload dv openstack-base-img -n openstack --size=50Gi --image-path=<local path to image> --storage-class <desired storage class> --insecure
storage-class
ด้านบนเลือกอันที่คุณต้องการใช้จากที่แสดงใน: oc get storageclass
กำหนดทรัพยากรที่กำหนดเอง OpenStackNetConfig ของคุณ ต้องใช้เครือข่ายอย่างน้อยหนึ่งเครือข่ายสำหรับ ctlplane คุณสามารถกำหนดเครือข่ายหลายเครือข่ายใน CR เพื่อใช้กับสถาปัตยกรรมการแยกเครือข่ายของ Tripleo นอกเหนือจากการกำหนดเครือข่าย OpenStackNet ยังมีข้อมูลที่ใช้ในการกำหนดนโยบายการกำหนดค่าเครือข่ายที่ใช้ในการแนบ VM ใด ๆ กับเครือข่ายนี้ผ่านการจำลองเสมือน OpenShift ต่อไปนี้เป็นตัวอย่างของเครือข่าย IPv4 ctlplane ที่ใช้งานง่ายซึ่งใช้ Linux Bridge สำหรับการกำหนดค่าโฮสต์
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackNetConfig
metadata :
name : openstacknetconfig
spec :
attachConfigurations :
br-osp :
nodeNetworkConfigurationPolicy :
nodeSelector :
node-role.kubernetes.io/worker : " "
desiredState :
interfaces :
- bridge :
options :
stp :
enabled : false
port :
- name : enp7s0
description : Linux bridge with enp7s0 as a port
name : br-osp
state : up
type : linux-bridge
mtu : 1500
# optional DnsServers list
dnsServers :
- 192.168.25.1
# optional DnsSearchDomains list
dnsSearchDomains :
- osptest.test.metalkube.org
- some.other.domain
# DomainName of the OSP environment
domainName : osptest.test.metalkube.org
networks :
- name : Control
nameLower : ctlplane
subnets :
- name : ctlplane
ipv4 :
allocationEnd : 192.168.25.250
allocationStart : 192.168.25.100
cidr : 192.168.25.0/24
gateway : 192.168.25.1
attachConfiguration : br-osp
# optional: (OSP17 only) specify all phys networks with optional MAC address prefix, used to
# create static OVN Bridge MAC address mappings. Unique OVN bridge mac address per node is
# dynamically allocated by creating OpenStackMACAddress resource and create a MAC per physnet per node.
# - If PhysNetworks is not provided, the tripleo default physnet datacentre gets created.
# - If the macPrefix is not specified for a physnet, the default macPrefix "fa:16:3a" is used.
# - If PreserveReservations is not specified, the default is true.
ovnBridgeMacMappings :
preserveReservations : True
physNetworks :
- macPrefix : fa:16:3a
name : datacentre
- macPrefix : fa:16:3b
name : datacentre2
# optional: configure static mapping for the networks per nodes. If there is none, a random gets created
reservations :
controller-0 :
macReservations :
datacentre : fa:16:3a:aa:aa:aa
datacentre2 : fa:16:3b:aa:aa:aa
compute-0 :
macReservations :
datacentre : fa:16:3a:bb:bb:bb
datacentre2 : fa:16:3b:bb:bb:bb
หากคุณเขียน Yaml ด้านบนลงในไฟล์ที่เรียกว่า NetworkConfig.yaml คุณสามารถสร้าง OpenStackNetConfig ผ่านคำสั่งนี้:
oc create -n openstack -f networkconfig.yaml
หากต้องการใช้การแยกเครือข่ายโดยใช้ VLAN เพิ่ม VLAN ID ลงในข้อมูลจำเพาะของนิยามเครือข่าย
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackNetConfig
metadata :
name : openstacknetconfig
spec :
attachConfigurations :
br-osp :
nodeNetworkConfigurationPolicy :
nodeSelector :
node-role.kubernetes.io/worker : " "
desiredState :
interfaces :
- bridge :
options :
stp :
enabled : false
port :
- name : enp7s0
description : Linux bridge with enp7s0 as a port
name : br-osp
state : up
type : linux-bridge
mtu : 1500
br-ex :
nodeNetworkConfigurationPolicy :
nodeSelector :
node-role.kubernetes.io/worker : " "
desiredState :
interfaces :
- bridge :
options :
stp :
enabled : false
port :
- name : enp6s0
description : Linux bridge with enp6s0 as a port
name : br-ex-osp
state : up
type : linux-bridge
mtu : 1500
# optional DnsServers list
dnsServers :
- 192.168.25.1
# optional DnsSearchDomains list
dnsSearchDomains :
- osptest.test.metalkube.org
- some.other.domain
# DomainName of the OSP environment
domainName : osptest.test.metalkube.org
networks :
- name : Control
nameLower : ctlplane
subnets :
- name : ctlplane
ipv4 :
allocationEnd : 192.168.25.250
allocationStart : 192.168.25.100
cidr : 192.168.25.0/24
gateway : 192.168.25.1
attachConfiguration : br-osp
- name : InternalApi
nameLower : internal_api
mtu : 1350
subnets :
- name : internal_api
attachConfiguration : br-osp
vlan : 20
ipv4 :
allocationEnd : 172.17.0.250
allocationStart : 172.17.0.10
cidr : 172.17.0.0/24
- name : External
nameLower : external
subnets :
- name : external
ipv6 :
allocationEnd : 2001:db8:fd00:1000:ffff:ffff:ffff:fffe
allocationStart : 2001:db8:fd00:1000::10
cidr : 2001:db8:fd00:1000::/64
gateway : 2001:db8:fd00:1000::1
attachConfiguration : br-ex
- name : Storage
nameLower : storage
mtu : 1350
subnets :
- name : storage
ipv4 :
allocationEnd : 172.18.0.250
allocationStart : 172.18.0.10
cidr : 172.18.0.0/24
vlan : 30
attachConfiguration : br-osp
- name : StorageMgmt
nameLower : storage_mgmt
mtu : 1350
subnets :
- name : storage_mgmt
ipv4 :
allocationEnd : 172.19.0.250
allocationStart : 172.19.0.10
cidr : 172.19.0.0/24
vlan : 40
attachConfiguration : br-osp
- name : Tenant
nameLower : tenant
vip : False
mtu : 1350
subnets :
- name : tenant
ipv4 :
allocationEnd : 172.20.0.250
allocationStart : 172.20.0.10
cidr : 172.20.0.0/24
vlan : 50
attachConfiguration : br-osp
เมื่อใช้ VLAN สำหรับการแยกเครือข่ายด้วย Linux-Bridge
หมายเหตุ : หากต้องการใช้เฟรมจัมโบ้สำหรับบริดจ์ให้สร้างการกำหนดค่าสำหรับอุปกรณ์เพื่อกำหนดค่า Correnct MTU:
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackNetConfig
metadata :
name : openstacknetconfig
spec :
attachConfigurations :
br-osp :
nodeNetworkConfigurationPolicy :
nodeSelector :
node-role.kubernetes.io/worker : " "
desiredState :
interfaces :
- bridge :
options :
stp :
enabled : false
port :
- name : enp7s0
description : Linux bridge with enp7s0 as a port
name : br-osp
state : up
type : linux-bridge
mtu : 9000
- name : enp7s0
description : Configuring enp7s0 on workers
type : ethernet
state : up
mtu : 9000
สร้าง configmaps ซึ่งกำหนดสภาพแวดล้อมความร้อนที่กำหนดเองเทมเพลตความร้อนและไฟล์บทบาทที่กำหนดเอง (ชื่อต้องเป็น roles_data.yaml
) ที่ใช้สำหรับการกำหนดค่าเครือข่ายทริปเปิ้ล ไฟล์สภาพแวดล้อมความร้อนที่กำหนดไว้สามารถระบุได้ใน configmap และจะใช้เป็นแบบอนุสัญญาในขั้นตอนต่อไปที่ใช้ในการสร้างสแต็กความร้อนสำหรับการปรับใช้ overcloud ในการประชุมการติดตั้งผู้อำนวยการ OSP แต่ละคนจะใช้ 2 configmaps ชื่อ heat-env-config
และ tripleo-tarball-config
เพื่อให้ข้อมูลนี้ configmap heat-env-config
มีไฟล์สภาพแวดล้อมการปรับใช้ทั้งหมดที่แต่ละไฟล์ได้รับการเพิ่มเป็น -e file.yaml
ไปยังคำสั่ง openstack stack create
ตัวอย่างที่ดีคือ:
"แผนที่ config tarball" สามารถใช้เพื่อให้ (ไบนารี) tarballs ซึ่งสกัดใน tripleo-heat-templates เมื่อสร้าง playbooks Tarball แต่ละตัวควรมีไดเรกทอรีของไฟล์ที่สัมพันธ์กับรูทของไดเรกทอรี tht คุณจะต้องจัดเก็บสิ่งต่าง ๆ เช่นตัวอย่างต่อไปนี้ในแผนที่กำหนดค่าที่มี tarballs ที่กำหนดเอง:
ไฟล์ net-config
สิ่งแวดล้อมสุทธิ
หมายเหตุ : ไฟล์ net-config สำหรับเครื่องเสมือนที่ถูกสร้างขึ้นโดยผู้ให้บริการ แต่สามารถเขียนทับโดยใช้ "แผนที่ config tarball" ในการเขียนทับ Net-config ที่แสดงผลล่วงหน้าให้ใช้ <role lowercase>-nic-template.yaml
ชื่อไฟล์สำหรับ osp16.2 หรือ <role lowercase>-nic-template.j2
สำหรับ osp17 หมายเหตุ : ชื่ออินเทอร์เฟซเครือข่ายสำหรับ VM ที่สร้างขึ้นโดยคอนโทรลเลอร์ OpenStackVMSET ได้รับการสั่งซื้อตามตัวอักษรโดยชื่อเครือข่ายที่กำหนดให้กับบทบาท VM ข้อยกเว้นคืออินเทอร์เฟซเครือข่าย default
ของ VM POD ซึ่งจะเป็นอินเทอร์เฟซแรกเสมอ ส่วนที่เป็นผลลัพธ์ที่ได้ของนิยามเครื่องเสมือนจริงจะมีลักษณะเช่นนี้:
interfaces :
- masquerade : {}
model : virtio
name : default
- bridge : {}
model : virtio
name : ctlplane
- bridge : {}
model : virtio
name : external
- bridge : {}
model : virtio
name : internalapi
- bridge : {}
model : virtio
name : storage
- bridge : {}
model : virtio
name : storagemgmt
- bridge : {}
model : virtio
name : tenant
ด้วยสิ่งนี้อินเตอร์เฟส ctlplane คือ NIC2, NIC3 ภายนอก, ... และอื่น ๆ
หมายเหตุ : ทราฟฟิก FIP ไม่ผ่านไปยังเครือข่ายผู้เช่า VLAN ด้วย ML2/OVN และ DVR DVR เปิดใช้งานโดยค่าเริ่มต้น หากคุณต้องการเครือข่ายผู้เช่า VLAN ด้วย OVN คุณสามารถปิดการใช้งาน DVR ในการปิดใช้งาน DVR ให้รวมบรรทัดต่อไปนี้ในไฟล์สภาพแวดล้อม:
parameter_defaults :
NeutronEnableDVR : false
การสนับสนุนสำหรับ "การรับส่งข้อมูล VLAN แบบกระจายใน OVN" กำลังถูกติดตามในการจัดการที่อยู่ MAC สำหรับ "เพิ่มการสนับสนุนใน Tripleo สำหรับการรับส่งข้อมูล VLAN แบบกระจายใน OVN" (https://bugs.launchpad.net/tripleo/+bug/1881593)
[Git repo config map] configmap นี้มีคีย์ SSH และ URL สำหรับ GIT repo ที่ใช้ในการจัดเก็บ playbooks ที่สร้างขึ้น (ด้านล่าง)
เมื่อคุณปรับแต่งเทมเพลต/ตัวอย่างข้างต้นสำหรับสภาพแวดล้อมของคุณแล้วคุณสามารถสร้าง configmaps สำหรับทั้ง '' heat-env-config 'และ' tripleo-tarball-config '(tarballs) configmaps โดยใช้คำสั่งตัวอย่างเหล่านี้ในไฟล์ที่มีแต่ละประเภทกำหนดค่าตามลำดับ (หนึ่งไดเรกทอรีสำหรับ configmap แต่ละประเภท):
# create the configmap for heat-env-config
oc create configmap -n openstack heat-env-config --from-file=heat-env-config/ --dry-run=client -o yaml | oc apply -f -
# create the configmap containing a tarball of t-h-t network config files. NOTE: these files may overwrite default t-h-t files so keep this in mind when naming them.
cd < dir with net config files >
tar -cvzf net-config.tar.gz * .yaml
oc create configmap -n openstack tripleo-tarball-config --from-file=tarball-config.tar.gz
# create the Git secret used for the repo where Ansible playbooks are stored
oc create secret generic git-secret -n openstack --from-file=git_ssh_identity= < path to git id_rsa > --from-literal=git_url= < your git server URL (git@...) >
(ไม่บังคับ) สร้างความลับสำหรับ OpenStackControlplane ของคุณ ความลับนี้จะให้รหัสผ่านเริ่มต้นสำหรับเครื่องเสมือนและโฮสต์ Baremetal ของคุณ หากไม่มีความลับให้คุณจะสามารถเข้าสู่ระบบด้วยคีย์ SSH ที่กำหนดไว้ในความลับของ OSP-Controlplane-Ssh-Keys
apiVersion : v1
kind : Secret
metadata :
name : userpassword
namespace : openstack
data :
# 12345678
NodeRootPassword : MTIzNDU2Nzg=
หากคุณเขียน Yaml ข้างต้นลงในไฟล์ที่เรียกว่า ctlplane-secret.yaml คุณสามารถสร้างความลับผ่านคำสั่งนี้:
oc create -n openstack -f ctlplane-secret.yaml
กำหนดทรัพยากรที่กำหนดเอง OpenStackControlplane ของคุณ ทรัพยากรที่กำหนดเอง OpenStackControlplane เป็นสถานที่สำคัญในการสร้างและปรับขนาด VM ที่ใช้สำหรับคอนโทรลเลอร์ OSP พร้อมกับ VMSET เพิ่มเติมใด ๆ สำหรับการปรับใช้ของคุณ ต้องใช้ VM คอนโทรลเลอร์อย่างน้อย 1 ตัวสำหรับการติดตั้งตัวอย่างพื้นฐานและแนะนำแนวทางความพร้อมใช้งานสูงของ OSP 3 คอนโทรลเลอร์ VM
หมายเหตุ : หากใช้ Rhel-Guest-Image เป็นฐานในการปรับใช้เครื่องเสมือน OpenStackControlplane ตรวจสอบให้แน่ใจว่าได้ลบพารามิเตอร์ net.ifnames = 0 เคอร์เนลจากภาพเพื่อให้การตั้งชื่ออินเทอร์เฟซเครือข่าย BIOSDEV สามารถทำได้เช่น:
dnf install -y libguestfs-tools-c
virt-customize -a bms-image.qcow2 --run-command ' sed -i -e "s/^(kernelopts=.*)net.ifnames=0 (.*)/12/" /boot/grub2/grubenv '
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackControlPlane
metadata :
name : overcloud
namespace : openstack
spec :
openStackClientImageURL : quay.io/openstack-k8s-operators/rhosp16-openstack-tripleoclient:16.2_20210713.1
openStackClientNetworks :
- ctlplane
- external
- internalapi
# openStackClientStorageClass must support RWX
# https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
openStackClientStorageClass : host-nfs-storageclass
passwordSecret : userpassword
gitSecret : git-secret
virtualMachineRoles :
controller :
roleName : Controller
roleCount : 3
networks :
- ctlplane
- internalapi
- external
- tenant
- storage
- storagemgmt
cores : 6
memory : 12
rootDisk :
diskSize : 50
baseImageVolumeName : openstack-base-img
# storageClass must support RWX to be able to live migrate VMs
storageClass : host-nfs-storageclass
storageAccessMode : ReadWriteMany
# When using OpenShift Virtualization with OpenShift Container Platform Container Storage,
# specify RBD block mode persistent volume claims (PVCs) when creating virtual machine disks. With virtual machine disks,
# RBD block mode volumes are more efficient and provide better performance than Ceph FS or RBD filesystem-mode PVCs.
# To specify RBD block mode PVCs, use the 'ocs-storagecluster-ceph-rbd' storage class and VolumeMode: Block.
storageVolumeMode : Filesystem
# Optional
# DedicatedIOThread - Disks with dedicatedIOThread set to true will be allocated an exclusive thread.
# This is generally useful if a specific Disk is expected to have heavy I/O traffic, e.g. a database spindle.
dedicatedIOThread : false
additionalDisks :
# name must be uniqe and must not be rootDisk
- name : dataDisk1
diskSize : 100
storageClass : host-nfs-storageclass
storageAccessMode : ReadWriteMany
storageVolumeMode : Filesystem
# Optional block storage settings
# IOThreadsPolicy - IO thread policy for the domain. Currently valid policies are shared and auto.
# However, if any disk requests a dedicated IOThread, ioThreadsPolicy will be enabled and default to shared.
# When ioThreadsPolicy is set to auto IOThreads will also be "isolated" from the vCPUs and placed on the same physical CPU as the QEMU emulator thread.
# An ioThreadsPolicy of shared indicates that KubeVirt should use one thread that will be shared by all disk devices.
ioThreadsPolicy : auto
# Block Multi-Queue is a framework for the Linux block layer that maps Device I/O queries to multiple queues.
# This splits I/O processing up across multiple threads, and therefor multiple CPUs. libvirt recommends that the
# number of queues used should match the number of CPUs allocated for optimal performance.
blockMultiQueue : false
หากคุณเขียน Yaml ด้านบนลงในไฟล์ที่เรียกว่า OpenStackControlplane.yaml คุณสามารถสร้าง OpenStackControlplane ผ่านคำสั่งนี้:
oc create -f openstackcontrolplane.yaml
หมายเหตุ VMS ภายใน VMSET เดียวกัน (บทบาท VM) ได้รับการกระจายไปทั่วโหนดผู้ปฏิบัติงานที่มีอยู่โดยใช้กฎต่อต้าน Affinity POD ด้วยสิ่งนี้ยังคงเป็นไปได้ที่ VM หลายตัวของบทบาทจะจบลงที่โหนดคนงานเดียวกันหากไม่มีทรัพยากรอื่น ๆ (เช่นการรีบูตคนงานในระหว่างการอัปเดต) ไม่มีการโยกย้ายสดอัตโนมัติเกิดขึ้นหากโหนดเกิดขึ้นหลังจากการบำรุงรักษา/รีบูต ในการร้องขอการกำหนดเวลาถัดไป VM จะถูกย้ายอีกครั้ง
กำหนด OpenStackBaremetAlset เพื่อขยายการคำนวณโฮสต์ OSP ทรัพยากร OpenStackBaremetal สามารถใช้ในการกำหนดและปรับขนาดทรัพยากรการคำนวณและใช้เป็นทางเลือกในการกำหนดและปรับขนาดโฮสต์ Baremetal สำหรับบทบาทสามประเภทอื่น ๆ ตัวอย่างด้านล่างกำหนดโฮสต์การคำนวณเดียวที่จะสร้าง
หมายเหตุ : หากใช้ภาพ Rhel-Guest-Image เป็นฐานในการปรับใช้โหนดการคำนวณ OpenStackBaremetAlset ตรวจสอบให้แน่ใจว่าได้ลบพารามิเตอร์ NET.IFNAME = 0 KERNEL จากภาพเพื่อให้มีการตั้งชื่ออินเทอร์เฟซเครือข่าย BIOSDEV สามารถทำได้เช่น:
dnf install -y libguestfs-tools-c
virt-customize -a bms-image.qcow2 --run-command ' sed -i -e "s/^(kernelopts=.*)net.ifnames=0 (.*)/12/" /boot/grub2/grubenv '
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackBaremetalSet
metadata :
name : compute
namespace : openstack
spec :
# How many nodes to provision
count : 1
# The image to install on the provisioned nodes. NOTE: needs to be accessible on the OpenShift Metal3 provisioning network.
baseImageUrl : http://host/images/rhel-image-8.4.x86_64.qcow2
# NOTE: these are automatically created via the OpenStackControlplane CR above
deploymentSSHSecret : osp-controlplane-ssh-keys
# The interface on the nodes that will be assigned an IP from the mgmtCidr
ctlplaneInterface : enp7s0
# Networks to associate with this host
networks :
- ctlplane
- internalapi
- tenant
- storage
roleName : Compute
passwordSecret : userpassword
หากคุณเขียน Yaml ด้านบนลงในไฟล์ที่เรียกว่า compute.yaml คุณสามารถสร้าง OpenStackBaremetAlset ผ่านคำสั่งนี้:
oc create -f compute.yaml
การลงทะเบียนโหนด (ลงทะเบียนระบบ overcloud ไปยังช่องทางที่ต้องการ)
รอให้ทรัพยากรข้างต้นเสร็จสิ้นการปรับใช้ (คำนวณและควบคุม) เมื่อทรัพยากรเสร็จสิ้นการปรับใช้ให้ดำเนินการลงทะเบียนโหนด
ใช้ขั้นตอนตามที่อธิบายไว้ใน 5.9 การลงทะเบียนที่ใช้ ANSIBLE ทำด้วยตนเองทำเช่นนั้น
หมายเหตุ: เราขอแนะนำให้ใช้การลงทะเบียนด้วยตนเองเนื่องจากใช้งานได้โดยไม่คำนึงถึงตัวเลือกภาพพื้นฐาน หากคุณใช้ overcloud-full เป็นอิมเมจการปรับใช้พื้นฐานของคุณการลงทะเบียน RHSM อัตโนมัติสามารถใช้ผ่านบทบาท/ไฟล์สภาพแวดล้อม Tht rhsm.yaml เป็นทางเลือกแทนวิธีนี้
oc rsh openstackclient
bash
cd /home/cloud-admin
< create the ansible playbook for the overcloud nodes - e.g. rhsm.yaml >
# register the overcloud nodes to required repositories
ansible-playbook -i /home/cloud-admin/ctlplane-ansible-inventory ./rhsm.yaml
(ไม่บังคับ) สร้างไฟล์บทบาท A) ใช้ OpenStackClient Pod เพื่อสร้างไฟล์บทบาทที่กำหนดเอง
oc rsh openstackclient
unset OS_CLOUD
cd /home/cloud-admin/
openstack overcloud roles generate Controller ComputeHCI > roles_data.yaml
exit
b) คัดลอกไฟล์บทบาทที่กำหนดเองออกจาก OpenStackClient Pod
oc cp openstackclient:/home/cloud-admin/roles_data.yaml roles_data.yaml
อัปเดต tarballConfigMap
configmap เพื่อเพิ่มไฟล์ roles_data.yaml
ไปยัง Tarball และอัปเดต configmap
หมายเหตุ : ตรวจสอบให้แน่ใจว่าใช้ roles_data.yaml
เป็นชื่อไฟล์
กำหนด OpenStackConfigGenerator เพื่อสร้าง playbooks ansible สำหรับการปรับใช้คลัสเตอร์ OSP
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackConfigGenerator
metadata :
name : default
namespace : openstack
spec :
enableFencing : False
imageURL : quay.io/openstack-k8s-operators/rhosp16-openstack-tripleoclient:16.2_20210713.1
gitSecret : git-secret
heatEnvConfigMap : heat-env-config
tarballConfigMap : tripleo-tarball-config
# (optional) for debugging it is possible to set the interactive mode.
# In this mode the playbooks won't get rendered automatically. Just the environment to start the rendering gets created
# interactive: true
# (optional) provide custom registry or specific container versions via the ephemeralHeatSettings
# ephemeralHeatSettings:
# heatAPIImageURL: quay.io/tripleotraincentos8/centos-binary-heat-api:current-tripleo
# heatEngineImageURL: quay.io/tripleotraincentos8/centos-binary-heat-engine:current-tripleo
# mariadbImageURL: quay.io/tripleotraincentos8/centos-binary-mariadb:current-tripleo
# rabbitImageURL: quay.io/tripleotraincentos8/centos-binary-rabbitmq:current-tripleo
หากคุณเขียน Yaml ด้านบนลงในไฟล์ที่เรียกว่า Generator.yaml คุณสามารถสร้าง OpenStackConfigGenerator ผ่านคำสั่งนี้:
oc create -f generator.yaml
Osconfiggenerator ที่สร้างขึ้นด้านบนจะสร้าง playbooks โดยอัตโนมัติเมื่อใดก็ตามที่คุณปรับขนาดหรือแก้ไข configmaps สำหรับการปรับใช้ OSP ของคุณ การสร้าง playbooks เหล่านี้ใช้เวลาหลายนาที คุณสามารถตรวจสอบเงื่อนไขสถานะของ Osconfiggenerator เพื่อให้เสร็จสิ้น
รับ Osconfigversion ล่าสุด (Ansible Playbooks) เลือกแฮช/ย่อยของ Osconfigversion ล่าสุดสำหรับใช้ในขั้นตอนต่อไป
oc get -n openstack --sort-by {.metadata.creationTimestamp} osconfigversions -o json
หมายเหตุ: Osconfigversion Objects ยังมีแอตทริบิวต์ 'git diff' ที่สามารถใช้เพื่อเปรียบเทียบการเปลี่ยนแปลงระหว่างรุ่น playbook ansible ได้อย่างง่ายดาย
สร้าง OsDeploy (ดำเนินการ playbooks ansible)
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackDeploy
metadata :
name : default
spec :
configVersion : n5fch96h548h75hf4hbdhb8hfdh676h57bh96h5c5h59hf4h88h...
configGenerator : default
หากคุณเขียน Yaml ด้านบนลงในไฟล์ที่เรียกว่า deploy.yaml คุณสามารถสร้าง OpenStackDeploy ผ่านคำสั่งนี้:
oc create -f deploy.yaml
เมื่อการปรับใช้ทำงานมันจะสร้างงาน Kubernetes เพื่อดำเนินการ playbooks Ansible คุณสามารถส่งบันทึกของงาน/พ็อดนี้เพื่อดู playbooks ansible นอกจากนี้คุณสามารถเข้าถึง playbooks Ansible ที่ดำเนินการด้วยตนเองโดยลงชื่อเข้าใช้ Pod 'OpenStackClient' ซึ่งจะเข้าสู่/Home/Cloud-Admin/Work // Directory ที่นั่นคุณจะพบ playbooks ansible พร้อมกับไฟล์ ansible.log สำหรับการปรับใช้
มีความเป็นไปได้ที่จะปรับใช้โครงสร้างพื้นฐานที่มีการแปลงสูงของ Tripleo ซึ่งโหนดการคำนวณยังทำหน้าที่เป็นโหนด Ceph OSD เวิร์กโฟลว์ในการติดตั้ง Ceph ผ่าน Tripleo จะเป็น:
ตรวจสอบให้แน่ใจว่าใช้ quay.io/openstack-k8s-operators/rhosp16-openstack-tripleoclient:16.2_20210521.1
หรือใหม่กว่าสำหรับ OpenStackClient openStackClientImageURL
มีโหนดการคำนวณที่มีดิสก์พิเศษที่จะใช้เป็น OSD และสร้าง baremetalset สำหรับบทบาท ComputeHCI ซึ่งมีเครือข่าย StorAgemGMT นอกเหนือจากเครือข่ายการคำนวณเริ่มต้นและพารามิเตอร์ IsHCI
ที่ตั้งไว้เป็น TRUE
หมายเหตุ : หากใช้ภาพ Rhel-Guest-Image เป็นฐานในการปรับใช้โหนดการคำนวณ OpenStackBaremetAlset ตรวจสอบให้แน่ใจว่าได้ลบ net.ifnames = 0 พารามิเตอร์เคอร์เนลแบบฟอร์มภาพเพื่อให้การตั้งชื่ออินเทอร์เฟซเครือข่าย BIOSDEV สามารถทำได้เช่น:
dnf install -y libguestfs-tools-c
virt-customize -a bms-image.qcow2 --run-command ' sed -i -e "s/^(kernelopts=.*)net.ifnames=0 (.*)/12/" /boot/grub2/grubenv '
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackBaremetalSet
metadata :
name : computehci
namespace : openstack
spec :
# How many nodes to provision
replicas : 2
# The image to install on the provisioned nodes
baseImageUrl : http://host/images/rhel-image-8.4.x86_64.qcow2
# The secret containing the SSH pub key to place on the provisioned nodes
deploymentSSHSecret : osp-controlplane-ssh-keys
# The interface on the nodes that will be assigned an IP from the mgmtCidr
ctlplaneInterface : enp7s0
# Networks to associate with this host
networks :
- ctlplane
- internalapi
- tenant
- storage
- storagemgmt
roleName : ComputeHCI
passwordSecret : userpassword
Deploying OpenStack once you have the OSP Director Operator installed
ซึ่งรวมถึงบทบาทของ ComputeHCI/usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible.yaml
และการปรับ storage-backend.yaml
อื่น ๆ เพื่อปรับแต่ง configmap ที่กำหนดเอง resource_registry :
OS::TripleO::Services::CephMgr : deployment/ceph-ansible/ceph-mgr.yaml
OS::TripleO::Services::CephMon : deployment/ceph-ansible/ceph-mon.yaml
OS::TripleO::Services::CephOSD : deployment/ceph-ansible/ceph-osd.yaml
OS::TripleO::Services::CephClient : deployment/ceph-ansible/ceph-client.yaml
parameter_defaults :
# needed for now because of the repo used to create tripleo-deploy image
CephAnsibleRepo : " rhelosp-ceph-4-tools "
CephAnsiblePlaybookVerbosity : 3
CinderEnableIscsiBackend : false
CinderEnableRbdBackend : true
CinderBackupBackend : ceph
CinderEnableNfsBackend : false
NovaEnableRbdBackend : true
GlanceBackend : rbd
CinderRbdPoolName : " volumes "
NovaRbdPoolName : " vms "
GlanceRbdPoolName : " images "
CephPoolDefaultPgNum : 32
CephPoolDefaultSize : 2
CephAnsibleDisksConfig :
devices :
- ' /dev/sdb '
- ' /dev/sdc '
- ' /dev/sdd '
osd_scenario : lvm
osd_objectstore : bluestore
CephAnsibleExtraConfig :
is_hci : true
CephConfigOverrides :
rgw_swift_enforce_content_length : true
rgw_swift_versioning_enabled : true
เมื่อคุณปรับแต่งเทมเพลต/ตัวอย่างข้างต้นสำหรับสภาพแวดล้อมของคุณแล้วให้สร้าง/อัปเดตการกำหนดค่าการกำหนดค่าเช่นอธิบายใน Deploying OpenStack once you have the OSP Director Operator installed
Deploying OpenStack once you have the OSP Director Operator installed
และระบุบทบาทที่สร้างบทบาท หมายเหตุ : ตรวจสอบให้แน่ใจว่าใช้ quay.io/openstack-k8s-operators/rhosp16-openstack-tripleoclient:16.2_20210521.1
หรือใหม่กว่าสำหรับ Osconfiggenerator imageURL
รอให้ OpenStackConfigGenerator เสร็จสิ้นงานแสดงผล Playbook
รับแฮช/ย่อยของ OpenStackConfigversion ล่าสุด
สร้าง OpenStackDeploy สำหรับ OpenStackConfigversion ที่ระบุ สิ่งนี้จะปรับใช้ Playbooks Ansible
การลบโฮสต์การคำนวณ Baremetal ต้องใช้ขั้นตอนต่อไปนี้:
ในกรณีที่มีการลบโหนดการคำนวณให้ปิดการใช้งานบริการคำนวณบนโหนดขาออกบน overcloud เพื่อป้องกันไม่จากการกำหนดเวลาอินสแตนซ์ใหม่
openstack compute service list
openstack compute service set < hostname > nova-compute --disable
คำอธิบายประกอบของทรัพยากร BMH
oc annotate -n openshift-machine-api bmh/openshift-worker-3 osp-director.openstack.org/delete-host=true --overwrite
สถานะคำอธิบายประกอบจะสะท้อนให้เห็นใน OsBaremetalset/OSVMSET โดยใช้พารามิเตอร์ annotatedForDeletion
:
oc get osbms computehci -o json | jq .status
{
" baremetalHosts " : {
" computehci-0 " : {
" annotatedForDeletion " : true,
" ctlplaneIP " : " 192.168.25.105/24 " ,
" hostRef " : " openshift-worker-3 " ,
" hostname " : " computehci-0 " ,
" networkDataSecretName " : " computehci-cloudinit-networkdata-openshift-worker-3 " ,
" provisioningState " : " provisioned " ,
" userDataSecretName " : " computehci-cloudinit-userdata-openshift-worker-3 "
},
" computehci-1 " : {
" annotatedForDeletion " : false,
" ctlplaneIP " : " 192.168.25.106/24 " ,
" hostRef " : " openshift-worker-4 " ,
" hostname " : " computehci-1 " ,
" networkDataSecretName " : " computehci-cloudinit-networkdata-openshift-worker-4 " ,
" provisioningState " : " provisioned " ,
" userDataSecretName " : " computehci-cloudinit-userdata-openshift-worker-4 "
}
},
" provisioningStatus " : {
" readyCount " : 2,
" reason " : " All requested BaremetalHosts have been provisioned " ,
" state " : " provisioned "
}
}
การลดจำนวนทรัพยากรของ Osbaremetalset จะทำให้คอนโทรลเลอร์ corrensponding เพื่อจัดการการลบทรัพยากร
oc patch osbms computehci --type=merge --patch ' {"spec":{"count":1}} '
เป็นผลให้:
oc get osnet ctlplane -o json | jq .status.roleReservations.ComputeHCI
{
" addToPredictableIPs " : true,
" reservations " : [
{
" deleted " : true,
" hostname " : " computehci-0 " ,
" ip " : " 192.168.25.105 " ,
" vip " : false
},
{
" deleted " : false,
" hostname " : " computehci-1 " ,
" ip " : " 192.168.25.106 " ,
" vip " : false
}
]
}
สิ่งนี้ส่งผลให้เกิดพฤติกรรมต่อไปนี้
ตอนนี้หากมีการลบโหนดการคำนวณมีหลายรายการที่เหลือลงทะเบียนบนเครื่องบินควบคุม OpenStack และไม่ได้รับการทำความสะอาดโดยอัตโนมัติ หากต้องการทำความสะอาดให้ทำตามขั้นตอนต่อไปนี้
openstack compute service list
openstack compute service delete < service-id >
openstack network agent list
for AGENT in $( openstack network agent list --host < scaled-down-node > -c ID -f value ) ; do openstack network agent delete $AGENT ; done
การลบ VM ต้องใช้ขั้นตอนต่อไปนี้:
หาก VM โฮสต์บริการ OSP ใด ๆ ที่ควรปิดการใช้งานก่อนการลบให้ทำเช่นนั้น
คำอธิบายประกอบของทรัพยากร VM
oc annotate -n openstack vm/controller-1 osp-director.openstack.org/delete-host=true --overwrite
การลดทรัพยากร rolecount ของ virtualmachineroles ใน cr openstackcontrolplane ตัวควบคุม corrensponding เพื่อจัดการการลบทรัพยากร
oc patch osctlplane overcloud --type=merge --patch ' {"spec":{"virtualMachineRoles":{"<RoleName>":{"roleCount":2}}}} '
เป็นผลให้:
สิ่งนี้ส่งผลให้เกิดพฤติกรรมต่อไปนี้
หาก VM ทำโฮสต์บริการ OSP ใด ๆ ที่ควรลบออกให้ลบบริการโดยใช้คำสั่ง OpenStack ที่เกี่ยวข้อง
เป็นไปได้ที่จะปรับใช้สถาปัตยกรรมเครือข่ายที่กำหนดเส้นทางของ Tripleo (Networking Spine/LEAF) เพื่อกำหนดค่าเครือข่าย Leaf Overcloud ใช้พารามิเตอร์ย่อยเพื่อกำหนดเครือข่ายย่อยใบเพิ่มเติมด้วยเครือข่ายฐาน
ข้อ จำกัด ในขณะนี้คือสามารถมีเครือข่ายบทบัญญัติเดียวสำหรับ Metal3
เวิร์กโฟลว์ในการติดตั้ง overcloud โดยใช้หลายเครือข่ายย่อยจะเป็น:
กำหนดทรัพยากรที่กำหนดเอง OpenStackNetConfig ของคุณและระบุเครือข่ายย่อยทั้งหมดสำหรับเครือข่าย overcloud ผู้ประกอบการจะแสดงผล tripleo network_data.yaml สำหรับการเปิดตัว OSP ที่ใช้แล้ว
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackNetConfig
metadata :
name : openstacknetconfig
spec :
attachConfigurations :
br-osp :
nodeNetworkConfigurationPolicy :
nodeSelector :
node-role.kubernetes.io/worker : " "
desiredState :
interfaces :
- bridge :
options :
stp :
enabled : false
port :
- name : enp7s0
description : Linux bridge with enp7s0 as a port
name : br-osp
state : up
type : linux-bridge
mtu : 1500
br-ex :
nodeNetworkConfigurationPolicy :
nodeSelector :
node-role.kubernetes.io/worker : " "
desiredState :
interfaces :
- bridge :
options :
stp :
enabled : false
port :
- name : enp6s0
description : Linux bridge with enp6s0 as a port
name : br-ex-osp
state : up
type : linux-bridge
mtu : 1500
# optional DnsServers list
dnsServers :
- 192.168.25.1
# optional DnsSearchDomains list
dnsSearchDomains :
- osptest.test.metalkube.org
- some.other.domain
# DomainName of the OSP environment
domainName : osptest.test.metalkube.org
networks :
- name : Control
nameLower : ctlplane
subnets :
- name : ctlplane
ipv4 :
allocationEnd : 192.168.25.250
allocationStart : 192.168.25.100
cidr : 192.168.25.0/24
gateway : 192.168.25.1
attachConfiguration : br-osp
- name : InternalApi
nameLower : internal_api
mtu : 1350
subnets :
- name : internal_api
ipv4 :
allocationEnd : 172.17.0.250
allocationStart : 172.17.0.10
cidr : 172.17.0.0/24
routes :
- destination : 172.17.1.0/24
nexthop : 172.17.0.1
- destination : 172.17.2.0/24
nexthop : 172.17.0.1
vlan : 20
attachConfiguration : br-osp
- name : internal_api_leaf1
ipv4 :
allocationEnd : 172.17.1.250
allocationStart : 172.17.1.10
cidr : 172.17.1.0/24
routes :
- destination : 172.17.0.0/24
nexthop : 172.17.1.1
- destination : 172.17.2.0/24
nexthop : 172.17.1.1
vlan : 21
attachConfiguration : br-osp
- name : internal_api_leaf2
ipv4 :
allocationEnd : 172.17.2.250
allocationStart : 172.17.2.10
cidr : 172.17.2.0/24
routes :
- destination : 172.17.1.0/24
nexthop : 172.17.2.1
- destination : 172.17.0.0/24
nexthop : 172.17.2.1
vlan : 22
attachConfiguration : br-osp
- name : External
nameLower : external
subnets :
- name : external
ipv4 :
allocationEnd : 10.0.0.250
allocationStart : 10.0.0.10
cidr : 10.0.0.0/24
gateway : 10.0.0.1
attachConfiguration : br-ex
- name : Storage
nameLower : storage
mtu : 1350
subnets :
- name : storage
ipv4 :
allocationEnd : 172.18.0.250
allocationStart : 172.18.0.10
cidr : 172.18.0.0/24
routes :
- destination : 172.18.1.0/24
nexthop : 172.18.0.1
- destination : 172.18.2.0/24
nexthop : 172.18.0.1
vlan : 30
attachConfiguration : br-osp
- name : storage_leaf1
ipv4 :
allocationEnd : 172.18.1.250
allocationStart : 172.18.1.10
cidr : 172.18.1.0/24
routes :
- destination : 172.18.0.0/24
nexthop : 172.18.1.1
- destination : 172.18.2.0/24
nexthop : 172.18.1.1
vlan : 31
attachConfiguration : br-osp
- name : storage_leaf2
ipv4 :
allocationEnd : 172.18.2.250
allocationStart : 172.18.2.10
cidr : 172.18.2.0/24
routes :
- destination : 172.18.0.0/24
nexthop : 172.18.2.1
- destination : 172.18.1.0/24
nexthop : 172.18.2.1
vlan : 32
attachConfiguration : br-osp
- name : StorageMgmt
nameLower : storage_mgmt
mtu : 1350
subnets :
- name : storage_mgmt
ipv4 :
allocationEnd : 172.19.0.250
allocationStart : 172.19.0.10
cidr : 172.19.0.0/24
routes :
- destination : 172.19.1.0/24
nexthop : 172.19.0.1
- destination : 172.19.2.0/24
nexthop : 172.19.0.1
vlan : 40
attachConfiguration : br-osp
- name : storage_mgmt_leaf1
ipv4 :
allocationEnd : 172.19.1.250
allocationStart : 172.19.1.10
cidr : 172.19.1.0/24
routes :
- destination : 172.19.0.0/24
nexthop : 172.19.1.1
- destination : 172.19.2.0/24
nexthop : 172.19.1.1
vlan : 41
attachConfiguration : br-osp
- name : storage_mgmt_leaf2
ipv4 :
allocationEnd : 172.19.2.250
allocationStart : 172.19.2.10
cidr : 172.19.2.0/24
routes :
- destination : 172.19.0.0/24
nexthop : 172.19.2.1
- destination : 172.19.1.0/24
nexthop : 172.19.2.1
vlan : 42
attachConfiguration : br-osp
- name : Tenant
nameLower : tenant
vip : False
mtu : 1350
subnets :
- name : tenant
ipv4 :
allocationEnd : 172.20.0.250
allocationStart : 172.20.0.10
cidr : 172.20.0.0/24
routes :
- destination : 172.20.1.0/24
nexthop : 172.20.0.1
- destination : 172.20.2.0/24
nexthop : 172.20.0.1
vlan : 50
attachConfiguration : br-osp
- name : tenant_leaf1
ipv4 :
allocationEnd : 172.20.1.250
allocationStart : 172.20.1.10
cidr : 172.20.1.0/24
routes :
- destination : 172.20.0.0/24
nexthop : 172.20.1.1
- destination : 172.20.2.0/24
nexthop : 172.20.1.1
vlan : 51
attachConfiguration : br-osp
- name : tenant_leaf2
ipv4 :
allocationEnd : 172.20.2.250
allocationStart : 172.20.2.10
cidr : 172.20.2.0/24
routes :
- destination : 172.20.0.0/24
nexthop : 172.20.2.1
- destination : 172.20.1.0/24
nexthop : 172.20.2.1
vlan : 52
attachConfiguration : br-osp
หากคุณเขียน Yaml ด้านบนลงในไฟล์ที่เรียกว่า NetworkConfig.yaml คุณสามารถสร้าง OpenStackNetConfig ผ่านคำสั่งนี้:
oc create -n openstack -f networkconfig.yaml
...
# ##############################################################################
# Role: ComputeLeaf1 #
# ##############################################################################
- name : ComputeLeaf1
description : |
Basic ComputeLeaf1 Node role
# Create external Neutron bridge (unset if using ML2/OVS without DVR)
tags :
- external_bridge
networks :
InternalApi :
subnet : internal_api_leaf1
Tenant :
subnet : tenant_leaf1
Storage :
subnet : storage_leaf1
HostnameFormatDefault : ' %stackname%-novacompute-leaf1-%index% '
...
# ##############################################################################
# Role: ComputeLeaf2 #
# ##############################################################################
- name : ComputeLeaf2
description : |
Basic ComputeLeaf1 Node role
# Create external Neutron bridge (unset if using ML2/OVS without DVR)
tags :
- external_bridge
networks :
InternalApi :
subnet : internal_api_leaf2
Tenant :
subnet : tenant_leaf2
Storage :
subnet : storage_leaf2
HostnameFormatDefault : ' %stackname%-novacompute-leaf2-%index% '
...
อัปเดต tarballConfigMap
configmap เพื่อเพิ่มไฟล์ roles_data.yaml
ไปยัง Tarball และอัปเดต configmap
หมายเหตุ : ตรวจสอบให้แน่ใจว่าใช้ roles_data.yaml
เป็นชื่อไฟล์
เทมเพลต OSP 16.2 Tripleo NIC มีพารามิเตอร์ interfaceroutes ต่อค่าเริ่มต้นรวมอยู่ด้วย พารามิเตอร์เส้นทางที่แสดงในสภาพแวดล้อม/Environment.yaml ซึ่งเป็นชื่อเส้นทางจะถูกตั้งค่าไว้ในคุณสมบัติ Neutron Network Host_routes และเพิ่มเข้ากับพารามิเตอร์ Interfaceroutes บทบาท เนื่องจากไม่มีนิวตรอนจำเป็นต้องเพิ่มเส้นทาง {{network.name}} ไปยังเทมเพลต NIC ที่จำเป็นและเชื่อมต่อทั้งสองรายการ:
parameters:
...
{{ $net.Name }}Routes:
default: []
description: >
Routes for the storage network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
...
- type: interface
...
routes:
list_concat_unique:
- get_param: {{ $net.Name }}Routes
- get_param: {{ $net.Name }}InterfaceRoutes
ข้อมูลเส้นทางย่อยจะได้รับการแสดงผลอัตโนมัติไปยัง environments/network-environment.yaml
ซึ่งใช้ในสคริปต์ที่แสดงผล playbooks Ansible ในเทมเพลต NIC จึงใช้เส้นทาง _ <subnet_name> เช่น storageRoutes_storage_leaf1 เพื่อตั้งค่าการกำหนดเส้นทางที่ถูกต้องบนโฮสต์
สำหรับบทบาทการคำนวณ computeleaf1 เทมเพลต NIC จะต้องได้รับการแก้ไขเพื่อใช้สิ่งเหล่านั้น:
...
StorageRoutes_storage_leaf1 :
default : []
description : >
Routes for the storage network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type : json
...
InternalApiRoutes_internal_api_leaf1 :
default : []
description : >
Routes for the internal_api network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type : json
...
TenantRoutes_tenant_leaf1 :
default : []
description : >
Routes for the internal_api network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type : json
...
get_param : StorageIpSubnet
routes :
list_concat_unique :
- get_param : StorageRoutes_storage_leaf1
- type : vlan
...
get_param : InternalApiIpSubnet
routes :
list_concat_unique :
- get_param : InternalApiRoutes_internal_api_leaf1
...
get_param : TenantIpSubnet
routes :
list_concat_unique :
- get_param : TenantRoutes_tenant_leaf1
- type : ovs_bridge
...
อัปเดต tarballConfigMap
configmap เพื่อเพิ่มไฟล์ NIC Templates roles_data.yaml
ไปยัง Tarball และอัปเดต configmap
หมายเหตุ : ตรวจสอบให้แน่ใจว่าใช้ roles_data.yaml
เป็นชื่อไฟล์
จนถึงตอนนี้มีการทดสอบ OSP16.2 ด้วยการปรับใช้ย่อยหลายรายการและเข้ากันได้กับ OSP17.0 Singnet Subnet เดี่ยว
TBD
ตรวจสอบให้แน่ใจว่าได้เพิ่มเทมเพลต NIC ที่สร้างขึ้นใหม่ลงในไฟล์สภาพแวดล้อมไปยัง resource_registry
สำหรับบทบาทโหนดใหม่:
resource_registry :
OS::TripleO::Compute::Net::SoftwareConfig : net-config-two-nic-vlan-compute.yaml
OS::TripleO::ComputeLeaf1::Net::SoftwareConfig : net-config-two-nic-vlan-compute_leaf1.yaml
OS::TripleO::ComputeLeaf2::Net::SoftwareConfig : net-config-two-nic-vlan-compute_leaf2.yaml
ณ จุดนี้เราสามารถจัดเตรียม overcloud ได้
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackControlPlane
metadata :
name : overcloud
namespace : openstack
spec :
gitSecret : git-secret
openStackClientImageURL : registry.redhat.io/rhosp-rhel8/openstack-tripleoclient:16.2
openStackClientNetworks :
- ctlplane
- external
- internal_api
- internal_api_leaf1 # optionally the openstackclient can also be connected to subnets
openStackClientStorageClass : host-nfs-storageclass
passwordSecret : userpassword
domainName : ostest.test.metalkube.org
virtualMachineRoles :
Controller :
roleName : Controller
roleCount : 1
networks :
- ctlplane
- internal_api
- external
- tenant
- storage
- storage_mgmt
cores : 6
memory : 20
rootDisk :
diskSize : 40
baseImageVolumeName : controller-base-img
storageClass : host-nfs-storageclass
storageAccessMode : ReadWriteMany
storageVolumeMode : Filesystem
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackBaremetalSet
metadata :
name : computeleaf1
namespace : openstack
spec :
# How many nodes to provision
count : 1
# The image to install on the provisioned nodes
baseImageUrl : http://192.168.111.1/images/rhel-guest-image-8.4-1168.x86_64.qcow2
provisionServerName : openstack
# The secret containing the SSH pub key to place on the provisioned nodes
deploymentSSHSecret : osp-controlplane-ssh-keys
# The interface on the nodes that will be assigned an IP from the mgmtCidr
ctlplaneInterface : enp7s0
# Networks to associate with this host
networks :
- ctlplane
- internal_api_leaf1
- external
- tenant_leaf1
- storage_leaf1
roleName : ComputeLeaf1
passwordSecret : userpassword
apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackBaremetalSet
metadata :
name : computeleaf2
namespace : openstack
spec :
# How many nodes to provision
count : 1
# The image to install on the provisioned nodes
baseImageUrl : http://192.168.111.1/images/rhel-guest-image-8.4-1168.x86_64.qcow2
provisionServerName : openstack
# The secret containing the SSH pub key to place on the provisioned nodes
deploymentSSHSecret : osp-controlplane-ssh-keys
# The interface on the nodes that will be assigned an IP from the mgmtCidr
ctlplaneInterface : enp7s0
# Networks to associate with this host
networks :
- ctlplane
- internal_api_leaf2
- external
- tenant_leaf2
- storage_leaf2
roleName : ComputeLeaf2
passwordSecret : userpassword
กำหนด OpenStackConfigGenerator เพื่อสร้าง playbooks ansible สำหรับการปรับใช้คลัสเตอร์ OSP เช่นเดียวกับใน Deploying OpenStack once you have the OSP Director Operator installed
และระบุบทบาทที่สร้างบทบาท
ตามที่อธิบายไว้ก่อนหน้าใน Run the software deployment
ใช้ลงทะเบียนโหนด overcloud ไปยังที่เก็บที่ต้องการและเรียกใช้การปรับใช้ Sofware จากภายใน Pod OpenStackClient
OSP-D Operator ให้ API เพื่อสร้างและกู้คืนการสำรองข้อมูลของ CR ปัจจุบัน configMap และการกำหนดค่าความลับ API นี้ประกอบด้วย CRD สองตัว:
OpenStackBackupRequest
OpenStackBackup
CRD OpenStackBackupRequest
ใช้เพื่อเริ่มต้นการสร้างหรือการคืนค่าการสำรองข้อมูลในขณะที่ OpenStackBackup
CRD ใช้เพื่อจัดเก็บ CR, configmap และข้อมูลลับที่เป็นของผู้ให้บริการ ซึ่งจะช่วยให้ได้รับประโยชน์หลายประการ:
OpenStackBackup
CR เดียวผู้ใช้ไม่จำเป็นต้องส่งออก/นำเข้าแต่ละชิ้นของการกำหนดค่าของผู้ประกอบการแต่ละชิ้นด้วยตนเองOpenStackBackup
ใหม่ให้สร้าง OpenStackBackupRequest
ด้วยการตั้ง mode
เพื่อ save
ในข้อมูลจำเพาะ ตัวอย่างเช่น: apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackBackupRequest
metadata :
name : openstackbackupsave
namespace : openstack
spec :
mode : save
additionalConfigMaps : []
additionalSecrets : []
ฟิลด์ Spec มีดังนี้:
mode: save
ระบุว่านี่เป็นคำขอในการสร้างการสำรองข้อมูลadditionalConfigMaps
และ additionalSecrets
อาจใช้เพื่อรวมการกำหนดค่าเพิ่มเติมและความลับที่ผู้ประกอบการไม่ทราบ (เช่น configmaps และความลับที่สร้างขึ้นด้วยตนเองเพื่อวัตถุประสงค์บางอย่าง)OpenStackControlPlane
, OpenStackBaremetalSet
ฯลฯ ) ในเนมสเปซโดยไม่ต้องให้ผู้ใช้รวมไว้ในรายการเพิ่มเติมเหล่านี้OpenStackBackupRequest
ถูกสร้างขึ้นแล้วให้ตรวจสอบสถานะของมัน: oc get -n openstack osbackuprequest openstackbackupsave
สิ่งนี้ควรปรากฏขึ้น:
NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP
openstackbackupsave save Quiescing
สถานะ Quiescing
บ่งชี้ว่าผู้ประกอบการกำลังรอการจัดสรรสถานะของผู้ประกอบการ OSP-D ทั้งหมด CRS เพื่อให้ได้ "เสร็จสิ้น" เทียบเท่า เวลาที่ต้องใช้สำหรับสิ่งนี้จะแตกต่างกันไปตามปริมาณของ CRS ผู้ประกอบการ OSP-D และเหตุการณ์ที่เกิดขึ้นของสถานะการจัดเตรียมในปัจจุบันของพวกเขา หมายเหตุ: เป็นไปได้ว่าผู้ประกอบการจะไม่หยุดนิ่งอย่างสมบูรณ์เนื่องจากข้อผิดพลาดและ/หรือ "รอ" รัฐใน CRS ที่มีอยู่ หากต้องการดูว่า CRDS/CRS ใดที่ป้องกันการหยุดนิ่งให้ตรวจสอบบันทึกของผู้ปฏิบัติงาน ตัวอย่างเช่น:
oc logs < OSP-D operator pod > -c manager -f
...
2022-01-11T18:26:15.180Z INFO controllers.OpenStackBackupRequest Quiesce for save for OpenStackBackupRequest openstackbackupsave is waiting for: [OpenStackBaremetalSet: compute, OpenStackControlPlane: overcloud, OpenStackVMSet: controller]
หาก OpenStackBackupRequest
เข้าสู่สถานะ Error
ให้ดูที่เนื้อหาเต็มรูปแบบเพื่อดูข้อผิดพลาดที่พบ ( oc get -n openstack openstackbackuprequest <name> -o yaml
)
OpenStackBackupRequest
ได้รับเกียรติจากการสร้างและบันทึก OpenStackBackup
ที่เป็นตัวแทนของการกำหนดค่า OSP-D ปัจจุบันมันจะเข้าสู่สถานะ Saved
ตัวอย่างเช่น: oc get -n openstack osbackuprequest
NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP
openstackbackupsave save Saved 2022-01-11T19:12:58Z
OpenStackBackup
ที่เกี่ยวข้องจะถูกสร้างขึ้นเช่นกัน ตัวอย่างเช่น:
oc get -n openstack osbackup
NAME AGE
openstackbackupsave-1641928378 6m7s
OpenStackBackup
ให้สร้าง OpenStackBackupRequest
ด้วยการตั้ง mode
เพื่อ restore
ในข้อมูลจำเพาะ ตัวอย่างเช่น: apiVersion : osp-director.openstack.org/v1beta1
kind : OpenStackBackupRequest
metadata :
name : openstackbackuprestore
namespace : openstack
spec :
mode : restore
restoreSource : openstackbackupsave-1641928378
ฟิลด์ Spec มีดังนี้:
mode: restore
ระบุว่านี่เป็นคำขอคืนค่า OpenStackBackup
ที่มีอยู่restoreSource
ระบุว่าควรเรียกคืน OpenStackBackup
ใด ด้วยการตั้ง mode
เพื่อ restore
ผู้ประกอบการ OSP-D จะนำเนื้อหาของ restoreSource
OpenStackBackup
และพยายามที่จะนำไปใช้กับ CRS, configmaps และความลับ ที่มี อยู่ในปัจจุบันภายในเนมสเปซ ดังนั้นมันจะเขียนทับทรัพยากร OSP-D ที่มีอยู่ในเนมสเปซด้วยชื่อเดียวกับที่อยู่ใน OpenStackBackup
และจะสร้างทรัพยากรใหม่สำหรับผู้ที่ไม่พบในเนมสเปซ หากต้องการ mode
สามารถตั้งค่าเป็น cleanRestore
เพื่อเช็ดทรัพยากรผู้ให้บริการ OSP-D ที่มีอยู่ภายในเนมสเปซอย่างสมบูรณ์ก่อนที่จะพยายามฟื้นฟูเช่นทรัพยากรทั้งหมดภายใน OpenStackBackup
จะถูกสร้างขึ้นใหม่อย่างสมบูรณ์
OpenStackBackupRequest
ถูกสร้างขึ้นแล้วให้ตรวจสอบสถานะของมัน: oc get -n openstack osbackuprequest openstackbackuprestore
สิ่งนี้ควรปรากฏขึ้นเพื่อระบุว่าทรัพยากรทั้งหมดจาก OpenStackBackup
กำลังถูกนำไปใช้กับคลัสเตอร์:
NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP
openstackbackuprestore restore openstackbackupsave-1641928378 Loading
จากนั้นเมื่อมีการโหลดทรัพยากรทั้งหมดผู้ประกอบการจะเริ่มกระทบยอดเพื่อพยายามจัดหาทรัพยากรทั้งหมด:
NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP
openstackbackuprestore restore openstackbackupsave-1641928378 Reconciling
หาก OpenStackBackupRequest
เข้าสู่สถานะ Error
ให้ดูที่เนื้อหาเต็มรูปแบบเพื่อดูข้อผิดพลาดที่พบ ( oc get -n openstack openstackbackuprequest <name> -o yaml
)
OpenStackBackupRequest
ได้รับเกียรติจากการกู้คืน OpenStackBackup
อย่างเต็มที่มันจะเข้าสู่สถานะ Restored
ตัวอย่างเช่น: oc get -n openstack osbackuprequest
NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP
openstackbackuprestore restore openstackbackupsave-1641928378 Restored 2022-01-12T13:48:57Z
ณ จุดนี้ทรัพยากรทั้งหมดที่มีอยู่กับ OpenStackBackup
ที่เลือกควรได้รับการฟื้นฟูและจัดเตรียมอย่างเต็มที่
OSP Director Operator จะสร้าง configmap โดยอัตโนมัติหลังจากการดำเนินการทรัพยากร OsDeploy แต่ละครั้งเสร็จสิ้นการดำเนินการ configmap นี้ได้รับการตั้งชื่อตามชื่อทรัพยากร osdeploy และนำหน้าด้วยการส่งออกสามเท่า- ตัวอย่างเช่น tripleo-exports-default จะเป็นชื่อของ configmap สำหรับทรัพยากร osdeploy 'เริ่มต้น' แต่ละ configmap มีไฟล์ YAML 2 ไฟล์:
ชื่อไฟล์ | คำอธิบาย | คำสั่ง Tripleo เทียบเท่า |
---|---|---|
ctlplane-export.yaml | ใช้กับหลายสแต็คสำหรับ DCN | การส่งออกมากเกินไป |
CTLPLANE- ออกส่งออก filtered.yaml | ใช้สำหรับสแต็คหลายสแต็คด้วยสแต็ค "เซลล์" | การส่งออกเซลล์มากเกินไป |
ใช้คำสั่งด้านล่างเพื่อแยกไฟล์ YAML จาก configmap เมื่อแยกไฟล์ YAML สามารถเพิ่มลงในพารามิเตอร์ความร้อนที่กำหนดเองบนทรัพยากร Osconfiggenerator
oc extract cm/tripleo-exports-default
หมายเหตุ: ผู้อำนวยการผู้อำนวยการ OSP ยังไม่ได้สร้างการส่งออกสำหรับ Ceph Stacks
หากจำเป็นต้องเปลี่ยน CPU/RAM ของ OpenStackVMSET ที่กำหนดค่าผ่าน OpenStackControlplane เวิร์กโฟลว์มีดังนี้:
เช่นการเปลี่ยน VirtualMachinerole คอนโทรลเลอร์ให้มี 8 คอร์และ RAM 22GB:
oc patch -n openstack osctlplane overcloud --type= ' json ' -p= ' [{"op": "add", "path": "/spec/virtualMachineRoles/controller/cores", "value": 8 }] '
oc patch -n openstack osctlplane overcloud --type= ' json ' -p= ' [{"op": "add", "path": "/spec/virtualMachineRoles/controller/memory", "value": 22 }] '
oc get osvmset
NAME CORES RAM DESIRED READY STATUS REASON
controller 8 22 1 1 Provisioned All requested VirtualMachines have been provisioned
virtctl start <VM>
เพื่อเพิ่มพลังให้กับ VM อีกครั้ง ดูเอกสารกระบวนการอัปเดต OSP