Skip to content

Commit c7d6902

Browse files
committed
Create Nova Alpha 01 DT scenario
1 parent feaa133 commit c7d6902

File tree

28 files changed

+1309
-0
lines changed

28 files changed

+1309
-0
lines changed

automation/vars/nova01alpha.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
vas:
3+
nova01alpha:
4+
stages:
5+
- path: examples/dt/nova/nova01alpha/nncp
6+
wait_conditions:
7+
- >-
8+
oc -n openstack wait nncp
9+
-l osp/nncm-config-type=standard
10+
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured
11+
--timeout=60s
12+
values:
13+
- name: network-values
14+
src_file: values.yaml
15+
build_output: nncp.yaml
16+
17+
- path: examples/dt/nova/nova01alpha
18+
wait_conditions:
19+
- >-
20+
oc -n openstack wait osctlplane controlplane --for condition=Ready
21+
--timeout=600s
22+
values:
23+
- name: network-values
24+
src_file: nncp/values.yaml
25+
- name: service-values
26+
src_file: service-values.yaml
27+
build_output: control-plane.yaml
28+
29+
- path: examples/dt/nova/nova01alpha/edpm/nodeset
30+
wait_conditions:
31+
- >-
32+
oc -n openstack wait
33+
osdpns openstack-edpm --for condition=SetupReady
34+
--timeout=60m
35+
values:
36+
- name: edpm-nodeset-values
37+
src_file: values.yaml
38+
build_output: nodeset.yaml
39+
40+
- path: examples/dt/nova/nova01alpha/edpm/deployment
41+
wait_conditions:
42+
- >-
43+
oc -n openstack wait
44+
osdpd edpm-deployment --for condition=Ready
45+
--timeout=90m
46+
values:
47+
- name: edpm-deployment-values
48+
src_file: values.yaml
49+
build_output: deployment.yaml
50+
51+
- path: examples/dt/nova/nova01alpha/edpm-post-driver/deployment
52+
wait_conditions:
53+
- >-
54+
oc -n openstack wait
55+
osdpd edpm-deployment-post-driver --for condition=Ready
56+
--timeout=20m
57+
values:
58+
- name: edpm-deployment-post-driver
59+
src_file: values.yaml
60+
build_output: post-driver-deployment.yaml

