diff options
-rw-r--r-- | config/pdf/pod1.encrypted.yaml | 4 | ||||
-rw-r--r-- | config/pdf/pod1.schema.yaml | 44 | ||||
-rw-r--r-- | config/pdf/pod1.yaml | 4 | ||||
-rwxr-xr-x | config/utils/check-schema.sh | 7 | ||||
-rwxr-xr-x | config/utils/generate_config.py | 4 | ||||
-rw-r--r-- | labs/ool/idf-pod1.yaml | 66 | ||||
-rw-r--r-- | labs/ool/pod1.yaml | 204 |
7 files changed, 314 insertions, 19 deletions
diff --git a/config/pdf/pod1.encrypted.yaml b/config/pdf/pod1.encrypted.yaml index b5c78b50..c2512632 100644 --- a/config/pdf/pod1.encrypted.yaml +++ b/config/pdf/pod1.encrypted.yaml @@ -54,7 +54,8 @@ jumphost: os: ubuntu-14.04 remote_params: &remote_params # hardware management tool - type: {ipmi|amt} + type: {ipmi|amt|libvirt} + # array of supported versions, mandatory for all but 'libvirt' versions: - 1.0 - 2.0 @@ -82,6 +83,7 @@ jumphost: remote_management: <<: *remote_params address: 10.4.7.3/24 + # MAC address is mandatory for all BMC types but 'libvirt' mac_address: "10:23:45:67:89:AC" # physical interface list interfaces: diff --git a/config/pdf/pod1.schema.yaml b/config/pdf/pod1.schema.yaml index 2a96d0b2..33b2d8c3 100644 --- a/config/pdf/pod1.schema.yaml +++ b/config/pdf/pod1.schema.yaml @@ -69,25 +69,45 @@ definitions: additionalProperties: false remote_management: v1.0: - type: 'object' properties: - type: - type: 'string' - enum: ['ipmi', 'amt'] - versions: - type: 'array' - items: - type: 'number' - enum: [1.0, 2.0] user: type: 'string' pass: type: 'string' + type: + type: 'string' + versions: + type: 'array' address: - $ref: '#/definitions/ip_address' + type: 'string' mac_address: - $ref: '#/definitions/mac_address' - required: ['type', 'versions', 'user', 'pass', 'address', 'mac_address'] + type: 'string' + # These subsections are best validated separately for baremetal/virtual + oneOf: + - type: 'object' + properties: + type: + type: 'string' + enum: ['ipmi', 'amt'] + versions: + type: 'array' + items: + type: 'number' + enum: [1.0, 2.0] + address: + $ref: '#/definitions/ip_address' + mac_address: + $ref: '#/definitions/mac_address' + required: ['type', 'versions', 'address', 'mac_address'] + - type: 'object' + properties: + type: + type: 'string' + enum: ['libvirt'] + address: + type: 'string' # Loose validation of libvirt URI for now + required: ['type', 'address'] + required: ['user', 'pass'] additionalProperties: false interfaces: v1.0: diff --git a/config/pdf/pod1.yaml b/config/pdf/pod1.yaml index d0cd7931..4ea751ec 100644 --- a/config/pdf/pod1.yaml +++ b/config/pdf/pod1.yaml @@ -54,7 +54,8 @@ jumphost: os: ubuntu-14.04 remote_params: &remote_params # hardware management tool - type: {ipmi|amt} + type: {ipmi|amt|libvirt} + # array of supported versions, mandatory for all but 'libvirt' versions: - 1.0 - 2.0 @@ -63,6 +64,7 @@ jumphost: remote_management: <<: *remote_params address: 10.4.7.3/24 + # MAC address is mandatory for all BMC types but 'libvirt' mac_address: "10:23:45:67:89:AC" # physical interface list interfaces: diff --git a/config/utils/check-schema.sh b/config/utils/check-schema.sh index 0cdc6f29..041c0308 100755 --- a/config/utils/check-schema.sh +++ b/config/utils/check-schema.sh @@ -16,8 +16,9 @@ RC=0 SUMMARY+=";;PDF;IDF;\n" while IFS= read -r lab_config; do + idf_config="$(dirname "${lab_config}")/idf-$(basename "${lab_config}")" pdf_cmd="${VALIDATE_SCHEMA} -s ${PDF_SCHEMA} -y ${lab_config}" - idf_cmd="${VALIDATE_SCHEMA} -s ${IDF_SCHEMA} -y ${lab_config/pod/idf-pod}" + idf_cmd="${VALIDATE_SCHEMA} -s ${IDF_SCHEMA} -y ${idf_config}" echo "###################### ${lab_config} ######################" pdf_out=$(${pdf_cmd} 2>&1 | sed 's|ENC\[PKCS.*\][\\n]*|opnfv|g') if [ -z "${pdf_out}" ]; then @@ -29,7 +30,7 @@ while IFS= read -r lab_config; do echo "${pdf_out}" echo "[PDF] [ERROR] ${pdf_cmd}" fi - if [ ! -f "${lab_config/pod/idf-pod}" ]; then + if [ ! -f "${idf_config}" ]; then SUMMARY+="-;\n" elif ${idf_cmd}; then SUMMARY+="OK;\n" @@ -40,7 +41,7 @@ while IFS= read -r lab_config; do echo "[IDF] [ERROR] ${idf_cmd}" fi echo '' -done < <(find 'labs' -name 'pod*.yaml') +done < <(find 'labs' -name 'pod*.yaml' -or -name 'virtual*.yaml') cat <<EOF ###################### Schema Validation Matrix ###################### diff --git a/config/utils/generate_config.py b/config/utils/generate_config.py index 11d42caf..93e839bd 100755 --- a/config/utils/generate_config.py +++ b/config/utils/generate_config.py @@ -55,7 +55,7 @@ try: DICT['details'] except (NameError, TypeError) as ex: with open(ARGS.yaml) as _: - DICT = yaml.load(_, Loader=LOADER) + DICT = yaml.load(_.read().replace('/', '__slash__'), Loader=LOADER) # If an installer descriptor file (IDF) exists, include it (temporary) IDF_PATH = '/idf-'.join(split(ARGS.yaml)) @@ -69,7 +69,7 @@ if exists(IDF_PATH): for _j2 in ARGS.jinja2: TEMPLATE = ENV.get_template(_j2) - OUTPUT = TEMPLATE.render(conf=DICT) + OUTPUT = TEMPLATE.render(conf=DICT).replace('__slash__', '/') # Render template and write generated conf to file or stdout if ARGS.batch: if _j2.endswith('.j2'): diff --git a/labs/ool/idf-pod1.yaml b/labs/ool/idf-pod1.yaml new file mode 100644 index 00000000..d27b0acc --- /dev/null +++ b/labs/ool/idf-pod1.yaml @@ -0,0 +1,66 @@ +############################################################################## +# Copyright (c) 2018 Okinawa Open Labratory. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +### This is a OOL Installer descriptor file ### + +idf: + version: 0.1 + # NOTE: Temporarily disable Daisy check, since it requires 'storage' network + # to be defined in 'idf.net_config' below. + installer: ['apex', 'fuel'] + net_config: + admin: + interface: 0 + vlan: native + network: 192.168.103.0 + mask: 24 + mgmt: + interface: 2 + vlan: 101 + network: 192.168.104.0 + mask: 24 + public: + interface: 2 + vlan: 102 + network: 192.168.106.0 + mask: 24 + private: + interface: 1 + vlan: native + network: 192.168.25.0 + mask: 24 + gateway: 192.168.20.254 + dns: + - 8.8.8.8 + fuel: + jumphost: + bridges: + admin: 'br-em1' + mgmt: 'br0' + public: 'br-ex' + private: ~ + network: + node: + # Ordered-list, index should be in sync with node index in PDF + - interfaces: &interfaces + # Ordered-list, index should be in sync with interface index in PDF + - 'eno2' + - 'eno3' + - 'eno4' + busaddr: &busaddr + - '0000:01:00.0' + - '0000:07:00.0' + - '0000:07:00.1' + - interfaces: *interfaces + busaddr: *busaddr + - interfaces: *interfaces + busaddr: *busaddr + - interfaces: *interfaces + busaddr: *busaddr + - interfaces: *interfaces + busaddr: *busaddr diff --git a/labs/ool/pod1.yaml b/labs/ool/pod1.yaml new file mode 100644 index 00000000..befb3ab5 --- /dev/null +++ b/labs/ool/pod1.yaml @@ -0,0 +1,204 @@ +############################################################################## +# Copyright (c) 2018 Okinawa Open Labratory Inc. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +### Okinawa Open Labratory POD descriptor file ### +version: 1.0 +details: + pod_owner: Hideayasu Hayashi + contact: opnfv-ool-member@okinawaopenlabs.org + lab: Okinawa Open Lab Testlab + location: Okinawa, Japan + type: development + link: https://wiki.opnfv.org/display/pharos/OOL+Hosting +########################################################### + +jumphost: + name: OPNFV-Jump + node: + type: baremetal + vendor: SuperMicro + model: SYS-5018R-WR + arch: x86_64 + cpus: 1 + cpu_cflags: Haswell + cores: 16 + memory: 32GB + disks: + - name: 'disk1' + disk_capacity: 2TB + disk_type: hdd + disk_interface: sata + disk_rotation: 7200 + os: ubuntu-16.04 + remote_params: &remote_params + type: ipmi + versions: + - 1.0 + - 2.0 + user: > + ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw + DQYJKoZIhvcNAQEBBQAEggEAF2ppKLPzAigPgVqFhC0wnAJPImX04Ql5kKr7 + cq3G8eiDIm4AfTOwW3iJf8srdChaVnseriher6cdietFwr3xoVYe/r1qD/Bp + IrmD79lNrbPMTwA8ESRmroKhxpxvRDziOUc5T9ev942n6BGs0iBjHMl96ZcN + UscPrV6iHtUfEN1ZaEx0kv217vSv5JWUp4gf10ZHJEN12gAxZBuuKRr59dbw + kGtn5QRjEQ1g7PKDTa3HIKUkxN9snPzAIrXtXsG4O/HmUl0UEUlJ4O5/+wBN + kE/a9/OqMs9+KWmFZ1PRw35WIFpk7vS2HI7HfLab3AHKRySBnTAoGIdnqd+I + se5pQzA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBXF6x8Rg0xNCGXOUio + 2oqhgBCQ0jBbqpN9e904KFAjRZWA] + pass: > + ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw + DQYJKoZIhvcNAQEBBQAEggEARKDnZBM1SMOd3e/dxlRV21TGiIs5ezpHqG7f + CbKlOim5KW/siiHGN9S5JnTY62CDGLrSgen5Sstk7LzAOPNRJKxf3sjhE2jT + 1AlyQ7TuYYSeyOzgaV0Us5okOP3BcAZwM5Dvb4HLyg2S48Auy7Vx34DpWrTr + yxh6v3VJbLYyD2G5bhU4lHzNfaTifiYoV16lmCD4ZlCfQVqjVcKIqztQUGJ4 + NpoJhjAwE07+M3jQWYNdHKoHBTNqe3ZVT3w5ee80zQHZ8yhwISHYB5RWUwzG + FKGBBBl0LuxXJBGv7KorRso9v5TBB1m9V8Yl+k/4YHrOfeZBkU1kTjQ2WnNx + jbzBQzA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBA6Ipn6y8ilwzbgu3Xa + 2N/VgBBn8rx1meQwP0Wc7lYkqn/5] + remote_management: + <<: *remote_params + address: 192.168.25.10 + mac_address: "0c:c4:7a:6c:a2:b2" + interfaces: + - mac_address: "0c:c4:7a:6c:a2:b2" + speed: 1gb + features: null + name: 'nic1' + - mac_address: "0c:c4:7a:6c:a2:b3" + speed: 1gb + features: null + name: 'nic2' + +#################################################### +nodes: + - name: node-9 + node: &nodeparams + type: baremetal + vendor: FUJITSU + model: RX2530 M1 + arch: x86_64 + cpus: 1 + cpu_cflags: Haswell + cores: 16 + memory: 32GB + disks: &disks + - name: 'disk1' + disk_capacity: 2TB + disk_type: hdd + disk_interface: sata + disk_rotation: 7200 + - name: 'disk2' + disk_capacity: 100GB + disk_type: ssd + disk_interface: sata + disk_rotation: 0 + remote_management: + <<: *remote_params + address: 192.168.1.20" + mac_address: "90:1b:0e:6b:e8:a8" + interfaces: + - mac_address: "90:1b:0e:6b:e8:a9" + speed: 1gb + features: null + name: 'nic2' + - mac_address: "90:1b:0e:6b:e8:aa" + speed: 1gb + features: null + name: 'nic3' + - mac_address: "90:1b:0e:6b:e8:ab" + speed: 1gb + features: null + name: 'nic4' + + #################################################### + - name: node-10 + node: *nodeparams + disks: *disks + remote_management: + <<: *remote_params + address: 192.168.1.21" + mac_address: "90:1b:0e:6b:e3:00" + interfaces: + - mac_address: "90:1b:0e:6b:e3:01" + speed: 1gb + features: null + name: 'nic2' + - mac_address: "90:1b:0e:6b:e3:02" + speed: 1gb + features: null + name: 'nic3' + - mac_address: "90:1b:0e:6b:e3:03" + speed: 1gb + features: null + name: 'nic4' + + #################################################### + - name: node-11 + node: *nodeparams + disks: *disks + remote_management: + <<: *remote_params + address: 192.168.1.22 + mac_address: "90:1b:0e:6b:e5:b4" + interfaces: + - mac_address: "90:1b:0e:6b:e5:b5" + speed: 1gb + features: null + name: 'nic2' + - mac_address: "90:1b:0e:6b:e5:b6" + speed: 1gb + features: null + name: 'nic3' + - mac_address: "90:1b:0e:6b:e5:b7" + speed: 1gb + features: null + name: 'nic4' + + #################################################### + - name: node-12 + node: *nodeparams + disks: *disks + remote_management: + <<: *remote_params + address: 192.168.1.23 + mac_address: "90:1b:0e:6b:e8:a8" + interfaces: + - mac_address: "90:1b:0e:6b:e8:a9" + speed: 1gb + features: null + name: 'nic2' + - mac_address: "90:1b:0e:6b:e8:aa" + speed: 1gb + features: null + name: 'nic3' + - mac_address: "90:1b:0e:6b:e8:ab" + speed: 1gb + features: null + name: 'nic4' + + #################################################### + - name: node-13 + node: *nodeparams + disks: *disks + remote_management: + <<: *remote_params + address: 192.168.1.24 + mac_address: "90:1b:0e:6b:e3:00" + interfaces: + - mac_address: "90:1b:0e:6b:e3:01" + speed: 1gb + features: null + name: 'nic2' + - mac_address: "90:1b:0e:6b:e3:02" + speed: 1gb + features: null + name: 'nic3' + - mac_address: "90:1b:0e:6b:e3:03" + speed: 1gb + features: null + name: 'nic4' |