dt/nova/nova01alpha/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Deployed Topology - Nova/nova01alpha
2+
3+
If you are looking for information on how to deploy the nova01alpha based DT, then
4+
please see the
5+
[README](../../../examples/dt/nova/nova01alpha/README.md) in the examples
6+
directory.
7+
8+
This directory ,`dt/nova/nova01alpha/`, exists so that the
9+
[kustomization.yaml](../../../examples/dt/nova/nova01alpha/edpm/nodeset/kustomization.yaml)
10+
in the examples directory of nova01alpha topology, reference it by path as a
11+
component. It's contents are likely uninteresting unless you want to understand
12+
how kustomize was implemented in this repository.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
5+
transformers:
6+
# Set namespace to OpenStack on all namespaced objects without a namespace
7+
- |-
8+
apiVersion: builtin
9+
kind: NamespaceTransformer
10+
metadata:
11+
name: _ignored_
12+
namespace: openstack
13+
setRoleBindingSubjects: none
14+
unsetOnly: true
15+
fieldSpecs:
16+
- path: metadata/name
17+
kind: Namespace
18+
create: true
19+
20+
components:
21+
- ../../../../../lib/dataplane/deployment
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
5+
transformers:
6+
# Set namespace to OpenStack on all namespaced objects without a namespace
7+
- |-
8+
apiVersion: builtin
9+
kind: NamespaceTransformer
10+
metadata:
11+
name: _ignored_
12+
namespace: openstack
13+
setRoleBindingSubjects: none
14+
unsetOnly: true
15+
fieldSpecs:
16+
- path: metadata/name
17+
kind: Namespace
18+
create: true
19+
20+
components:
21+
- ../../../../../lib/dataplane/deployment
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: v1
3+
data:
4+
NodeRootPassword: _replaced_
5+
kind: Secret
6+
metadata:
7+
name: baremetalset-password-secret
8+
namespace: openstack
9+
type: Opaque
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
5+
transformers:
6+
# Set namespace to OpenStack on all namespaced objects without a namespace
7+
- |-
8+
apiVersion: builtin
9+
kind: NamespaceTransformer
10+
metadata:
11+
name: _ignored_
12+
namespace: openstack
13+
setRoleBindingSubjects: none
14+
unsetOnly: true
15+
fieldSpecs:
16+
- path: metadata/name
17+
kind: Namespace
18+
create: true
19+
20+
components:
21+
- ../../../../../lib/dataplane/nodeset
22+
23+
resources:
24+
- baremetalset-password-secret.yaml
25+
- nova_sriov.yaml
26+
27+
replacements:
28+
- source:
29+
kind: ConfigMap
30+
name: edpm-nodeset-values
31+
fieldPath: data.root_password
32+
targets:
33+
- select:
34+
kind: Secret
35+
name: baremetalset-password-secret
36+
fieldPaths:
37+
- data.NodeRootPassword
38+
options:
39+
create: true
40+
41+
# Nova compute CPU pinning customization
42+
- source:
43+
kind: ConfigMap
44+
name: edpm-nodeset-values
45+
fieldPath: data.nova.compute.conf
46+
targets:
47+
- select:
48+
kind: ConfigMap
49+
name: cpu-pinning-nova
50+
fieldPaths:
51+
- data.25-cpu-pinning-nova\.conf
52+
options:
53+
create: true
54+
# Nova compute PCI passthrough customization
55+
- source:
56+
kind: ConfigMap
57+
name: edpm-nodeset-values
58+
fieldPath: data.nova.pci.conf
59+
targets:
60+
- select:
61+
kind: ConfigMap
62+
name: sriov-nova
63+
fieldPaths:
64+
- data.03-sriov-nova\.conf
65+
options:
66+
create: true
67+
- source:
68+
kind: ConfigMap
69+
name: edpm-nodeset-values
70+
fieldPath: data.preProvisioned
71+
targets:
72+
- select:
73+
kind: OpenStackDataPlaneNodeSet
74+
name: openstack-edpm
75+
fieldPaths:
76+
- spec.preProvisioned
77+
options:
78+
create: true
79+
- source:
80+
kind: ConfigMap
81+
name: edpm-nodeset-values
82+
fieldPath: data.baremetalSetTemplate
83+
targets:
84+
- select:
85+
kind: OpenStackDataPlaneNodeSet
86+
name: openstack-edpm
87+
fieldPaths:
88+
- spec.baremetalSetTemplate
89+
options:
90+
create: true
91+
- source:
92+
kind: ConfigMap
93+
name: edpm-nodeset-values
94+
fieldPath: data.nova.mdev.nvidia_driver_url
95+
targets:
96+
- select:
97+
kind: ConfigMap
98+
name: nvidia-mdev-config
99+
fieldPaths:
100+
- data.nvidia_driver_url
101+
options:
102+
create: true
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: cpu-pinning-nova
6+
data:
7+
25-cpu-pinning-nova.conf: _replaced_
8+
---
9+
apiVersion: v1
10+
kind: ConfigMap
11+
metadata:
12+
name: sriov-nova
13+
data:
14+
03-sriov-nova.conf: _replaced_
15+
---
16+
apiVersion: v1
17+
kind: ConfigMap
18+
metadata:
19+
name: nvidia-mdev-config
20+
data:
21+
nvidia_driver_url: _replaced_
22+
---
23+
apiVersion: dataplane.openstack.org/v1beta1
24+
kind: OpenStackDataPlaneService
25+
metadata:
26+
name: nova-custom-sriov
27+
spec:
28+
label: dataplane-deployment-nova-custom-sriov
29+
edpmServiceType: nova
30+
dataSources:
31+
- configMapRef:
32+
name: cpu-pinning-nova
33+
- configMapRef:
34+
name: sriov-nova
35+
- secretRef:
36+
name: nova-cell1-compute-config
37+
- secretRef:
38+
name: nova-migration-ssh-key
39+
playbook: osp.edpm.nova
40+
tlsCerts:
41+
default:
42+
contents:
43+
- dnsnames
44+
- ips
45+
networks:
46+
- ctlplane
47+
issuer: osp-rootca-issuer-internal
48+
caCerts: combined-ca-bundle
49+
---
50+
apiVersion: dataplane.openstack.org/v1beta1
51+
kind: OpenStackDataPlaneService
52+
metadata:
53+
name: install-nvidia-mdev
54+
namespace: openstack
55+
spec:
56+
dataSources:
57+
- configMapRef:
58+
name: nvidia-mdev-config
59+
playbookContents: |
60+
- name: Install Nvidia Driver
61+
hosts: all
62+
tasks:
63+
- name: Blacklist nouveau
64+
become: true
65+
ansible.builtin.copy:
66+
dest: "/etc/modprobe.d/blacklist-nouveau.conf"
67+
mode: "0644"
68+
content: |-
69+
blacklist nouveau
70+
options nouveau modeset=0
71+
force: false
72+
register: _blacklist_nouveau
73+
- name: Get the Nvidia Driver URL
74+
delegate_to: localhost
75+
ansible.builtin.set_fact:
76+
nvidia_rpm_url: "{{ lookup('file', '/var/lib/openstack/configs/install-nvidia-mdev/nvidia_driver_url') | from_yaml }}"
77+
- name: Gather the package facts
78+
ansible.builtin.package_facts:
79+
manager: auto
80+
- name: Install nvidia driver RPM either from path or URL
81+
become: true
82+
ansible.builtin.dnf:
83+
name: "{{ nvidia_rpm_url }}"
84+
state: present
85+
disable_gpg_check: true
86+
when: nvidia_rpm_url not in ansible_facts.packages
87+
register: _nvidia_driver_install
88+
- name: Check if grub2-mkconfig has --update-bls-cmdline option
89+
ansible.builtin.shell:
90+
cmd: grub2-mkconfig --help | grep '\-\-update-bls-cmdline'
91+
ignore_errors: true
92+
register: check_update_bls_cmdline
93+
changed_when: false
94+
- name: Regenerate initramfs
95+
become: true
96+
ansible.builtin.command: "{{ item }}"
97+
loop:
98+
- 'dracut --force'
99+
- >-
100+
grub2-mkconfig -o /boot/grub2/grub.cfg
101+
{{ '--update-bls-cmdline'
102+
if check_update_bls_cmdline.rc == 0
103+
else '' }}
104+
when: _blacklist_nouveau.changed or _nvidia_driver_install.changed

0 commit comments

Comments
 (0)